diff options
Diffstat (limited to 'libstdc++-v3/testsuite/tr1')
567 files changed, 78356 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/1.cc new file mode 100644 index 000000000..e4f6c8505 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/1.cc @@ -0,0 +1,38 @@ +// 2006-09-24 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2006, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab] + +#include <tr1/memory> +#include <testsuite_tr1.h> + +// { dg-do compile } + +struct X : public std::tr1::enable_shared_from_this<X> +{ +}; + +int main() +{ + using __gnu_test::check_ret_type; + using std::tr1::shared_ptr; + + shared_ptr<X> spx(new X); + check_ret_type<shared_ptr<X> >(spx->shared_from_this()); +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared.cc new file mode 100644 index 000000000..dc4b895d8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared.cc @@ -0,0 +1,58 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct X : public std::tr1::enable_shared_from_this<X> +{ +}; + +int +test01() +{ + bool test __attribute__((unused)) = true; + + X x; + + try + { + std::tr1::shared_ptr<X> p = x.shared_from_this(); + VERIFY( false ); + } + catch (const std::tr1::bad_weak_ptr&) + { + // Expected. + VERIFY( true ); + } + catch (...) + { + // Failed. + VERIFY( false ); + } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared2.cc new file mode 100644 index 000000000..19d033346 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared2.cc @@ -0,0 +1,60 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct X : public std::tr1::enable_shared_from_this<X> +{ +}; + +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<X> p(new X); + + X x(*p); // copy of shared object should not be shared + + try + { + std::tr1::shared_ptr<X> p = x.shared_from_this(); + VERIFY( false ); + } + catch (const std::tr1::bad_weak_ptr&) + { + // Expected. + VERIFY( true ); + } + catch (...) + { + // Failed. + VERIFY( false ); + } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared3.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared3.cc new file mode 100644 index 000000000..8c58b049c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared3.cc @@ -0,0 +1,62 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct X : public std::tr1::enable_shared_from_this<X> +{ +}; + +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<X> p(new X); + + X x; + x = *p; // copy of shared object should not be shared + + try + { + std::tr1::shared_ptr<X> p = x.shared_from_this(); + VERIFY( false ); + } + catch (const std::tr1::bad_weak_ptr&) + { + // Expected. + VERIFY( true ); + } + catch (...) + { + // Failed. + VERIFY( false ); + } + + return 0; +} + + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc new file mode 100644 index 000000000..b090c4ba7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc @@ -0,0 +1,30 @@ +// Copyright (C) 2006, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab] + +#include <tr1/memory> +#include <testsuite_tr1.h> + +// { dg-do compile } + +using namespace __gnu_test; +using std::tr1::enable_shared_from_this; +template class enable_shared_from_this<int>; +template class enable_shared_from_this<void>; +template class enable_shared_from_this<ClassType>; +template class enable_shared_from_this<IncompleteClass>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/shared.cc new file mode 100644 index 000000000..3ea9d3e85 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/shared.cc @@ -0,0 +1,45 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct X : public std::tr1::enable_shared_from_this<X> +{ +}; + +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<X> p(new X); + std::tr1::shared_ptr<X> q = p->shared_from_this(); + VERIFY( p == q ); + VERIFY( !(p < q) && !(q < p) ); // p and q share ownership + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/still_shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/still_shared.cc new file mode 100644 index 000000000..beff2d4b7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/still_shared.cc @@ -0,0 +1,54 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct X : public std::tr1::enable_shared_from_this<X> +{ +}; + +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<X> p(new X); + + *p = X(); // assigning to shared object doesn't stop it being shared + + try + { + std::tr1::shared_ptr<X> p2 = p->shared_from_this(); + } + catch (const std::tr1::bad_weak_ptr&) + { + test = false; + } + VERIFY( test ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/functional/synopsis.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/functional/synopsis.cc new file mode 100644 index 000000000..a8c7231c1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/functional/synopsis.cc @@ -0,0 +1,34 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/functional> + +namespace std { +namespace tr1 { + + template <class T> class reference_wrapper; + template <class T> reference_wrapper<T> ref(T&); + template <class T> reference_wrapper<const T> cref(const T&); + template <class T> reference_wrapper<T> ref(reference_wrapper<T>); + template <class T> reference_wrapper<const T> cref(reference_wrapper<T>); + +} // namespace tr1 +} // namespace std diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/memory/synopsis.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/memory/synopsis.cc new file mode 100644 index 000000000..8f859a2a9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/memory/synopsis.cc @@ -0,0 +1,65 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/memory> + +namespace std { +namespace tr1 { + + // [2.2.2] Class bad_weak_ptr + class bad_weak_ptr; + + // [2.2.3] Class template shared_ptr + template<class T> class shared_ptr; + + // [2.2.3.6] shared_ptr comparisons + template<class T, class U> bool operator==(shared_ptr<T> const& a, shared_ptr<U> const& b); + template<class T, class U> bool operator!=(shared_ptr<T> const& a, shared_ptr<U> const& b); + template<class T, class U> bool operator<(shared_ptr<T> const& a, shared_ptr<U> const& b); + + // [2.2.3.8] shared_ptr specialized algorithms + template<class T> void swap(shared_ptr<T>& a, shared_ptr<T>& b); + + // [2.2.3.9] shared_ptr casts + template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const& r); + template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const& r); + template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const& r); + + // [2.2.3.7] shared_ptr I/O + template<class E, class T, class Y> + basic_ostream<E, T>& operator<< (basic_ostream<E, T>& os, shared_ptr<Y> const& p); + + // [2.2.3.10] shared_ptr get_deleter + template<class D, class T> D* get_deleter(shared_ptr<T> const& p); + + // [2.2.4] Class template weak_ptr + template<class T> class weak_ptr; + + // [2.2.4.6] weak_ptr comparison + template<class T, class U> bool operator<(weak_ptr<T> const& a, weak_ptr<U> const& b); + + // [2.2.4.7] weak_ptr specialized algorithms + template<class T> void swap(weak_ptr<T>& a, weak_ptr<T>& b); + + // [2.2.5] Class enable_shared_from_this + template<class T> class enable_shared_from_this; +} // namespace tr1 +} // namespace std diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/memory/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/memory/types_std_tr1.cc new file mode 100644 index 000000000..52e14917a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/headers/memory/types_std_tr1.cc @@ -0,0 +1,25 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/memory> + +namespace gnu +{ + using std::tr1::bad_weak_ptr; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/assign.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/assign.cc new file mode 100644 index 000000000..7e9704ec8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/assign.cc @@ -0,0 +1,70 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A +{ + A() { ++ctor_count; } + virtual ~A() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long A::ctor_count = 0; +long A::dtor_count = 0; + +struct reset_count_struct +{ + ~reset_count_struct() + { + A::ctor_count = 0; + A::dtor_count = 0; + } +}; + + +// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign] + +// Assignment from shared_ptr<Y> +void +test01() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a; + + a = std::tr1::shared_ptr<A>(new A); + VERIFY( a.get() != 0 ); + VERIFY( A::ctor_count == 1 ); + VERIFY( A::dtor_count == 0 ); + + a = std::tr1::shared_ptr<A>(); + VERIFY( a.get() == 0 ); + VERIFY( A::ctor_count == 1 ); + VERIFY( A::dtor_count == 1 ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc new file mode 100644 index 000000000..270d7ddcd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc @@ -0,0 +1,83 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A +{ + A() { ++ctor_count; } + virtual ~A() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long A::ctor_count = 0; +long A::dtor_count = 0; + +struct B : A +{ + B() { ++ctor_count; } + virtual ~B() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long B::ctor_count = 0; +long B::dtor_count = 0; + + +struct reset_count_struct +{ + ~reset_count_struct() + { + A::ctor_count = 0; + A::dtor_count = 0; + B::ctor_count = 0; + B::dtor_count = 0; + } +}; + + +// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign] + +// Assignment from auto_ptr<Y> +int +test01() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a(new A); + std::auto_ptr<B> b(new B); + a = b; + VERIFY( a.get() != 0 ); + VERIFY( b.get() == 0 ); + VERIFY( A::ctor_count == 2 ); + VERIFY( A::dtor_count == 1 ); + VERIFY( B::ctor_count == 1 ); + VERIFY( B::dtor_count == 0 ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc new file mode 100644 index 000000000..eb067a97b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc @@ -0,0 +1,49 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; +struct B { }; + +// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign] + +// Assignment from incompatible auto_ptr<Y> +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a; + std::auto_ptr<B> b; + a = b; // { dg-error "here" } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} +// { dg-excess-errors "In constructor" } diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc new file mode 100644 index 000000000..f4d960da8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc @@ -0,0 +1,48 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; +std::auto_ptr<A> source() { return std::auto_ptr<A>(); } + +// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign] + +// Assignment from rvalue auto_ptr +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a; + a = source(); // { dg-error "no match" } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} +// { dg-excess-errors "candidates are" } diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/dr541.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/dr541.cc new file mode 100644 index 000000000..60a8af11b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/dr541.cc @@ -0,0 +1,29 @@ +// { dg-do compile } + +// Copyright (C) 2006, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> + +// DR 541. shared_ptr template assignment and void +void test01() +{ + std::tr1::shared_ptr<void> p; + p.operator=<void>(p); +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr.cc new file mode 100644 index 000000000..3faa02451 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr.cc @@ -0,0 +1,94 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A +{ + A() { ++ctor_count; } + virtual ~A() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long A::ctor_count = 0; +long A::dtor_count = 0; + +struct B : A +{ + B() { ++ctor_count; } + virtual ~B() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long B::ctor_count = 0; +long B::dtor_count = 0; + + +struct reset_count_struct +{ + ~reset_count_struct() + { + A::ctor_count = 0; + A::dtor_count = 0; + B::ctor_count = 0; + B::dtor_count = 0; + } +}; + + +// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign] + +// Assignment from shared_ptr<Y> +void +test01() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a; + + a = std::tr1::shared_ptr<A>(); + VERIFY( a.get() == 0 ); + VERIFY( A::ctor_count == 0 ); + VERIFY( A::dtor_count == 0 ); + VERIFY( B::ctor_count == 0 ); + VERIFY( B::dtor_count == 0 ); + + a = std::tr1::shared_ptr<A>(new A); + VERIFY( a.get() != 0 ); + VERIFY( A::ctor_count == 1 ); + VERIFY( A::dtor_count == 0 ); + VERIFY( B::ctor_count == 0 ); + VERIFY( B::dtor_count == 0 ); + + a = std::tr1::shared_ptr<B>(new B); + VERIFY( a.get() != 0 ); + VERIFY( A::ctor_count == 2 ); + VERIFY( A::dtor_count == 1 ); + VERIFY( B::ctor_count == 1 ); + VERIFY( B::dtor_count == 0 ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc new file mode 100644 index 000000000..490cfc4cc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc @@ -0,0 +1,51 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2008, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; +struct B { }; + +// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign] + +// Assignment from incompatible shared_ptr<Y> +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a; + std::tr1::shared_ptr<B> b; + a = b; // { dg-error "here" } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} +// { dg-error "In member function" "" { target *-*-* } 0 } +// { dg-error "cannot convert" "" { target *-*-* } 0 } +// { dg-error "instantiated from" "" { target *-*-* } 0 } diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/casts/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/casts/1.cc new file mode 100644 index 000000000..e4d177c70 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/casts/1.cc @@ -0,0 +1,45 @@ +// 2006-09-24 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2006, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.3.9 shared_ptr casts [tr.util.smartptr.shared.cast] + +#include <tr1/memory> +#include <testsuite_tr1.h> + +// { dg-do compile } + +struct MyP { virtual ~MyP() { }; }; +struct MyDP : MyP { }; + +int main() +{ + using __gnu_test::check_ret_type; + using std::tr1::shared_ptr; + using std::tr1::static_pointer_cast; + using std::tr1::const_pointer_cast; + using std::tr1::dynamic_pointer_cast; + + shared_ptr<double> spd; + shared_ptr<const int> spci; + shared_ptr<MyP> spa; + + check_ret_type<shared_ptr<void> >(static_pointer_cast<void>(spd)); + check_ret_type<shared_ptr<int> >(const_pointer_cast<int>(spci)); + check_ret_type<shared_ptr<MyDP> >(static_pointer_cast<MyDP>(spa)); +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/comparison/cmp.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/comparison/cmp.cc new file mode 100644 index 000000000..7676b45b3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/comparison/cmp.cc @@ -0,0 +1,82 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A +{ + virtual ~A() { } +}; + +struct B : A +{ +}; + +// 2.2.3.6 shared_ptr comparison [tr.util.smartptr.shared.cmp] + +int +test01() +{ + // test empty shared_ptrs compare equivalent + std::tr1::shared_ptr<A> p1; + std::tr1::shared_ptr<B> p2; + VERIFY( p1 == p2 ); + VERIFY( !(p1 != p2) ); + VERIFY( !(p1 < p2) && !(p2 < p1) ); + return 0; +} + + +// Construction from pointer +int +test02() +{ + std::tr1::shared_ptr<A> A_default; + + std::tr1::shared_ptr<A> A_from_A(new A); + VERIFY( A_default != A_from_A ); + VERIFY( !(A_default == A_from_A) ); + VERIFY( (A_default < A_from_A) || (A_from_A < A_default) ); + + std::tr1::shared_ptr<B> B_from_B(new B); + VERIFY( B_from_B != A_from_A ); + VERIFY( !(B_from_B == A_from_A) ); + VERIFY( (B_from_B < A_from_A) || (A_from_A < B_from_B) ); + + A_from_A.reset(); + VERIFY( A_default == A_from_A ); + VERIFY( !(A_default != A_from_A) ); + VERIFY( !(A_default < A_from_A) && !(A_from_A < A_default) ); + + B_from_B.reset(); + VERIFY( B_from_B == A_from_A ); + VERIFY( !(B_from_B != A_from_A) ); + VERIFY( !(B_from_B < A_from_A) && !(A_from_A < B_from_B) ); + + return 0; +} + +int +main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/39405.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/39405.cc new file mode 100644 index 000000000..f039ab504 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/39405.cc @@ -0,0 +1,29 @@ +// { dg-do compile } + +// Copyright (C) 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/memory> + +// libstdc++/39405 +template<typename T> + struct foo + { + std::tr1::shared_ptr<foo<T> > m_foo; + }; + +std::tr1::shared_ptr<foo<int> > t; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc new file mode 100644 index 000000000..0b86e8eeb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc @@ -0,0 +1,38 @@ +// { dg-do compile } + +// Copyright (C) 2010 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.2.3 Class template shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> + +// incomplete type +struct X; + +std::auto_ptr<X>& ap(); + +void test01() +{ + X* px = 0; + std::tr1::shared_ptr<X> p1(px); // { dg-error "here" } + // { dg-error "incomplete" "" { target *-*-* } 563 } + + std::tr1::shared_ptr<X> p9(ap()); // { dg-error "here" } + // { dg-error "incomplete" "" { target *-*-* } 602 } + +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc new file mode 100644 index 000000000..d916cd02d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc @@ -0,0 +1,47 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const] + +// Construction from auto_ptr +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::auto_ptr<A> a(new A); + std::tr1::shared_ptr<A> a2(a); + VERIFY( a.get() == 0 ); + VERIFY( a2.get() != 0 ); + VERIFY( a2.use_count() == 1 ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc new file mode 100644 index 000000000..1d7b921a8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc @@ -0,0 +1,47 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.const] + +// Construction from const auto_ptr +int +test01() +{ + bool test __attribute__((unused)) = true; + + const std::auto_ptr<A> a; + std::tr1::shared_ptr<A> p(a); // { dg-error "no match" } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} +// { dg-excess-errors "candidates are" } diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/copy.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/copy.cc new file mode 100644 index 000000000..e879dd2c3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/copy.cc @@ -0,0 +1,134 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A +{ + A() { ++ctor_count; } + virtual ~A() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long A::ctor_count = 0; +long A::dtor_count = 0; + +struct B : A +{ + B() { ++ctor_count; } + virtual ~B() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long B::ctor_count = 0; +long B::dtor_count = 0; + +void deleter(A* p) { delete p; } + +struct reset_count_struct +{ + ~reset_count_struct() + { + A::ctor_count = 0; + A::dtor_count = 0; + B::ctor_count = 0; + B::dtor_count = 0; + } +}; + +// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const] + +// Copy construction +int test01() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a1; + std::tr1::shared_ptr<A> a2(a1); + VERIFY( a2.use_count() == 0 ); + VERIFY( A::ctor_count == 0 ); + VERIFY( A::dtor_count == 0 ); + VERIFY( B::ctor_count == 0 ); + VERIFY( B::dtor_count == 0 ); + + return 0; +} + +int +test02() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a1(new A); + std::tr1::shared_ptr<A> a2(a1); + VERIFY( a2.use_count() == 2 ); + VERIFY( A::ctor_count == 1 ); + VERIFY( A::dtor_count == 0 ); + VERIFY( B::ctor_count == 0 ); + VERIFY( B::dtor_count == 0 ); + + return 0; +} + +int +test03() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<B> b(new B); + std::tr1::shared_ptr<A> a(b); + VERIFY( a.use_count() == 2 ); + VERIFY( A::ctor_count == 1 ); + VERIFY( A::dtor_count == 0 ); + VERIFY( B::ctor_count == 1 ); + VERIFY( B::dtor_count == 0 ); + + return 0; +} + +int +test04() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<B> b(new B, &deleter); + std::tr1::shared_ptr<A> a(b); + VERIFY( a.use_count() == 2 ); + VERIFY( A::ctor_count == 1 ); + VERIFY( A::dtor_count == 0 ); + VERIFY( B::ctor_count == 1 ); + VERIFY( B::dtor_count == 0 ); + + return 0; +} + +int +main() +{ + test01(); + test02(); + test03(); + test04(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/default.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/default.cc new file mode 100644 index 000000000..ec68baa70 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/default.cc @@ -0,0 +1,44 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const] + +// Default construction +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a; + VERIFY( a.get() == 0 ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/pointer.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/pointer.cc new file mode 100644 index 000000000..72f89b5b6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/pointer.cc @@ -0,0 +1,78 @@ +// Copyright (C) 2005, 2009, 2010 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; +struct B : A { }; + + +// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const] + +// Construction from pointer + +int +test01() +{ + bool test __attribute__((unused)) = true; + + A * const a = 0; + std::tr1::shared_ptr<A> p(a); + VERIFY( p.get() == 0 ); + VERIFY( p.use_count() == 1 ); + + return 0; +} + +int +test02() +{ + bool test __attribute__((unused)) = true; + + A * const a = new A; + std::tr1::shared_ptr<A> p(a); + VERIFY( p.get() == a ); + VERIFY( p.use_count() == 1 ); + + return 0; +} + + +int +test03() +{ + bool test __attribute__((unused)) = true; + + B * const b = new B; + std::tr1::shared_ptr<A> p(b); + VERIFY( p.get() == b ); + VERIFY( p.use_count() == 1 ); + + return 0; +} + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr.cc new file mode 100644 index 000000000..1429a782e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr.cc @@ -0,0 +1,49 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const] + +// Construction from weak_ptr +int +test01() +{ + bool test __attribute__((unused)) = true; + + A * const a = new A; + std::tr1::shared_ptr<A> a1(a); + std::tr1::weak_ptr<A> wa(a1); + std::tr1::shared_ptr<A> a2(wa); + VERIFY( a2.get() == a ); + VERIFY( a2.use_count() == wa.use_count() ); + + return 0; +} + + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc new file mode 100644 index 000000000..27fbc70dc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc @@ -0,0 +1,60 @@ +// { dg-do run { xfail *-*-* } } +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const] + +// Construction from expired weak_ptr +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a1(new A); + std::tr1::weak_ptr<A> wa(a1); + a1.reset(); + VERIFY( wa.expired() ); + try + { + std::tr1::shared_ptr<A> a2(wa); + } + catch (const std::tr1::bad_weak_ptr&) + { + // Expected. + __throw_exception_again; + } + catch (...) + { + // Failed. + } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/dest/dest.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/dest/dest.cc new file mode 100644 index 000000000..037efc587 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/dest/dest.cc @@ -0,0 +1,132 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A +{ + A() { ++ctor_count; } + ~A() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long A::ctor_count = 0; +long A::dtor_count = 0; + +struct B : A +{ + B() { ++ctor_count; } + ~B() { ++dtor_count; } + static long ctor_count; + static long dtor_count; +}; +long B::ctor_count = 0; +long B::dtor_count = 0; + +struct D +{ + void operator()(const B* p) { delete p; ++delete_count; } + static long delete_count; +}; +long D::delete_count = 0; + +struct reset_count_struct +{ + ~reset_count_struct() + { + A::ctor_count = 0; + A::dtor_count = 0; + B::ctor_count = 0; + B::dtor_count = 0; + D::delete_count = 0; + } +}; + + +// 2.2.3.2 shared_ptr destructor [tr.util.smartptr.shared.dest] + +// empty shared_ptr +int +test01() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + { + std::tr1::shared_ptr<A> a; + } + VERIFY( A::ctor_count == 0 ); + VERIFY( A::dtor_count == 0 ); + VERIFY( B::ctor_count == 0 ); + VERIFY( B::dtor_count == 0 ); + VERIFY( D::delete_count == 0 ); + + return 0; +} + +// shared ownership +int +test02() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> a; + { + a = std::tr1::shared_ptr<A>(new B, D()); + } + VERIFY( A::ctor_count == 1 ); + VERIFY( A::dtor_count == 0 ); + VERIFY( B::ctor_count == 1 ); + VERIFY( B::dtor_count == 0 ); + VERIFY( D::delete_count == 0 ); + + return 0; +} + +// exclusive ownership +int +test03() +{ + reset_count_struct __attribute__((unused)) reset; + bool test __attribute__((unused)) = true; + + { + std::tr1::shared_ptr<A> a1(new B); + std::tr1::shared_ptr<A> a2(new B, D()); + } + VERIFY( A::ctor_count == 2 ); + VERIFY( A::dtor_count == 2 ); + VERIFY( B::ctor_count == 2 ); + VERIFY( B::dtor_count == 2 ); + VERIFY( D::delete_count == 1 ); + + return 0; +} + + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/24595.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/24595.cc new file mode 100644 index 000000000..d7dafb3ca --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/24595.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +using std::tr1::get_deleter; + +// libstdc++/24595 +void test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<int> sp; + VERIFY( !get_deleter<void(*)(int*)>(sp) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc new file mode 100644 index 000000000..c52aa8af6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/42019.cc @@ -0,0 +1,35 @@ +// { dg-options "-fno-rtti" } +// Copyright (C) 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> + +// libstdc++/42019 +class A {}; + +void test01() +{ + std::tr1::shared_ptr<A> spA; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/io.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/io.cc new file mode 100644 index 000000000..e34e4c3a4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/io.cc @@ -0,0 +1,50 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <sstream> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.7 shared_ptr I/O [tr.util.smartptr.shared.io] + +// operator<< +int +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> p(new A); + std::ostringstream buf; + buf << p; + const std::string s = buf.str(); + buf.str(""); + buf << p.get(); + VERIFY( s == buf.str() ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/swap.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/swap.cc new file mode 100644 index 000000000..9a037d90c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/swap.cc @@ -0,0 +1,49 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.8 shared_ptr specialized algorithms [tr.util.smartptr.shared.spec] + +// std::swap +int +test01() +{ + bool test __attribute__((unused)) = true; + + A * const a1 = new A; + A * const a2 = new A; + std::tr1::shared_ptr<A> p1(a1); + std::tr1::shared_ptr<A> p2(a2); + std::swap(p1, p2); + VERIFY( p1.get() == a2 ); + VERIFY( p2.get() == a1 ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/24805.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/24805.cc new file mode 100644 index 000000000..ce4611c07 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/24805.cc @@ -0,0 +1,29 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> + +// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod] + +// swap + +// libstdc++/24805 +using std::tr1::swap; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset.cc new file mode 100644 index 000000000..05b0a7bd3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset.cc @@ -0,0 +1,87 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; +struct B : A { }; +struct D +{ + void operator()(B* p) { delete p; ++delete_count; } + static long delete_count; +}; +long D::delete_count = 0; + +// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod] + +// reset +int +test01() +{ + bool test __attribute__((unused)) = true; + + A * const a = new A; + std::tr1::shared_ptr<A> p1(a); + std::tr1::shared_ptr<A> p2(p1); + p1.reset(); + VERIFY( p1.get() == 0 ); + VERIFY( p2.get() == a ); + + return 0; +} + +int +test02() +{ + bool test __attribute__((unused)) = true; + + A * const a = new A; + B * const b = new B; + std::tr1::shared_ptr<A> p1(a); + std::tr1::shared_ptr<A> p2(p1); + p1.reset(b); + VERIFY( p1.get() == b ); + VERIFY( p2.get() == a ); + + return 0; +} + +int +test03() +{ + bool test __attribute__((unused)) = true; + + { + std::tr1::shared_ptr<A> p1; + p1.reset(new B, D()); + } + VERIFY( D::delete_count == 1 ); + + return 0; +} + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset_neg.cc new file mode 100644 index 000000000..8a8cc2286 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset_neg.cc @@ -0,0 +1,46 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod] + +// reset +int +test01() +{ + bool test __attribute__((unused)) = true; + + const std::tr1::shared_ptr<A> p1(new A); + p1.reset(); // { dg-error "discards qualifiers" } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap.cc new file mode 100644 index 000000000..f52b7e974 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap.cc @@ -0,0 +1,49 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod] + +// swap +int +test01() +{ + bool test __attribute__((unused)) = true; + + A * const a1 = new A; + A * const a2 = new A; + std::tr1::shared_ptr<A> p1(a1); + std::tr1::shared_ptr<A> p2(a2); + p1.swap(p2); + VERIFY( p1.get() == a2 ); + VERIFY( p2.get() == a1 ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap_neg.cc new file mode 100644 index 000000000..b9fa271a6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap_neg.cc @@ -0,0 +1,47 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod] + +// swap +int +test01() +{ + bool test __attribute__((unused)) = true; + + const std::tr1::shared_ptr<A> p1(new A); + std::tr1::shared_ptr<A> p2(new A); + p1.swap(p2); // { dg-error "discards qualifiers" } + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc new file mode 100644 index 000000000..ade8f4199 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc @@ -0,0 +1,79 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs] + +// conversion to bool +int +test01() +{ + bool test __attribute__((unused)) = true; + + const std::tr1::shared_ptr<A> p1; + VERIFY( p1 == false ); + const std::tr1::shared_ptr<A> p2(p1); + VERIFY( p2 == false ); + + return 0; +} + +int +test02() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> p1(new A); + VERIFY( p1 ); + std::tr1::shared_ptr<A> p2(p1); + VERIFY( p2 ); + p1.reset(); + VERIFY( !p1 ); + VERIFY( p2 ); + + return 0; +} + +int +test03() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> p1(new A); + std::tr1::shared_ptr<A> p2(p1); + p2.reset(new A); + VERIFY( p1 ); + VERIFY( p2 ); + + return 0; +} + + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/get.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/get.cc new file mode 100644 index 000000000..c7ad734c1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/get.cc @@ -0,0 +1,79 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A +{ + A() : i() {} + int i; +}; + +// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs] + +// get +int +test01() +{ + bool test __attribute__((unused)) = true; + + A * const a = new A; + const std::tr1::shared_ptr<A> p(a); + VERIFY( p.get() == a ); + + return 0; +} + +// operator* +int +test02() +{ + bool test __attribute__((unused)) = true; + + A * const a = new A; + const std::tr1::shared_ptr<A> p(a); + VERIFY( &*p == a ); + + return 0; +} + + +// operator-> +int +test03() +{ + bool test __attribute__((unused)) = true; + + A * const a = new A; + const std::tr1::shared_ptr<A> p(a); + VERIFY( &p->i == &a->i ); + + return 0; +} + + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/unique.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/unique.cc new file mode 100644 index 000000000..a721aff49 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/unique.cc @@ -0,0 +1,79 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; + +// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs] + +// unique +int +test01() +{ + bool test __attribute__((unused)) = true; + + const std::tr1::shared_ptr<A> p1; + VERIFY( !p1.unique() ); + const std::tr1::shared_ptr<A> p2(p1); + VERIFY( !p1.unique() ); + + return 0; +} + +int +test02() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> p1(new A); + VERIFY( p1.unique() ); + std::tr1::shared_ptr<A> p2(p1); + VERIFY( !p1.unique() ); + p1.reset(); + VERIFY( !p1.unique() ); + VERIFY( p2.unique() ); + + return 0; +} + +int +test03() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> p1(new A); + std::tr1::shared_ptr<A> p2(p1); + p2.reset(new A); + VERIFY( p1.unique() ); + VERIFY( p2.unique() ); + + return 0; +} + + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/use_count.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/use_count.cc new file mode 100644 index 000000000..9fcfbc98f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/use_count.cc @@ -0,0 +1,78 @@ +// Copyright (C) 2005, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_hooks.h> + +struct A { }; +struct B : A { }; + +// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs] + +// use_count +int +test01() +{ + bool test __attribute__((unused)) = true; + + const std::tr1::shared_ptr<A> p1; + VERIFY( p1.use_count() == 0 ); + const std::tr1::shared_ptr<A> p2(p1); + VERIFY( p1.use_count() == 0 ); + + return 0; +} + +int +test02() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> p1(new A); + std::tr1::shared_ptr<A> p2(p1); + p1.reset(); + VERIFY( p1.use_count() == 0 ); + VERIFY( p2.use_count() == 1 ); + + return 0; +} + +int +test03() +{ + bool test __attribute__((unused)) = true; + + std::tr1::shared_ptr<A> p1(new A); + std::tr1::shared_ptr<A> p2(p1); + p2.reset(new B); + VERIFY( p1.use_count() == 1 ); + VERIFY( p2.use_count() == 1 ); + + return 0; +} + + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc new file mode 100644 index 000000000..ba5d3a375 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc @@ -0,0 +1,30 @@ +// Copyright (C) 2006, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_tr1.h> + +// { dg-do compile } + +using namespace __gnu_test; +using std::tr1::shared_ptr; +template class shared_ptr<int>; +template class shared_ptr<void>; +template class shared_ptr<ClassType>; +template class shared_ptr<IncompleteClass>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc new file mode 100644 index 000000000..e6cf4f13f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2007, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include <tr1/memory> +#include <testsuite_tr1.h> + +// { dg-do compile } + +// Check the _S_single lock policy can be instantiated. For a thread-enabled +// library this checks the templates can be instantiated for non-default +// lock policy, for a single-threaded lib this is redundant but harmless. +using namespace __gnu_test; +using std::tr1::__shared_ptr; +using std::tr1::_S_single; +template class __shared_ptr<int, _S_single>; +template class __shared_ptr<ClassType, _S_single>; +template class __shared_ptr<IncompleteClass, _S_single>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc new file mode 100644 index 000000000..31f26adcf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc @@ -0,0 +1,193 @@ +// Copyright (C) 2006, 2007, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options "-pthreads" { target *-*-solaris* } } + +#include <tr1/memory> +#include <tr1/random> +#include <vector> +#include <testsuite_hooks.h> +#include <iostream> +#include <cstdlib> + +#include <pthread.h> + +#ifdef _GLIBCXX_HAVE_UNISTD_H +#include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING +#endif + +/* This (brute-force) tests the atomicity and thus thread safety of the + * shared_ptr <- weak_ptr + * assignment operation by allocating a test object, retrieving a weak + * reference to it, and letting a number of threads repeatedly create strong + * references from the weak reference. + * Specifically, this tests the function _Sp_counted_base<true>::add_ref_lock() + */ + + +const unsigned int HAMMER_MAX_THREADS = 10; +const unsigned int POOL_SIZE = 1000; +const unsigned long HAMMER_REPEAT = 100000; +const unsigned long KILL_ONE_IN = 1000; + +struct A + { + static _Atomic_word counter; + A() + { + __gnu_cxx::__atomic_add(&counter, 1); + } + ~A() + { + __gnu_cxx::__atomic_add(&counter, -1); + } + }; + +_Atomic_word A::counter = 0; + +typedef std::tr1::shared_ptr<A> sp_A_t; +typedef std::tr1::weak_ptr<A> wp_A_t; + +typedef std::vector<sp_A_t> sp_vector_t; +typedef std::vector<wp_A_t> wp_vector_t; + +struct shared_and_weak_pools +{ + sp_vector_t& shared_pool; + wp_vector_t& weak_pool; + + shared_and_weak_pools(sp_vector_t& _shared_pool, wp_vector_t& _weak_pool) + : shared_pool(_shared_pool), weak_pool(_weak_pool) + { } +}; + +void* thread_hammer_and_kill(void* opaque_pools) +{ + shared_and_weak_pools& pools = *static_cast<shared_and_weak_pools*>(opaque_pools); + // Using the same parameters as in the RNG test cases. + std::tr1::mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> rng; + + sp_vector_t::iterator cur_shared = pools.shared_pool.begin(); + wp_vector_t::iterator cur_weak = pools.weak_pool.begin(); + + for (unsigned int i = 0; i < HAMMER_REPEAT; ++i) + { + try + { + sp_A_t strong(*cur_weak); + } + catch (std::tr1::bad_weak_ptr& exception) + { + ++cur_weak; + if (cur_weak == pools.weak_pool.end()) + break; + } + + if (rng() % KILL_ONE_IN == 0) + { + cur_shared->reset(); + ++cur_shared; + } + } + return 0; +} + +void* thread_hammer(void* opaque_weak) +{ + wp_vector_t& weak_pool = *static_cast<wp_vector_t*>(opaque_weak); + // Using the same parameters as in the RNG test cases. + std::tr1::mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> rng; + wp_vector_t::iterator cur_weak = weak_pool.begin(); + + for (unsigned int i = 0; i < HAMMER_REPEAT; ++i) + { + try + { + sp_A_t strong(*cur_weak); + } + catch (std::tr1::bad_weak_ptr& exception) + { + ++cur_weak; + if (cur_weak == weak_pool.end()) + break; + } + } + return 0; +} + +int +test01() +{ + bool test __attribute__((unused)) = true; + sp_vector_t obj_pool(POOL_SIZE); + + for(sp_vector_t::iterator cur = obj_pool.begin(); cur != obj_pool.end(); ++cur) + { + cur->reset(new A); + } + // Obtain weak references. + std::vector<wp_vector_t> weak_pool(HAMMER_MAX_THREADS, wp_vector_t(obj_pool.begin(), obj_pool.end())); + + // Launch threads with pointer to weak reference. + pthread_t threads[HAMMER_MAX_THREADS]; +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 + pthread_setconcurrency (HAMMER_MAX_THREADS); +#endif + + pthread_attr_t tattr; + pthread_attr_init(&tattr); + + shared_and_weak_pools pools(obj_pool, weak_pool[0]); + pthread_create(threads, &tattr, thread_hammer_and_kill, static_cast<void*>(&pools)); + for (unsigned int worker = 1; worker < HAMMER_MAX_THREADS; worker++) + { + if (pthread_create(&threads[worker], &tattr, + thread_hammer, static_cast<void*>(&weak_pool[worker]))) + std::abort(); + } + // Wait for threads to complete, then check integrity of reference. + void* status; + for (unsigned int worker = 0; worker < HAMMER_MAX_THREADS; worker++) + { + if (pthread_join(threads[worker], &status)) + std::abort(); + } + obj_pool.clear(); + + VERIFY( A::counter == 0 ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc new file mode 100644 index 000000000..6b94d04b6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc @@ -0,0 +1,195 @@ +// Copyright (C) 2006, 2007, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options "-pthreads" { target *-*-solaris* } } + +#include <tr1/memory> +#include <tr1/random> +#include <vector> +#include <testsuite_hooks.h> +#include <iostream> +#include <cstdlib> + +#include <pthread.h> + +#ifdef _GLIBCXX_HAVE_UNISTD_H +#include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING +#endif + +/* This (brute-force) tests the atomicity and thus thread safety of the + * shared_ptr <- weak_ptr + * assignment operation by allocating a test object, retrieving a weak + * reference to it, and letting a number of threads repeatedly create strong + * references from the weak reference. + * Specifically, this tests the function _Sp_counted_base<true>::add_ref_lock() + */ + + +const unsigned int HAMMER_MAX_THREADS = 10; +const unsigned int POOL_SIZE = 1000; +const unsigned long HAMMER_REPEAT = 100000; +const unsigned long KILL_ONE_IN = 1000; + +struct A + { + static _Atomic_word counter; + A() + { + __gnu_cxx::__atomic_add(&counter, 1); + } + ~A() + { + __gnu_cxx::__atomic_add(&counter, -1); + } + }; + +_Atomic_word A::counter = 0; + +using std::tr1::_S_mutex; + +typedef std::tr1::__shared_ptr<A, _S_mutex> sp_A_t; +typedef std::tr1::__weak_ptr<A, _S_mutex> wp_A_t; + +typedef std::vector<sp_A_t> sp_vector_t; +typedef std::vector<wp_A_t> wp_vector_t; + +struct shared_and_weak_pools +{ + sp_vector_t& shared_pool; + wp_vector_t& weak_pool; + + shared_and_weak_pools(sp_vector_t& _shared_pool, wp_vector_t& _weak_pool) + : shared_pool(_shared_pool), weak_pool(_weak_pool) + { } +}; + +void* thread_hammer_and_kill(void* opaque_pools) +{ + shared_and_weak_pools& pools = *static_cast<shared_and_weak_pools*>(opaque_pools); + // Using the same parameters as in the RNG test cases. + std::tr1::mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> rng; + + sp_vector_t::iterator cur_shared = pools.shared_pool.begin(); + wp_vector_t::iterator cur_weak = pools.weak_pool.begin(); + + for (unsigned int i = 0; i < HAMMER_REPEAT; ++i) + { + try + { + sp_A_t strong(*cur_weak); + } + catch (std::tr1::bad_weak_ptr& exception) + { + ++cur_weak; + if (cur_weak == pools.weak_pool.end()) + break; + } + + if (rng() % KILL_ONE_IN == 0) + { + cur_shared->reset(); + ++cur_shared; + } + } + return 0; +} + +void* thread_hammer(void* opaque_weak) +{ + wp_vector_t& weak_pool = *static_cast<wp_vector_t*>(opaque_weak); + // Using the same parameters as in the RNG test cases. + std::tr1::mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> rng; + wp_vector_t::iterator cur_weak = weak_pool.begin(); + + for (unsigned int i = 0; i < HAMMER_REPEAT; ++i) + { + try + { + sp_A_t strong(*cur_weak); + } + catch (std::tr1::bad_weak_ptr& exception) + { + ++cur_weak; + if (cur_weak == weak_pool.end()) + break; + } + } + return 0; +} + +int +test01() +{ + bool test __attribute__((unused)) = true; + sp_vector_t obj_pool(POOL_SIZE); + + for(sp_vector_t::iterator cur = obj_pool.begin(); cur != obj_pool.end(); ++cur) + { + cur->reset(new A); + } + // Obtain weak references. + std::vector<wp_vector_t> weak_pool(HAMMER_MAX_THREADS, wp_vector_t(obj_pool.begin(), obj_pool.end())); + + // Launch threads with pointer to weak reference. + pthread_t threads[HAMMER_MAX_THREADS]; +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 + pthread_setconcurrency (HAMMER_MAX_THREADS); +#endif + + pthread_attr_t tattr; + pthread_attr_init(&tattr); + + shared_and_weak_pools pools(obj_pool, weak_pool[0]); + pthread_create(threads, &tattr, thread_hammer_and_kill, static_cast<void*>(&pools)); + for (unsigned int worker = 1; worker < HAMMER_MAX_THREADS; worker++) + { + if (pthread_create(&threads[worker], &tattr, + thread_hammer, static_cast<void*>(&weak_pool[worker]))) + std::abort(); + } + // Wait for threads to complete, then check integrity of reference. + void* status; + for (unsigned int worker = 0; worker < HAMMER_MAX_THREADS; worker++) + { + if (pthread_join(threads[worker], &status)) + std::abort(); + } + obj_pool.clear(); + + VERIFY( A::counter == 0 ); + + return 0; +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/lock/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/lock/1.cc new file mode 100644 index 000000000..a64eafbb2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/lock/1.cc @@ -0,0 +1,35 @@ +// 2006-09-24 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2006, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.4 Template class weak_ptr [tr.util.smartptr.weak] + +#include <tr1/memory> +#include <testsuite_tr1.h> + +// { dg-do compile } + +int main() +{ + using __gnu_test::check_ret_type; + using std::tr1::weak_ptr; + using std::tr1::shared_ptr; + + weak_ptr<int> wp; + check_ret_type<shared_ptr<int> >(wp.lock()); +} diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc new file mode 100644 index 000000000..a533850ec --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc @@ -0,0 +1,30 @@ +// Copyright (C) 2006, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.4 Template class weak_ptr [tr.util.smartptr.weak] + +#include <tr1/memory> +#include <testsuite_tr1.h> + +// { dg-do compile } + +using namespace __gnu_test; +using std::tr1::weak_ptr; +template class weak_ptr<int>; +template class weak_ptr<void>; +template class weak_ptr<ClassType>; +template class weak_ptr<IncompleteClass>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc new file mode 100644 index 000000000..57fbda8b6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2007, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// TR1 2.2.4 Template class weak_ptr [tr.util.smartptr.weak] + +#include <tr1/memory> +#include <testsuite_tr1.h> + +// { dg-do compile } + +// Check the _S_single lock policy can be instantiated. For a thread-enabled +// library this checks the templates can be instantiated for non-default +// lock policy, for a single-threaded lib this is redundant but harmless. +using namespace __gnu_test; +using std::tr1::__weak_ptr; +using std::tr1::_S_single; +template class __weak_ptr<int, _S_single>; +template class __weak_ptr<void, _S_single>; +template class __weak_ptr<ClassType, _S_single>; +template class __weak_ptr<IncompleteClass, _S_single>; diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/bind/all_bound.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/bind/all_bound.cc new file mode 100644 index 000000000..3641cc36e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/bind/all_bound.cc @@ -0,0 +1,42 @@ +// 2005-03-20 Douglas Gregor <doug.gregor -at- gmail.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.6 function object binders +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Operations on empty function<> objects +void test01() +{ + VERIFY( std::tr1::bind(std::plus<int>(), 3, 5)() == 8 ); + VERIFY( std::tr1::bind(std::minus<int>(), 3, 5)() == -2 ); + VERIFY( std::tr1::bind<int>(std::plus<int>(), 3, 5)() == 8 ); + VERIFY( std::tr1::bind<int>(std::minus<int>(), 3, 5)() == -2 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/bind/nested.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/bind/nested.cc new file mode 100644 index 000000000..b5fdd7fa5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/bind/nested.cc @@ -0,0 +1,44 @@ +// 2005-03-20 Douglas Gregor <doug.gregor -at- gmail.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.6 function object binders +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Operations on empty function<> objects +void test01() +{ + using namespace std::tr1::placeholders; + + int five = 5; + int seven = 7; + VERIFY( std::tr1::bind(std::multiplies<int>(), _1, std::tr1::bind(std::minus<int>(), 6, _2))(five, seven) == -5 ); + VERIFY( std::tr1::bind(std::multiplies<int>(), _1, std::tr1::bind(std::minus<int>(), 6, _2))(seven, five) == 7 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/bind/placeholders.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/bind/placeholders.cc new file mode 100644 index 000000000..b82f06387 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/bind/placeholders.cc @@ -0,0 +1,44 @@ +// 2005-03-20 Douglas Gregor <doug.gregor -at- gmail.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.6 function object binders +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Operations on empty function<> objects +void test01() +{ + using namespace std::tr1::placeholders; + + int five = 5; + int seven = 7; + VERIFY( std::tr1::bind(std::minus<int>(), _1, _2)(five, seven) == -2 ); + VERIFY( std::tr1::bind(std::minus<int>(), _2, _1)(five, seven) == 2 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/bind/ref.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/bind/ref.cc new file mode 100644 index 000000000..7f7215626 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/bind/ref.cc @@ -0,0 +1,59 @@ +// 2005-03-20 Douglas Gregor <doug.gregor -at- gmail.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.6 function object binders +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +struct X +{ + X() : bar(17) {} + + int foo(int x, int y) { return bar + x + y; } + + int bar; + +private: + X(const X&); + X& operator=(const X&); +}; + +// Operations on empty function<> objects +void test01() +{ + using std::tr1::bind; + using std::tr1::ref; + ::X x; + + VERIFY( bind(&::X::foo, ref(x), 1, 2)() == 20 ); + VERIFY( bind<int>(&::X::foo, ref(x), 1, 2)() == 20 ); + VERIFY( bind(&::X::bar, ref(x))() == 17 ); + VERIFY( bind<int>(&::X::bar, ref(x))() == 17 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/1.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/1.cc new file mode 100644 index 000000000..fddda85e7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/1.cc @@ -0,0 +1,94 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Operations on empty function<> objects +void test01() +{ + using std::tr1::function; + using std::tr1::bad_function_call; + + // Default-construction + function<int(float)> f1; + VERIFY( ((bool)f1 == false) ); + VERIFY( !f1 ); + VERIFY( f1 == 0 ); + VERIFY( 0 == f1 ); + VERIFY( !(f1 != 0) ); + VERIFY( !(0 != f1) ); + + // Copy-construction + function<int(float)> f2(f1); + VERIFY( !f2 ); + + // Construct with NULL pointer + function<int(float)> f3(0); + VERIFY( !f3 ); + + // Assignment + f1 = f2; + VERIFY( !f1); + + // Assignment to NULL pointer + f1 = 0; + VERIFY( !f1 ); + + // Swap + swap(f1, f2); + VERIFY( !f1 ); + VERIFY( !f2 ); + + // Invocation should throw bad_function_call + bool thrown = false; + try + { + f1(3.14159f); + VERIFY( false ); + } + catch (bad_function_call) + { + thrown = true; + } + VERIFY( thrown ); + + // target_type returns typeid(void) + VERIFY( f1.target_type() == typeid(void) ); + + // target() always returns a NULL pointer + VERIFY( f1.target<int (*)(float)>() == 0); + + // Check const version + const function<int(float)>& f1c = f1; + VERIFY( f1c.target<int (*)(float)>() == 0 ); + VERIFY( !f1c ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/2.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/2.cc new file mode 100644 index 000000000..63b3b0331 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/2.cc @@ -0,0 +1,77 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Put function pointers into function<> wrappers +void test02() +{ + using std::tr1::function; + + function<int(float)> f1(truncate_float); + VERIFY( f1 ); + VERIFY( !!f1 ); + VERIFY( !(f1 == 0) ); + VERIFY( !(0 == f1) ); + VERIFY( f1 != 0 ); + VERIFY( 0 != f1 ); + + // Copy-construction + function<int(float)> f2(f1); + VERIFY( f2 ); + + // Invocation + VERIFY( f1(3.1f) == 3 ); + VERIFY( f2(3.1f) == 3 ); + + // Assignment to zero + f1 = 0; + VERIFY( !f1 ); + + // Swap + f1.swap(f2); + VERIFY( f1 ); + VERIFY( !f2 ); + VERIFY( f1(3.1f) == 3 ); + + // Assignment from a function pointer + f2 = truncate_float; + VERIFY( f2(3.1f) == 3 ); + + // target_type and target() functions + const function<int(float)>& f1c = f1; + VERIFY( typeid(int(*)(float)) == f1.target_type() ); + VERIFY( f2.target<int(*)(float)>() != 0 ); + VERIFY( *f2.target<int(*)(float)>() == &truncate_float ); + VERIFY( f1c.target<int(*)(float)>() != 0 ); + VERIFY( *f1c.target<int(*)(float)>() == &truncate_float ); +} + +int main() +{ + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/3.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/3.cc new file mode 100644 index 000000000..0019f301c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/3.cc @@ -0,0 +1,77 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Put nearly-matching function pointers into function<> wrappers +void test03() +{ + using std::tr1::function; + + function<int(float)> f1(truncate_double); + VERIFY( f1 ); + VERIFY( !!f1 ); + VERIFY( !(f1 == 0) ); + VERIFY( !(0 == f1) ); + VERIFY( f1 != 0 ); + VERIFY( 0 != f1 ); + + // Copy-construction + function<int(float)> f2(f1); + VERIFY( f2 ); + + // Invocation + VERIFY( f1(3.1f) == 3 ); + VERIFY( f2(3.1f) == 3 ); + + // Assignment to zero + f1 = 0; + VERIFY( !f1 ); + + // Swap + f1.swap(f2); + VERIFY( f1 ); + VERIFY( !f2 ); + VERIFY( f1(3.1f) == 3 ); + + // Assignment from a function pointer + f2 = truncate_double; + VERIFY( f2(3.1f) == 3 ); + + // target_type and target() functions + const function<int(float)>& f1c = f1; + VERIFY( typeid(long(*)(double)) == f1.target_type() ); + VERIFY( f2.target<long(*)(double)>() != 0 ); + VERIFY( *f2.target<long(*)(double)>() == &truncate_double ); + VERIFY( f1c.target<long(*)(double)>() != 0 ); + VERIFY( *f1c.target<long(*)(double)>() == &truncate_double ); +} + +int main() +{ + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/4.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/4.cc new file mode 100644 index 000000000..2a10ff339 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/4.cc @@ -0,0 +1,81 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Put function objects into function<> wrappers +void test04() +{ + using std::tr1::function; + + do_truncate_float_t truncate_float; + + function<int(float)> f1(truncate_float); + VERIFY( f1 ); + VERIFY( !!f1 ); + VERIFY( !(f1 == 0) ); + VERIFY( !(0 == f1) ); + VERIFY( f1 != 0 ); + VERIFY( 0 != f1 ); + + // Copy-construction + function<int(float)> f2(f1); + VERIFY( f2 ); + + // Invocation + VERIFY( f1(3.1f) == 3 ); + VERIFY( f2(3.1f) == 3 ); + + // Assignment to zero + f1 = 0; + VERIFY( !f1 ); + + // Swap + f1.swap(f2); + VERIFY( f1 ); + VERIFY( !f2 ); + VERIFY( f1(3.1f) == 3 ); + + // Assignment from a function pointer + f2 = do_truncate_float_t(); + VERIFY( f2(3.1f) == 3 ); + + // target_type and target() functions + const function<int(float)>& f1c = f1; + VERIFY( typeid(do_truncate_float_t) == f1.target_type() ); + VERIFY( f2.target<do_truncate_float_t>() != 0 ); + VERIFY( f1c.target<do_truncate_float_t>() != 0 ); +} + +int main() +{ + test04(); + + VERIFY( do_truncate_double_t::live_objects == 0 ); + VERIFY( do_truncate_float_t::live_objects == 0 ); + + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/5.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/5.cc new file mode 100644 index 000000000..1b49c3033 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/5.cc @@ -0,0 +1,106 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Put member pointers into function<> wrappers +void test05() +{ + using std::tr1::function; + + X x; + x.bar = 17; + + function<int(X&)> frm(&X::bar); + VERIFY( frm ); + VERIFY( frm(x) == 17 ); + VERIFY( typeid(int X::*) == frm.target_type() ); + VERIFY( *frm.target<int X::*>() == &X::bar ); + + function<int(X&)> fr(&X::foo); + VERIFY( fr ); + VERIFY( fr(x) == 1 ); + VERIFY( typeid(int (X::*)()) == fr.target_type() ); + VERIFY( *fr.target<int (X::*)()>() == &X::foo ); + + function<int(const X&)> frc(&X::foo_c); + VERIFY( frc ); + VERIFY( frc(x) == 2 ); + VERIFY( typeid(int (X::*)() const) == frc.target_type() ); + VERIFY( *frc.target<int (X::*)() const >() == &X::foo_c ); + + function<int(volatile X&)> frv(&X::foo_v); + VERIFY( frv ); + VERIFY( frv(x) == 3 ); + VERIFY( typeid(int (X::*)() volatile) == frv.target_type() ); + VERIFY( *frv.target<int (X::*)() volatile >() == &X::foo_v ); + VERIFY( frv.target<int (X::*)() const volatile>() == 0 ); + + function<int(const volatile X&)> frcv(&X::foo_cv); + VERIFY( frcv ); + VERIFY( frcv(x) == 4 ); + VERIFY( typeid(int (X::*)() const volatile) == frcv.target_type() ); + VERIFY( *frcv.target<int (X::*)() const volatile >() == &X::foo_cv ); + VERIFY( frcv.target<int (X::*)() const>() == 0 ); + + function<int(X*)> grm(&X::bar); + VERIFY( grm ); + VERIFY( grm(&x) == 17 ); + VERIFY( typeid(int X::*) == grm.target_type() ); + VERIFY( *grm.target<int X::*>() == &X::bar ); + + function<int(X*)> gr(&X::foo); + VERIFY( gr ); + VERIFY( gr(&x) == 1 ); + VERIFY( typeid(int (X::*)()) == gr.target_type() ); + VERIFY( *gr.target<int (X::*)()>() == &X::foo ); + + function<int(const X*)> grc(&X::foo_c); + VERIFY( grc ); + VERIFY( grc(&x) == 2 ); + VERIFY( typeid(int (X::*)() const) == grc.target_type() ); + VERIFY( *grc.target<int (X::*)() const >() == &X::foo_c ); + + function<int(volatile X*)> grv(&X::foo_v); + VERIFY( grv ); + VERIFY( grv(&x) == 3 ); + VERIFY( typeid(int (X::*)() volatile) == grv.target_type() ); + VERIFY( *grv.target<int (X::*)() volatile >() == &X::foo_v ); + VERIFY( grv.target<int (X::*)() const volatile>() == 0 ); + + function<int(const volatile X*)> grcv(&X::foo_cv); + VERIFY( grcv ); + VERIFY( grcv(&x) == 4 ); + VERIFY( typeid(int (X::*)() const volatile) == grcv.target_type() ); + VERIFY( *grcv.target<int (X::*)() const volatile >() == &X::foo_cv ); + VERIFY( grcv.target<int (X::*)() const>() == 0 ); +} + +int main() +{ + test05(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/6.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/6.cc new file mode 100644 index 000000000..fde3099eb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/6.cc @@ -0,0 +1,82 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +struct secret {}; + +struct noncopyable_function_object_type +{ + noncopyable_function_object_type(secret) {} + + int operator()() const { return 42; } + int operator()() { return 17; } + + private: + noncopyable_function_object_type(); + noncopyable_function_object_type(const noncopyable_function_object_type&); + void operator=(const noncopyable_function_object_type&); +}; + +// Put reference_wrappers into function<> wrappers +void test06() +{ + using std::tr1::function; + using std::tr1::ref; + using std::tr1::cref; + + secret password; + noncopyable_function_object_type x(password); + + function<int()> f(ref(x)); + VERIFY( f ); + VERIFY( f() == 17 ); + VERIFY( f.target_type() == typeid(noncopyable_function_object_type) ); + VERIFY( f.target<noncopyable_function_object_type>() == &x ); + + function<int()> g = f; + VERIFY( g ); + VERIFY( g() == 17 ); + VERIFY( g.target_type() == typeid(noncopyable_function_object_type) ); + VERIFY( g.target<noncopyable_function_object_type>() == &x ); + + function<int()> h = cref(x); + VERIFY( h ); + VERIFY( h() == 42 ); + VERIFY( h.target_type() == typeid(noncopyable_function_object_type) ); + VERIFY( h.target<const noncopyable_function_object_type>() == &x ); + VERIFY( h.target<const noncopyable_function_object_type>() == &x ); + + const function<int()>& hc = h; + VERIFY( h.target<noncopyable_function_object_type>() == 0 ); + VERIFY( hc.target<noncopyable_function_object_type>() == &x ); +} + +int main() +{ + test06(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/7.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/7.cc new file mode 100644 index 000000000..6095212bb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/7.cc @@ -0,0 +1,81 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Put reference_wrappers to function pointers into function<> wrappers +void test07() +{ + using std::tr1::function; + using std::tr1::ref; + using std::tr1::cref; + + int (*fptr)(float) = truncate_float; + + function<int(float)> f1(ref(fptr)); + VERIFY( f1 ); + VERIFY( !!f1 ); + VERIFY( !(f1 == 0) ); + VERIFY( !(0 == f1) ); + VERIFY( f1 != 0 ); + VERIFY( 0 != f1 ); + + // Invocation + VERIFY( f1(3.1f) == 3 ); + + // target_type and target() functions + const function<int(float)>& f1c = f1; + VERIFY( typeid(int(*)(float)) == f1.target_type() ); + VERIFY( f1.target<int(*)(float)>() != 0 ); + VERIFY( f1.target<int(*)(float)>() == &fptr ); + VERIFY( f1c.target<int(*)(float)>() != 0 ); + VERIFY( f1c.target<int(*)(float)>() == &fptr ); + + function<int(float)> f2(cref(fptr)); + VERIFY( f2 ); + VERIFY( !!f2 ); + VERIFY( !(f2 == 0) ); + VERIFY( !(0 == f2) ); + VERIFY( f2 != 0 ); + VERIFY( 0 != f2 ); + + // Invocation + VERIFY( f2(3.1f) == 3 ); + + // target_type and target() functions + const function<int(float)>& f2c = f2; + VERIFY( typeid(int(*)(float)) == f2.target_type() ); + VERIFY( f2.target<int(*)(float)>() == 0 ); + VERIFY( f2.target<int(* const)(float)>() == &fptr ); + VERIFY( f2c.target<int(*)(float)>() != 0 ); + VERIFY( f2c.target<int(*)(float)>() == &fptr ); +} + +int main() +{ + test07(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/8.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/8.cc new file mode 100644 index 000000000..d8d6a5df1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/8.cc @@ -0,0 +1,147 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Put reference_wrappers to member pointers +void test08() +{ + using std::tr1::function; + using std::tr1::ref; + using std::tr1::cref; + + int X::* X_bar = &X::bar; + int (X::* X_foo)() = &X::foo; + int (X::* X_foo_c)() const = &X::foo_c; + int (X::* X_foo_v)() volatile = &X::foo_v; + int (X::* X_foo_cv)() const volatile = &X::foo_cv; + + X x; + x.bar = 17; + + function<int(X&)> frm(ref(X_bar)); + VERIFY( frm ); + VERIFY( frm(x) == 17 ); + VERIFY( typeid(int X::*) == frm.target_type() ); + VERIFY( frm.target<int X::*>() == &X_bar ); + + function<int(X&)> fr(ref(X_foo)); + VERIFY( fr ); + VERIFY( fr(x) == 1 ); + VERIFY( typeid(int (X::*)()) == fr.target_type() ); + VERIFY( fr.target<int (X::*)()>() == &X_foo ); + + function<int(const X&)> frc(ref(X_foo_c)); + VERIFY( frc ); + VERIFY( frc(x) == 2 ); + VERIFY( typeid(int (X::*)() const) == frc.target_type() ); + VERIFY( frc.target<int (X::*)() const >() == &X_foo_c ); + + function<int(volatile X&)> frv(ref(X_foo_v)); + VERIFY( frv ); + VERIFY( frv(x) == 3 ); + VERIFY( typeid(int (X::*)() volatile) == frv.target_type() ); + VERIFY( *frv.target<int (X::*)() volatile >() == X_foo_v ); + VERIFY( frv.target<int (X::*)() const volatile>() == 0 ); + + function<int(const volatile X&)> frcv(ref(X_foo_cv)); + VERIFY( frcv ); + VERIFY( frcv(x) == 4 ); + VERIFY( typeid(int (X::*)() const volatile) == frcv.target_type() ); + VERIFY( *frcv.target<int (X::*)() const volatile >() == X_foo_cv ); + VERIFY( frcv.target<int (X::*)() const>() == 0 ); + + function<int(X*)> grm(ref(X_bar)); + VERIFY( grm ); + VERIFY( grm(&x) == 17 ); + VERIFY( typeid(int X::*) == grm.target_type() ); + VERIFY( *grm.target<int X::*>() == X_bar ); + + function<int(X*)> gr(ref(X_foo)); + VERIFY( gr ); + VERIFY( gr(&x) == 1 ); + VERIFY( typeid(int (X::*)()) == gr.target_type() ); + VERIFY( *gr.target<int (X::*)()>() == X_foo ); + + function<int(const X*)> grc(ref(X_foo_c)); + VERIFY( grc ); + VERIFY( grc(&x) == 2 ); + VERIFY( typeid(int (X::*)() const) == grc.target_type() ); + VERIFY( *grc.target<int (X::*)() const >() == X_foo_c ); + + function<int(volatile X*)> grv(ref(X_foo_v)); + VERIFY( grv ); + VERIFY( grv(&x) == 3 ); + VERIFY( typeid(int (X::*)() volatile) == grv.target_type() ); + VERIFY( *grv.target<int (X::*)() volatile >() == X_foo_v ); + VERIFY( grv.target<int (X::*)() const volatile>() == 0 ); + + function<int(const volatile X*)> grcv(ref(X_foo_cv)); + VERIFY( grcv ); + VERIFY( grcv(&x) == 4 ); + VERIFY( typeid(int (X::*)() const volatile) == grcv.target_type() ); + VERIFY( *grcv.target<int (X::*)() const volatile >() == X_foo_cv ); + VERIFY( grcv.target<int (X::*)() const>() == 0 ); + + function<int(X&)> hrm(cref(X_bar)); + VERIFY( hrm ); + VERIFY( hrm(x) == 17 ); + VERIFY( typeid(int X::*) == hrm.target_type() ); + VERIFY( hrm.target<int X::*>() == 0 ); + VERIFY( hrm.target<int X::* const>() == &X_bar ); + + function<int(X&)> hr(cref(X_foo)); + VERIFY( hr ); + VERIFY( hr(x) == 1 ); + VERIFY( typeid(int (X::*)()) == hr.target_type() ); + VERIFY( hr.target<int (X::* const)()>() == &X_foo ); + + function<int(const X&)> hrc(cref(X_foo_c)); + VERIFY( hrc ); + VERIFY( hrc(x) == 2 ); + VERIFY( typeid(int (X::*)() const) == hrc.target_type() ); + VERIFY( hrc.target<int (X::* const)() const >() == &X_foo_c ); + + function<int(volatile X&)> hrv(cref(X_foo_v)); + VERIFY( hrv ); + VERIFY( hrv(x) == 3 ); + VERIFY( typeid(int (X::*)() volatile) == hrv.target_type() ); + VERIFY( hrv.target<int (X::* const)() volatile >() == &X_foo_v ); + VERIFY( hrv.target<int (X::* const)() const volatile>() == 0 ); + + function<int(const volatile X&)> hrcv(cref(X_foo_cv)); + VERIFY( hrcv ); + VERIFY( hrcv(x) == 4 ); + VERIFY( typeid(int (X::*)() const volatile) == hrcv.target_type() ); + VERIFY( hrcv.target<int (X::* const)() const volatile >() == &X_foo_cv ); + VERIFY( hrcv.target<int (X::* const)() const>() == 0 ); +} + +int main() +{ + test08(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/function/9.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/function/9.cc new file mode 100644 index 000000000..ed1dfafa9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/function/9.cc @@ -0,0 +1,54 @@ +// 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.7.2 polymorphic function object wrapper +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +// Put function objects into a void-returning function<> wrapper +void test09() +{ + using std::tr1::function; + using std::tr1::ref; + using std::tr1::cref; + + int (X::*X_foo_c)() const = &X::foo_c; + function<void(X&)> f(&X::bar); + f = &X::foo; + f = ref(X_foo_c); + f = cref(X_foo_c); + + function<void(float)> g = &truncate_float; + g = do_truncate_float_t(); +} + +int main() +{ + test09(); + + VERIFY( do_truncate_double_t::live_objects == 0 ); + VERIFY( do_truncate_float_t::live_objects == 0 ); + + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/synopsis.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/synopsis.cc new file mode 100644 index 000000000..e83e0d54f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/synopsis.cc @@ -0,0 +1,79 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/functional> + +namespace std { +namespace tr1 { + + // [3.4] class template result_of + template <class FunctionCallType> class result_of; + +#if 0 + // [3.5] function template mem_fn + template<class R, class T> unspecified mem_fn(R T::* pm); +#endif + + // [3.6] function object binders + template<class T> struct is_bind_expression; + template<class T> struct is_placeholder; + +#if 0 + template<class F, class T1, ..., class TN> + unspecified bind(F f, T1 t1, ..., TN tN); + + template<class R, class F, class T1, ..., class Tn > + unspecified bind(F f, T1 t1, ..., TN tN); + + namespace placeholders { + // M is the implementation-defined number of placeholders + extern unspecified _1; + extern unspecified _2; + . + . + . + extern unspecified _M; + } +#endif + + // [3.7] polymorphic function wrappers + class bad_function_call; + template<class Function> class function; + template<class Function> + void swap(function<Function>&, function<Function>&); + template<class Function1, class Function2> + void operator==(const function<Function1>&, const function<Function2>&); + template<class Function1, class Function2> + void operator!=(const function<Function1>&, const function<Function2>&); + +#if 0 + template <class Function> + bool operator==(const function<Function>&, unspecified-null-pointer-type); + template <class Function> + bool operator==(unspecified-null-pointer-type, const function<Function>&); + template <class Function> + bool operator!=(const function<Function>&, unspecified-null-pointer-type); + template <class Function> + bool operator!=(unspecified-null-pointer-type, const function<Function>&); +#endif + +} // namespace tr1 +} // namespace std diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/types_std_tr1.cc new file mode 100644 index 000000000..075a852c6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/types_std_tr1.cc @@ -0,0 +1,25 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/functional> + +namespace gnu +{ + using std::tr1::bad_function_call; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/using_namespace_std_tr1_placeholders.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/using_namespace_std_tr1_placeholders.cc new file mode 100644 index 000000000..9cfa9f61e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/headers/functional/using_namespace_std_tr1_placeholders.cc @@ -0,0 +1,25 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/functional> + +namespace gnu +{ + using namespace std::tr1::placeholders; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/mem_fn.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/mem_fn.cc new file mode 100644 index 000000000..7a6e66125 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/mem_fn.cc @@ -0,0 +1,80 @@ +// 2005-01-26 Douglas Gregor <dgregor@cs.indiana.edu> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.5 function template mem_fn +#include <tr1/functional> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +struct X { int bar; }; + +struct Y : X { }; + +template<typename T> +struct dumb_ptr +{ + dumb_ptr(T* p) : p(p) {} + + T& operator*() const { return *p; } + + private: + T* p; +}; + +// Test mem_fn with a data member +void test01(int r = 0) +{ + using std::tr1::mem_fn; + + X x; + Y y; + const X& xc = x; + const Y& yc = y; + X* xp = &x; + Y* yp =&y; + const X* xpc = xp; + const Y* ypc = yp; + dumb_ptr<X> xd(xp); + dumb_ptr<Y> yd(yp); + const dumb_ptr<X>& xdc = xd; + const dumb_ptr<Y>& ydc = yd; + + int& bx = mem_fn(&X::bar)(x); + const int& bxc = mem_fn(&X::bar)(xc); + int& bxp = mem_fn(&X::bar)(xp); + const int& bxpc = mem_fn(&X::bar)(xpc); + const int& bxd = mem_fn(&X::bar)(xd); + const int& bxdc = mem_fn(&X::bar)(xdc); + + int& by = mem_fn(&X::bar)(y); + const int& byc = mem_fn(&X::bar)(yc); + int& byp = mem_fn(&X::bar)(yp); + const int& bypc = mem_fn(&X::bar)(ypc); + const int& byd = mem_fn(&X::bar)(yd); + const int& bydc = mem_fn(&X::bar)(ydc); + + // Avoid unused variable warnings. + r = bx + bxc + bxp + bxpc + bxd + bxdc + by + byc + byp + bypc + byd + bydc; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc new file mode 100644 index 000000000..2ab059b42 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc @@ -0,0 +1,115 @@ +// 2005-02-27 Douglas Gregor <doug.gregor -at- gmail.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.1 reference wrappers +#include <tr1/functional> +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +bool test __attribute__((unused)) = true; + +struct X +{ + typedef int result_type; + + X() : bar(17) {} + + int foo(float x) { return truncate_float(x); } + int foo_c(float x) const { return truncate_float(x); } + int foo_v(float x) volatile { return truncate_float(x); } + int foo_cv(float x) const volatile { return truncate_float(x); } + + int operator()(float x) + { + return foo(x) + 1; + } + + int operator()(float x) const + { + return foo_c(x) + 2; + } + + int bar; + + private: + X(const X&); + X& operator=(const X&); +}; + +int seventeen() { return 17; } + +struct get_seventeen +{ + typedef int result_type; + int operator()() const { return 17; } +}; + +void test01() +{ + using std::tr1::ref; + using std::tr1::cref; + + ::get_seventeen get_sev; + ::X x; + ::X* xp = &x; + int (::X::* p_foo)(float) = &::X::foo; + int (::X::* p_foo_c)(float) const = &::X::foo_c; + int (::X::* p_foo_v)(float) volatile = &::X::foo_v; + int (::X::* p_foo_cv)(float) const volatile = &::X::foo_cv; + int ::X::* p_bar = &::X::bar; + + const float pi = 3.14; + + // Functions + VERIFY(ref(truncate_float)(pi) == 3); + VERIFY(ref(seventeen)() == 17); + + // Function pointers + VERIFY(cref(&truncate_float)(pi) == 3); + VERIFY(cref(&seventeen)() == 17); + + // Member function pointers + VERIFY(ref(p_foo)(x, pi) == 3); + VERIFY(ref(p_foo)(xp, pi) == 3); + VERIFY(ref(p_foo_c)(x, pi) == 3); + VERIFY(ref(p_foo_c)(xp, pi) == 3); + VERIFY(ref(p_foo_v)(x, pi) == 3); + VERIFY(ref(p_foo_v)(xp, pi) == 3); + VERIFY(ref(p_foo_cv)(x, pi) == 3); + VERIFY(ref(p_foo_cv)(xp, pi) == 3); + + // Member data pointers + VERIFY(ref(p_bar)(x) == 17); + VERIFY(ref(p_bar)(xp) == 17); + + // Function objects + VERIFY(ref(get_sev)() == 17); + VERIFY(cref(get_sev)() == 17); + VERIFY(ref(x)(pi) == 4); + VERIFY(cref(x)(pi) == 5); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc new file mode 100644 index 000000000..851b26b9e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc @@ -0,0 +1,88 @@ +// 2005-02-27 Douglas Gregor <doug.gregor -at- gmail.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 2.1 reference wrappers +#include <tr1/functional> +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +using namespace __gnu_test; + +struct X {}; + +struct int_result_type { typedef int result_type; }; + +struct derives_unary : std::unary_function<int, int> {}; + +struct derives_binary : std::binary_function<int, float, int> {}; + +struct derives_unary_binary + : std::unary_function<int, int>, + std::binary_function<int, float, int> +{ + typedef int result_type; +}; + +void test01() +{ + bool test __attribute__((unused)) = true; + + using std::tr1::reference_wrapper; + using std::tr1::is_same; + using std::tr1::is_convertible; + using std::unary_function; + using std::binary_function; + + // Check result_type typedef + VERIFY((is_same<reference_wrapper<int_result_type>::result_type, int>::value)); + VERIFY((is_same<reference_wrapper<derives_unary>::result_type, int>::value)); + VERIFY((is_same<reference_wrapper<derives_binary>::result_type, int>::value)); + VERIFY((is_same<reference_wrapper<derives_unary_binary>::result_type, int>::value)); + VERIFY((is_same<reference_wrapper<int(void)>::result_type, int>::value)); + VERIFY((is_same<reference_wrapper<int(*)(void)>::result_type, int>::value)); + VERIFY((is_same<reference_wrapper<int (::X::*)()>::result_type, int>::value)); + VERIFY((is_same<reference_wrapper<int (::X::*)(float)>::result_type, int>::value)); + + // Check derivation from unary_function + VERIFY((is_convertible<reference_wrapper<derives_unary>*, unary_function<int, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<derives_unary_binary>*, unary_function<int, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int(int)>*, unary_function<int, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int(*)(int)>*, unary_function<int, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int (::X::*)()>*, unary_function< ::X*, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int (::X::*)() const>*, unary_function<const ::X*, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int (::X::*)() volatile>*, unary_function<volatile ::X*, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int (::X::*)() const volatile>*, unary_function<const volatile ::X*, int>*>::value)); + + // Check derivation from binary_function + VERIFY((is_convertible<reference_wrapper<derives_binary>*, binary_function<int, float, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<derives_unary_binary>*, binary_function<int, float, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int(int, float)>*, binary_function<int, float, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int(*)(int, float)>*, binary_function<int, float, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int (::X::*)(float)>*, binary_function< ::X*, float, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int (::X::*)(float) const>*, binary_function<const ::X*, float, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int (::X::*)(float) volatile>*, binary_function<volatile ::X*, float, int>*>::value)); + VERIFY((is_convertible<reference_wrapper<int (::X::*)(float) const volatile>*, binary_function<const volatile ::X*, float, int>*>::value)); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc new file mode 100644 index 000000000..1c137bf99 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc @@ -0,0 +1,74 @@ +// 2005-01-26 Douglas Gregor <doug.gregor -at- gmail.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 3.4 function return types +#include <tr1/functional> +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +class X {}; + +struct int_result_type { typedef int result_type; }; + +struct int_result_of +{ + template<typename F> struct result { typedef int type; }; +}; + +struct int_result_type_and_float_result_of +{ + typedef int result_type; + template<typename F> struct result { typedef float type; }; +}; + +void test01() +{ + bool test __attribute__((unused)) = true; + + using std::tr1::result_of; + using std::tr1::is_same; + using namespace __gnu_test; + + typedef int (*func_ptr)(float, double); + typedef int (&func_ref)(float, double); + typedef int (::X::*mem_func_ptr)(float); + typedef int (::X::*mem_func_ptr_c)(float) const; + typedef int (::X::*mem_func_ptr_v)(float) volatile; + typedef int (::X::*mem_func_ptr_cv)(float) const volatile; + + VERIFY((is_same<result_of<int_result_type(float)>::type, int>::value)); + VERIFY((is_same<result_of<int_result_of(double)>::type, int>::value)); + VERIFY((is_same<result_of<int_result_of(void)>::type, void>::value)); + VERIFY((is_same<result_of<const int_result_of(double)>::type, int>::value)); + VERIFY((is_same<result_of<volatile int_result_of(void)>::type, void>::value)); + VERIFY((is_same<result_of<int_result_type_and_float_result_of(char)>::type, int>::value)); + VERIFY((is_same<result_of<func_ptr(char, float)>::type, int>::value)); + VERIFY((is_same<result_of<func_ref(char, float)>::type, int>::value)); + VERIFY((is_same<result_of<mem_func_ptr(::X,char)>::type, int>::value)); + VERIFY((is_same<result_of<mem_func_ptr_c(::X,char)>::type, int>::value)); + VERIFY((is_same<result_of<mem_func_ptr_v(::X,char)>::type, int>::value)); + VERIFY((is_same<result_of<mem_func_ptr_cv(::X,char)>::type, int>::value)); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..6f8ba791e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_const<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc new file mode 100644 index 000000000..213db8806 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc @@ -0,0 +1,53 @@ +// 2004-12-16 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.1 Const-volatile modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_const; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<add_const<int>::type, const int>::value) ); + VERIFY( (is_same<add_const<volatile int>::type, const volatile int>::value) ); + VERIFY( (is_same<add_const<int*>::type, int* const>::value) ); + VERIFY( (is_same<add_const<int&>::type, int&>::value) ); + VERIFY( (is_same<add_const<int (int)>::type, int (int)>::value) ); + VERIFY( (is_same<add_const<const int>::type, const int>::value) ); + VERIFY( (is_same<add_const<ClassType>::type, const ClassType>::value) ); + VERIFY( (is_same<add_const<volatile ClassType>::type, + const volatile ClassType>::value) ); + VERIFY( (is_same<add_const<ClassType*>::type, ClassType* const>::value) ); + VERIFY( (is_same<add_const<ClassType&>::type, ClassType&>::value) ); + VERIFY( (is_same<add_const<ClassType (ClassType)>::type, + ClassType (ClassType)>::value) ); + VERIFY( (is_same<add_const<const ClassType>::type, const ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..bb2f16bca --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_cv<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc new file mode 100644 index 000000000..d7c9346c9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc @@ -0,0 +1,56 @@ +// 2004-12-16 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.1 Const-volatile modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_cv; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<add_cv<int>::type, const volatile int>::value) ); + VERIFY( (is_same<add_cv<const int>::type, const volatile int>::value) ); + VERIFY( (is_same<add_cv<int*>::type, int* const volatile>::value) ); + VERIFY( (is_same<add_cv<int&>::type, int&>::value) ); + VERIFY( (is_same<add_cv<int (int)>::type, int (int)>::value) ); + VERIFY( (is_same<add_cv<const volatile int>::type, + const volatile int>::value) ); + VERIFY( (is_same<add_cv<ClassType>::type, const volatile ClassType>::value) ); + VERIFY( (is_same<add_cv<volatile ClassType>::type, + const volatile ClassType>::value) ); + VERIFY( (is_same<add_cv<ClassType*>::type, + ClassType* const volatile>::value) ); + VERIFY( (is_same<add_cv<ClassType&>::type, ClassType&>::value) ); + VERIFY( (is_same<add_cv<ClassType (ClassType)>::type, + ClassType (ClassType)>::value) ); + VERIFY( (is_same<add_cv<const volatile ClassType>::type, + const volatile ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..3755bd7f9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_pointer<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc new file mode 100644 index 000000000..930863636 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc @@ -0,0 +1,45 @@ +// 2004-12-12 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.2 Reference modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_pointer; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<add_pointer<int>::type, int*>::value) ); + VERIFY( (is_same<add_pointer<int*>::type, int**>::value) ); + VERIFY( (is_same<add_pointer<const int>::type, const int*>::value) ); + VERIFY( (is_same<add_pointer<int&>::type, int*>::value) ); + VERIFY( (is_same<add_pointer<ClassType*>::type, ClassType**>::value) ); + VERIFY( (is_same<add_pointer<ClassType>::type, ClassType*>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..bd0ca275d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_reference<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc new file mode 100644 index 000000000..2ff989303 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc @@ -0,0 +1,48 @@ +// 2004-12-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.2 Reference modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_reference; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<add_reference<int>::type, int&>::value) ); + VERIFY( (is_same<add_reference<int&>::type, int&>::value) ); + VERIFY( (is_same<add_reference<const int>::type, const int&>::value) ); + VERIFY( (is_same<add_reference<int*>::type, int*&>::value) ); + VERIFY( (is_same<add_reference<ClassType&>::type, ClassType&>::value) ); + VERIFY( (is_same<add_reference<ClassType>::type, ClassType&>::value) ); + + VERIFY( (is_same<add_reference<void>::type, void>::value) ); + VERIFY( (is_same<add_reference<const void>::type, const void>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..f068cb942 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_volatile<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc new file mode 100644 index 000000000..64e4a7f5a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc @@ -0,0 +1,55 @@ +// 2004-12-16 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.1 Const-volatile modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_volatile; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<add_volatile<int>::type, volatile int>::value) ); + VERIFY( (is_same<add_volatile<const int>::type, const volatile int>::value) ); + VERIFY( (is_same<add_volatile<int*>::type, int* volatile>::value) ); + VERIFY( (is_same<add_volatile<int&>::type, int&>::value) ); + VERIFY( (is_same<add_volatile<int (int)>::type, int (int)>::value) ); + VERIFY( (is_same<add_volatile<volatile int>::type, volatile int>::value) ); + VERIFY( (is_same<add_volatile<ClassType>::type, volatile ClassType>::value) ); + VERIFY( (is_same<add_volatile<const ClassType>::type, + const volatile ClassType>::value) ); + VERIFY( (is_same<add_volatile<ClassType*>::type, + ClassType* volatile>::value) ); + VERIFY( (is_same<add_volatile<ClassType&>::type, ClassType&>::value) ); + VERIFY( (is_same<add_volatile<ClassType (ClassType)>::type, + ClassType (ClassType)>::value) ); + VERIFY( (is_same<add_volatile<volatile ClassType>::type, + volatile ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..7c7911811 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct aligned_storage<1, alignment_of<test_type>::value>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc new file mode 100644 index 000000000..1e933ef99 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc @@ -0,0 +1,62 @@ +// 2005-01-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.8 Other transformations + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::aligned_storage; + using std::tr1::alignment_of; + using namespace __gnu_test; + + const std::size_t align_c = alignment_of<char>::value; + VERIFY( (sizeof(aligned_storage<4, align_c>::type) >= 4) ); + VERIFY( (__alignof__(aligned_storage<4, align_c>::type) == align_c) ); + + const std::size_t align_s = alignment_of<short>::value; + VERIFY( (sizeof(aligned_storage<1, align_s>::type) >= 1) ); + VERIFY( (__alignof__(aligned_storage<1, align_s>::type) == align_s) ); + + const std::size_t align_i = alignment_of<int>::value; + VERIFY( (sizeof(aligned_storage<7, align_i>::type) >= 7) ); + VERIFY( (__alignof__(aligned_storage<7, align_i>::type) == align_i) ); + + const std::size_t align_d = alignment_of<double>::value; + VERIFY( (sizeof(aligned_storage<2, align_d>::type) >= 2) ); + VERIFY( (__alignof__(aligned_storage<2, align_d>::type) == align_d) ); + + const std::size_t align_ai = alignment_of<int[4]>::value; + VERIFY( (sizeof(aligned_storage<20, align_ai>::type) >= 20) ); + VERIFY( (__alignof__(aligned_storage<20, align_ai>::type) == align_ai) ); + + const std::size_t align_ct = alignment_of<ClassType>::value; + VERIFY( (sizeof(aligned_storage<11, align_ct>::type) >= 11) ); + VERIFY( (__alignof__(aligned_storage<11, align_ct>::type) == align_ct) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..a533645cf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct alignment_of<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/typedefs.cc new file mode 100644 index 000000000..b8ed9671c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::alignment_of<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/value.cc new file mode 100644 index 000000000..234d76f81 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/value.cc @@ -0,0 +1,44 @@ +// 2005-01-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::alignment_of; + using namespace __gnu_test; + + VERIFY( (test_property<alignment_of, char>(__alignof__(char))) ); + VERIFY( (test_property<alignment_of, short>(__alignof__(short))) ); + VERIFY( (test_property<alignment_of, int>(__alignof__(int))) ); + VERIFY( (test_property<alignment_of, double>(__alignof__(double))) ); + VERIFY( (test_property<alignment_of, int[4]>(__alignof__(int[4]))) ); + VERIFY( (test_property<alignment_of, ClassType>(__alignof__(ClassType))) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..03e6520e1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct extent<test_type, 2>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/typedefs.cc new file mode 100644 index 000000000..978c8b68a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-12 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::extent<int, 1> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/value.cc new file mode 100644 index 000000000..d7127aa3c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/value.cc @@ -0,0 +1,56 @@ +// 2004-12-12 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::extent; + using namespace __gnu_test; + + VERIFY( (test_property<extent, int, 0>(0)) ); + VERIFY( (test_property<extent, int[2], 0>(2)) ); + VERIFY( (test_property<extent, int[2][4], 0>(2)) ); + VERIFY( (test_property<extent, int[][4], 0>(0)) ); + VERIFY( (extent<int, 1>::value == 0) ); + VERIFY( (extent<int[2], 1>::value == 0) ); + VERIFY( (extent<int[2][4], 1>::value == 4) ); + VERIFY( (extent<int[][4], 1>::value == 4) ); + VERIFY( (extent<int[10][4][6][8][12][2], 4>::value == 12) ); + VERIFY( (test_property<extent, ClassType, 0>(0)) ); + VERIFY( (test_property<extent, ClassType[2], 0>(2)) ); + VERIFY( (test_property<extent, ClassType[2][4], 0>(2)) ); + VERIFY( (test_property<extent, ClassType[][4], 0>(0)) ); + VERIFY( (extent<ClassType, 1>::value == 0) ); + VERIFY( (extent<ClassType[2], 1>::value == 0) ); + VERIFY( (extent<ClassType[2][4], 1>::value == 4) ); + VERIFY( (extent<ClassType[][4], 1>::value == 4) ); + VERIFY( (extent<ClassType[10][4][6][8][12][2], 4>::value == 12) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..ee6140a83 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_nothrow_assign<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/typedefs.cc new file mode 100644 index 000000000..4175eae82 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_nothrow_assign<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/value.cc new file mode 100644 index 000000000..478f5e10c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/value.cc @@ -0,0 +1,54 @@ +// 2004-12-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_nothrow_assign; + using namespace __gnu_test; + + VERIFY( (test_category<has_nothrow_assign, void>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int>(true)) ); + VERIFY( (test_category<has_nothrow_assign, float>(true)) ); + VERIFY( (test_category<has_nothrow_assign, EnumType>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int*>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int(*)(int)>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int[2]>(true)) ); + VERIFY( (test_category<has_nothrow_assign, float[][3]>(true)) ); + VERIFY( (test_category<has_nothrow_assign, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int*[3]>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_nothrow_assign, + int (ClassType::*[][2][3]) (int)>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..5686cff40 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_nothrow_constructor<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/typedefs.cc new file mode 100644 index 000000000..85fd577f9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-29 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_nothrow_constructor<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/value.cc new file mode 100644 index 000000000..d6810d3ac --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/value.cc @@ -0,0 +1,57 @@ +// 2004-12-29 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_nothrow_constructor; + using namespace __gnu_test; + + VERIFY( (test_category<has_nothrow_constructor, void>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, int>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, float>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, EnumType>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, int*>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, int(*)(int)>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, + int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, int[2]>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, float[][3]>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, int*[3]>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, + int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, + int (ClassType::*[][2][3]) (int)>(true)) ); + VERIFY( (test_category<has_nothrow_constructor, ClassType>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..dc07be0d9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_nothrow_copy<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/typedefs.cc new file mode 100644 index 000000000..7a05eeb14 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_nothrow_copy<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/value.cc new file mode 100644 index 000000000..01a37ec17 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/value.cc @@ -0,0 +1,54 @@ +// 2004-12-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_nothrow_copy; + using namespace __gnu_test; + + VERIFY( (test_category<has_nothrow_copy, void>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int>(true)) ); + VERIFY( (test_category<has_nothrow_copy, float>(true)) ); + VERIFY( (test_category<has_nothrow_copy, EnumType>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int*>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int(*)(int)>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int[2]>(true)) ); + VERIFY( (test_category<has_nothrow_copy, float[][3]>(true)) ); + VERIFY( (test_category<has_nothrow_copy, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int*[3]>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_nothrow_copy, + int (ClassType::*[][2][3]) (int)>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..d63d9726b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_trivial_assign<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/typedefs.cc new file mode 100644 index 000000000..d010f95b0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_trivial_assign<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/value.cc new file mode 100644 index 000000000..6804c1e5b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/value.cc @@ -0,0 +1,54 @@ +// 2004-12-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_trivial_assign; + using namespace __gnu_test; + + VERIFY( (test_category<has_trivial_assign, void>(true)) ); + VERIFY( (test_category<has_trivial_assign, int>(true)) ); + VERIFY( (test_category<has_trivial_assign, float>(true)) ); + VERIFY( (test_category<has_trivial_assign, EnumType>(true)) ); + VERIFY( (test_category<has_trivial_assign, int*>(true)) ); + VERIFY( (test_category<has_trivial_assign, int(*)(int)>(true)) ); + VERIFY( (test_category<has_trivial_assign, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_trivial_assign, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_trivial_assign, int[2]>(true)) ); + VERIFY( (test_category<has_trivial_assign, float[][3]>(true)) ); + VERIFY( (test_category<has_trivial_assign, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_trivial_assign, int*[3]>(true)) ); + VERIFY( (test_category<has_trivial_assign, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_trivial_assign, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_trivial_assign, + int (ClassType::*[][2][3]) (int)>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..9d3345864 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_trivial_constructor<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/typedefs.cc new file mode 100644 index 000000000..ac46b1649 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_trivial_constructor<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/value.cc new file mode 100644 index 000000000..e9e8aca83 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/value.cc @@ -0,0 +1,57 @@ +// 2004-12-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_trivial_constructor; + using namespace __gnu_test; + + VERIFY( (test_category<has_trivial_constructor, void>(true)) ); + VERIFY( (test_category<has_trivial_constructor, int>(true)) ); + VERIFY( (test_category<has_trivial_constructor, float>(true)) ); + VERIFY( (test_category<has_trivial_constructor, EnumType>(true)) ); + VERIFY( (test_category<has_trivial_constructor, int*>(true)) ); + VERIFY( (test_category<has_trivial_constructor, int(*)(int)>(true)) ); + VERIFY( (test_category<has_trivial_constructor, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_trivial_constructor, + int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_trivial_constructor, int[2]>(true)) ); + VERIFY( (test_category<has_trivial_constructor, float[][3]>(true)) ); + VERIFY( (test_category<has_trivial_constructor, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_trivial_constructor, int*[3]>(true)) ); + VERIFY( (test_category<has_trivial_constructor, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_trivial_constructor, + int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_trivial_constructor, + int (ClassType::*[][2][3]) (int)>(true)) ); + VERIFY( (test_category<has_trivial_constructor, ClassType>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..a50bcaa13 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_trivial_copy<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/typedefs.cc new file mode 100644 index 000000000..6ede2f34d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_trivial_copy<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/value.cc new file mode 100644 index 000000000..005cefbde --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/value.cc @@ -0,0 +1,54 @@ +// 2004-12-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_trivial_copy; + using namespace __gnu_test; + + VERIFY( (test_category<has_trivial_copy, void>(true)) ); + VERIFY( (test_category<has_trivial_copy, int>(true)) ); + VERIFY( (test_category<has_trivial_copy, float>(true)) ); + VERIFY( (test_category<has_trivial_copy, EnumType>(true)) ); + VERIFY( (test_category<has_trivial_copy, int*>(true)) ); + VERIFY( (test_category<has_trivial_copy, int(*)(int)>(true)) ); + VERIFY( (test_category<has_trivial_copy, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_trivial_copy, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_trivial_copy, int[2]>(true)) ); + VERIFY( (test_category<has_trivial_copy, float[][3]>(true)) ); + VERIFY( (test_category<has_trivial_copy, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_trivial_copy, int*[3]>(true)) ); + VERIFY( (test_category<has_trivial_copy, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_trivial_copy, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_trivial_copy, + int (ClassType::*[][2][3]) (int)>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..27e9fa6ec --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_trivial_destructor<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/typedefs.cc new file mode 100644 index 000000000..31719e2d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_trivial_destructor<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/value.cc new file mode 100644 index 000000000..c63b05040 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/value.cc @@ -0,0 +1,57 @@ +// 2004-12-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_trivial_destructor; + using namespace __gnu_test; + + VERIFY( (test_category<has_trivial_destructor, void>(true)) ); + VERIFY( (test_category<has_trivial_destructor, int>(true)) ); + VERIFY( (test_category<has_trivial_destructor, float>(true)) ); + VERIFY( (test_category<has_trivial_destructor, EnumType>(true)) ); + VERIFY( (test_category<has_trivial_destructor, int*>(true)) ); + VERIFY( (test_category<has_trivial_destructor, int(*)(int)>(true)) ); + VERIFY( (test_category<has_trivial_destructor, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_trivial_destructor, + int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_trivial_destructor, int[2]>(true)) ); + VERIFY( (test_category<has_trivial_destructor, float[][3]>(true)) ); + VERIFY( (test_category<has_trivial_destructor, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_trivial_destructor, int*[3]>(true)) ); + VERIFY( (test_category<has_trivial_destructor, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_trivial_destructor, + int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_trivial_destructor, + int (ClassType::*[][2][3]) (int)>(true)) ); + VERIFY( (test_category<has_trivial_destructor, ClassType>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..bc41fc8e3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_virtual_destructor<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/typedefs.cc new file mode 100644 index 000000000..478673093 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2007-04-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_virtual_destructor<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/value.cc new file mode 100644 index 000000000..dcb490a91 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/value.cc @@ -0,0 +1,55 @@ +// 2007-04-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <iostream> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_virtual_destructor; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<has_virtual_destructor, + VirtualDestructorClass>(true)) ); + VERIFY( (test_category<has_virtual_destructor, std::iostream>(true)) ); + VERIFY( (test_category<has_virtual_destructor, std::streambuf>(true)) ); + + // Negative tests. + VERIFY( (test_category<has_virtual_destructor, PolymorphicClass>(false)) ); + VERIFY( (test_category<has_virtual_destructor, DerivedPolymorphic>(false)) ); + VERIFY( (test_category<has_virtual_destructor, AbstractClass>(false)) ); + VERIFY( (test_category<has_virtual_destructor, void>(false)) ); + VERIFY( (test_category<has_virtual_destructor, int (int)>(false)) ); + VERIFY( (test_category<has_virtual_destructor, int&>(false)) ); + VERIFY( (test_category<has_virtual_destructor, EnumType>(false)) ); + VERIFY( (test_category<has_virtual_destructor, ClassType>(false)) ); + VERIFY( (test_category<has_virtual_destructor, DerivedType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/synopsis.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/synopsis.cc new file mode 100644 index 000000000..5f96f606c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/synopsis.cc @@ -0,0 +1,103 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/type_traits> + +namespace std { +namespace tr1 { + + // [4.3] helper class: + template <class T, T v> struct integral_constant; + typedef integral_constant<bool, true> true_type; + typedef integral_constant<bool, false> false_type; + + // [4.5.1] primary type categories: + template <class T> struct is_void; + template <class T> struct is_integral; + template <class T> struct is_floating_point; + template <class T> struct is_array; + template <class T> struct is_pointer; + template <class T> struct is_reference; + template <class T> struct is_member_object_pointer; + template <class T> struct is_member_function_pointer; + template <class T> struct is_enum; + template <class T> struct is_union; + template <class T> struct is_class; + template <class T> struct is_function; + + // [4.5.2] composite type categories: + template <class T> struct is_arithmetic; + template <class T> struct is_fundamental; + template <class T> struct is_object; + template <class T> struct is_scalar; + template <class T> struct is_compound; + template <class T> struct is_member_pointer; + + // [4.5.3] type properties: + template <class T> struct is_const; + template <class T> struct is_volatile; + template <class T> struct is_pod; + template <class T> struct is_empty; + template <class T> struct is_polymorphic; + template <class T> struct is_abstract; + template <class T> struct has_trivial_constructor; + template <class T> struct has_trivial_copy; + template <class T> struct has_trivial_assign; + template <class T> struct has_trivial_destructor; + template <class T> struct has_nothrow_constructor; + template <class T> struct has_nothrow_copy; + template <class T> struct has_nothrow_assign; + template <class T> struct has_virtual_destructor; + template <class T> struct is_signed; + template <class T> struct is_unsigned; + template <class T> struct alignment_of; + template <class T> struct rank; + template <class T, unsigned I> struct extent; + + // [4.6] type relations: + template <class T, class U> struct is_same; + template <class Base, class Derived> struct is_base_of; + template <class From, class To> struct is_convertible; + + // [4.7.1] const-volatile modifications: + template <class T> struct remove_const; + template <class T> struct remove_volatile; + template <class T> struct remove_cv; + template <class T> struct add_const; + template <class T> struct add_volatile; + template <class T> struct add_cv; + + // [4.7.2] reference modifications: + template <class T> struct remove_reference; + template <class T> struct add_reference; + + // [4.7.3] array modifications: + template <class T> struct remove_extent; + template <class T> struct remove_all_extents; + + // [4.7.4] pointer modifications: + template <class T> struct remove_pointer; + template <class T> struct add_pointer; + + // [4.8] other transformations: + template <std::size_t Len, std::size_t Align> struct aligned_storage; +} // namespace tr1 +} // namespace std diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/types_std_tr1.cc new file mode 100644 index 000000000..0d478f544 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/types_std_tr1.cc @@ -0,0 +1,26 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/type_traits> + +namespace gnu +{ + using std::tr1::true_type; + using std::tr1::false_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc new file mode 100644 index 000000000..52497e1f4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc @@ -0,0 +1,52 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <type_traits> +#include <testsuite_common_types.h> + +namespace __gnu_test +{ + struct constexpr_member_data + { + template<typename _Ttesttype> + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v __attribute__((unused)) (_Ttesttype::value); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + test.operator()<std::integral_constant<unsigned short, 69>>(); + test.operator()<std::integral_constant<bool, true>>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..2b60f5318 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct integral_constant<test_type, -3>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/typedefs.cc new file mode 100644 index 000000000..89fd5c268 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::integral_constant<int, 1> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/static_definition.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/static_definition.cc new file mode 100644 index 000000000..c1da4f8ee --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/static_definition.cc @@ -0,0 +1,36 @@ +// 2006-05-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.3 Helper classes + +#include <tr1/type_traits> +#include <testsuite_hooks.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + const bool* p = &std::tr1::integral_constant<bool, true>::value; + VERIFY( p ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_type_typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_type_typedefs.cc new file mode 100644 index 000000000..94f2fa4aa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_type_typedefs.cc @@ -0,0 +1,42 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::true_type true_type; + typedef std::tr1::false_type false_type; + + typedef true_type::value_type true_value_type; + typedef true_type::type true_type; + typedef true_type::type::value_type true_type_value_type; + typedef true_type::type::type true_type_type; + + typedef false_type::value_type false_value_type; + typedef false_type::type false_type; + typedef false_type::type::value_type false_type_value_type; + typedef false_type::type::type false_type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_value.cc new file mode 100644 index 000000000..1d5e25d9a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_value.cc @@ -0,0 +1,41 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.3 Helper classes + +#include <tr1/type_traits> +#include <testsuite_hooks.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::true_type; + using std::tr1::false_type; + + VERIFY( true_type::value == true ); + VERIFY( false_type::value == false ); + VERIFY( true_type::type::value == true ); + VERIFY( false_type::type::value == false ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..3df8b61fa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_abstract<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/typedefs.cc new file mode 100644 index 000000000..ff6bc501c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-28 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_abstract<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/value.cc new file mode 100644 index 000000000..14c0bbffa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/value.cc @@ -0,0 +1,48 @@ +// 2005-01-28 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_abstract; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_abstract, AbstractClass>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_abstract, void>(false)) ); + VERIFY( (test_category<is_abstract, int (int)>(false)) ); + VERIFY( (test_category<is_abstract, int&>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_abstract, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..c8f9d9639 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_arithmetic<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/typedefs.cc new file mode 100644 index 000000000..10bbb38eb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_arithmetic<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc new file mode 100644 index 000000000..dfed8e40d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc @@ -0,0 +1,60 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.2 Composite type traits + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_arithmetic; + using namespace __gnu_test; + + VERIFY( (test_category<is_arithmetic, void>(false)) ); + + VERIFY( (test_category<is_arithmetic, char>(true)) ); + VERIFY( (test_category<is_arithmetic, signed char>(true)) ); + VERIFY( (test_category<is_arithmetic, unsigned char>(true)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category<is_arithmetic, wchar_t>(true)) ); +#endif + VERIFY( (test_category<is_arithmetic, short>(true)) ); + VERIFY( (test_category<is_arithmetic, unsigned short>(true)) ); + VERIFY( (test_category<is_arithmetic, int>(true)) ); + VERIFY( (test_category<is_arithmetic, unsigned int>(true)) ); + VERIFY( (test_category<is_arithmetic, long>(true)) ); + VERIFY( (test_category<is_arithmetic, unsigned long>(true)) ); + VERIFY( (test_category<is_arithmetic, long long>(true)) ); + VERIFY( (test_category<is_arithmetic, unsigned long long>(true)) ); + VERIFY( (test_category<is_arithmetic, float>(true)) ); + VERIFY( (test_category<is_arithmetic, double>(true)) ); + VERIFY( (test_category<is_arithmetic, long double>(true)) ); + + // Sanity check. + VERIFY( (test_category<is_arithmetic, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..c518792b4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_array<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/typedefs.cc new file mode 100644 index 000000000..ec08cdd1f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_array<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/value.cc new file mode 100644 index 000000000..cf3b70ce7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/value.cc @@ -0,0 +1,53 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_array; + using namespace __gnu_test; + + VERIFY( (test_category<is_array, int[2]>(true)) ); + VERIFY( (test_category<is_array, int[]>(true)) ); + VERIFY( (test_category<is_array, int[2][3]>(true)) ); + VERIFY( (test_category<is_array, int[][3]>(true)) ); + VERIFY( (test_category<is_array, float*[2]>(true)) ); + VERIFY( (test_category<is_array, float*[]>(true)) ); + VERIFY( (test_category<is_array, float*[2][3]>(true)) ); + VERIFY( (test_category<is_array, float*[][3]>(true)) ); + VERIFY( (test_category<is_array, ClassType[2]>(true)) ); + VERIFY( (test_category<is_array, ClassType[]>(true)) ); + VERIFY( (test_category<is_array, ClassType[2][3]>(true)) ); + VERIFY( (test_category<is_array, ClassType[][3]>(true)) ); + + // Sanity check. + VERIFY( (test_category<is_array, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..9770f09e6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_base_of<test_type, test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/typedefs.cc new file mode 100644 index 000000000..51499d746 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-03-04 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_base_of<int, int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/value.cc new file mode 100644 index 000000000..fa7bc8074 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/value.cc @@ -0,0 +1,93 @@ +// 2005-03-04 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.6 Relationships between types + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +class HiddenCons +{ + HiddenCons(); + HiddenCons(const HiddenCons&); +}; + +class DerivedHiddenCons +: private HiddenCons +{ + DerivedHiddenCons(); + DerivedHiddenCons(const DerivedHiddenCons&); +}; + +class MultiDerivedHiddenCons +: private HiddenCons, private __gnu_test::ClassType +{ + MultiDerivedHiddenCons(); + MultiDerivedHiddenCons(const MultiDerivedHiddenCons&); +}; + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_base_of; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_relationship<is_base_of, int, int>(true)) ); + VERIFY( (test_relationship<is_base_of, EnumType, EnumType>(true)) ); + VERIFY( (test_relationship<is_base_of, UnionType, UnionType>(true)) ); + VERIFY( (test_relationship<is_base_of, AbstractClass, + AbstractClass>(true)) ); + VERIFY( (test_relationship<is_base_of, ClassType, DerivedType>(true)) ); + VERIFY( (test_relationship<is_base_of, ClassType, const DerivedType>(true)) ); + VERIFY( (test_relationship<is_base_of, volatile ClassType, + volatile DerivedType>(true)) ); + VERIFY( (test_relationship<is_base_of, PolymorphicClass, + DerivedPolymorphic>(true)) ); + VERIFY( (test_relationship<is_base_of, HiddenCons, + DerivedHiddenCons>(true)) ); + VERIFY( (test_relationship<is_base_of, HiddenCons, + MultiDerivedHiddenCons>(true)) ); + VERIFY( (test_relationship<is_base_of, ClassType, + MultiDerivedHiddenCons>(true)) ); + + // Negative tests. + VERIFY( (test_relationship<is_base_of, int, const int>(false)) ); + VERIFY( (test_relationship<is_base_of, volatile UnionType, + UnionType>(false)) ); + VERIFY( (test_relationship<is_base_of, int&, ClassType>(false)) ); + VERIFY( (test_relationship<is_base_of, AbstractClass, ClassType>(false)) ); + VERIFY( (test_relationship<is_base_of, ClassType, AbstractClass>(false)) ); + VERIFY( (test_relationship<is_base_of, DerivedType, ClassType>(false)) ); + VERIFY( (test_relationship<is_base_of, DerivedPolymorphic, + PolymorphicClass>(false)) ); + VERIFY( (test_relationship<is_base_of, DerivedHiddenCons, + HiddenCons>(false)) ); + VERIFY( (test_relationship<is_base_of, MultiDerivedHiddenCons, + HiddenCons>(false)) ); + VERIFY( (test_relationship<is_base_of, MultiDerivedHiddenCons, + ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..4a372bf46 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_class<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/typedefs.cc new file mode 100644 index 000000000..9ed7f2386 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2007-04-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_class<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/value.cc new file mode 100644 index 000000000..1fe8fe100 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/value.cc @@ -0,0 +1,60 @@ +// 2007-04-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_class; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_class, ClassType>(true)) ); + VERIFY( (test_category<is_class, DerivedType>(true)) ); + VERIFY( (test_category<is_class, ConvType>(true)) ); + VERIFY( (test_category<is_class, AbstractClass>(true)) ); + VERIFY( (test_category<is_class, PolymorphicClass>(true)) ); + VERIFY( (test_category<is_class, DerivedPolymorphic>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_class, UnionType>(false)) ); + VERIFY( (test_category<is_class, void>(false)) ); + VERIFY( (test_category<is_class, int>(false)) ); + VERIFY( (test_category<is_class, float>(false)) ); + VERIFY( (test_category<is_class, int[2]>(false)) ); + VERIFY( (test_category<is_class, int*>(false)) ); + VERIFY( (test_category<is_class, int(*)(int)>(false)) ); + VERIFY( (test_category<is_class, float&>(false)) ); + VERIFY( (test_category<is_class, float(&)(float)>(false)) ); + VERIFY( (test_category<is_class, int (ClassType::*)>(false)) ); + VERIFY( (test_category<is_class, int (ClassType::*) (int)>(false)) ); + VERIFY( (test_category<is_class, int (int)>(false)) ); + VERIFY( (test_category<is_class, EnumType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..4d6b10c48 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_compound<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/typedefs.cc new file mode 100644 index 000000000..b5bb750b5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_compound<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/value.cc new file mode 100644 index 000000000..69992f1d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/value.cc @@ -0,0 +1,59 @@ +// 2004-12-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.2 Composite type traits + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_compound; + using namespace __gnu_test; + + VERIFY( (test_category<is_compound, void>(false)) ); + VERIFY( (test_category<is_compound, char>(false)) ); + VERIFY( (test_category<is_compound, signed char>(false)) ); + VERIFY( (test_category<is_compound, unsigned char>(false)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category<is_compound, wchar_t>(false)) ); +#endif + VERIFY( (test_category<is_compound, short>(false)) ); + VERIFY( (test_category<is_compound, unsigned short>(false)) ); + VERIFY( (test_category<is_compound, int>(false)) ); + VERIFY( (test_category<is_compound, unsigned int>(false)) ); + VERIFY( (test_category<is_compound, long>(false)) ); + VERIFY( (test_category<is_compound, unsigned long>(false)) ); + VERIFY( (test_category<is_compound, long long>(false)) ); + VERIFY( (test_category<is_compound, unsigned long long>(false)) ); + VERIFY( (test_category<is_compound, float>(false)) ); + VERIFY( (test_category<is_compound, double>(false)) ); + VERIFY( (test_category<is_compound, long double>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_compound, ClassType>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..2c7d72574 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_const<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/typedefs.cc new file mode 100644 index 000000000..ee4b1817a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_const<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/value.cc new file mode 100644 index 000000000..2f6bd135f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/value.cc @@ -0,0 +1,49 @@ +// 2004-12-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_const; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_property<is_const, const int>(true)) ); + VERIFY( (test_property<is_const, const volatile int>(true)) ); + VERIFY( (test_property<is_const, cClassType>(true)) ); + VERIFY( (test_property<is_const, cvClassType>(true)) ); + + // Negative tests. + VERIFY( (test_property<is_const, int>(false)) ); + VERIFY( (test_property<is_const, volatile int>(false)) ); + VERIFY( (test_property<is_const, ClassType>(false)) ); + VERIFY( (test_property<is_const, vClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..c1481c586 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_convertible<test_type, test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/typedefs.cc new file mode 100644 index 000000000..a75506b84 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-02-23 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_convertible<int, int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/value.cc new file mode 100644 index 000000000..9a677ec11 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/value.cc @@ -0,0 +1,86 @@ +// 2005-02-23 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.6 Relationships between types + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_convertible; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_relationship<is_convertible, int, int>(true)) ); + VERIFY( (test_relationship<is_convertible, int, const int>(true)) ); + VERIFY( (test_relationship<is_convertible, volatile int, const int>(true)) ); + VERIFY( (test_relationship<is_convertible, int, float>(true)) ); + VERIFY( (test_relationship<is_convertible, double, float>(true)) ); + VERIFY( (test_relationship<is_convertible, float, int>(true)) ); + VERIFY( (test_relationship<is_convertible, int*, const int*>(true)) ); + VERIFY( (test_relationship<is_convertible, int*, void*>(true)) ); + VERIFY( (test_relationship<is_convertible, int[4], int*>(true)) ); + VERIFY( (test_relationship<is_convertible, float&, int>(true)) ); + VERIFY( (test_relationship<is_convertible, int, const int&>(true)) ); + VERIFY( (test_relationship<is_convertible, const int&, int>(true)) ); + VERIFY( (test_relationship<is_convertible, float, const int&>(true)) ); + VERIFY( (test_relationship<is_convertible, float, volatile float&>(true)) ); + VERIFY( (test_relationship<is_convertible, int(int), int(*)(int)>(true)) ); + VERIFY( (test_relationship<is_convertible, int(int), int(&)(int)>(true)) ); + VERIFY( (test_relationship<is_convertible, int(&)(int), int(*)(int)>(true)) ); + VERIFY( (test_relationship<is_convertible, EnumType, int>(true)) ); + VERIFY( (test_relationship<is_convertible, ClassType, ClassType>(true)) ); + VERIFY( (test_relationship<is_convertible, DerivedType, ClassType>(true)) ); + VERIFY( (test_relationship<is_convertible, DerivedType*, ClassType*>(true)) ); + VERIFY( (test_relationship<is_convertible, DerivedType&, ClassType&>(true)) ); + + VERIFY( (test_relationship<is_convertible, void, void>(true)) ); + VERIFY( (test_relationship<is_convertible, int, void>(true)) ); + VERIFY( (test_relationship<is_convertible, int[4], void>(true)) ); + + // Negative tests. + VERIFY( (test_relationship<is_convertible, const int*, int*>(false)) ); + VERIFY( (test_relationship<is_convertible, int*, float*>(false)) ); + VERIFY( (test_relationship<is_convertible, const int[4], int*>(false)) ); + VERIFY( (test_relationship<is_convertible, int[4], int[4]>(false)) ); + VERIFY( (test_relationship<is_convertible, const int&, int&>(false)) ); + VERIFY( (test_relationship<is_convertible, float&, int&>(false)) ); + VERIFY( (test_relationship<is_convertible, float, volatile int&>(false)) ); + VERIFY( (test_relationship<is_convertible, int(int), int(int)>(false)) ); + VERIFY( (test_relationship<is_convertible, int(int), int(*)(void)>(false)) ); + VERIFY( (test_relationship<is_convertible, int(*)(int), int(&)(int)>(false)) ); + VERIFY( (test_relationship<is_convertible, int, EnumType>(false)) ); + VERIFY( (test_relationship<is_convertible, int, ClassType>(false)) ); + VERIFY( (test_relationship<is_convertible, ClassType, DerivedType>(false)) ); + VERIFY( (test_relationship<is_convertible, ClassType*, DerivedType*>(false)) ); + VERIFY( (test_relationship<is_convertible, ClassType&, DerivedType&>(false)) ); + + VERIFY( (test_relationship<is_convertible, void, int>(false)) ); + VERIFY( (test_relationship<is_convertible, void, float>(false)) ); + VERIFY( (test_relationship<is_convertible, void, int(*)(int)>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..dc52336a3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_empty<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/typedefs.cc new file mode 100644 index 000000000..876c576c0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-28 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_empty<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/value.cc new file mode 100644 index 000000000..d2980510b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/value.cc @@ -0,0 +1,75 @@ +// 2005-01-28 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +class EmptyClassOne +{ typedef int type; }; + +class EmptyClassTwo +{ static int data; }; + +class EmptyClassThree +{ int f(); }; + +class NonEmptyClassOne +{ int data; }; + +class NonEmptyClassTwo +{ + virtual int f(); + virtual ~NonEmptyClassTwo(); +}; + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_empty; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_empty, ClassType>(true)) ); + VERIFY( (test_category<is_empty, EmptyClassOne>(true)) ); + VERIFY( (test_category<is_empty, EmptyClassTwo>(true)) ); + VERIFY( (test_category<is_empty, EmptyClassThree>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_empty, void>(false)) ); + VERIFY( (test_category<is_empty, float>(false)) ); + VERIFY( (test_category<is_empty, int[4]>(false)) ); + VERIFY( (test_category<is_empty, int*>(false)) ); + VERIFY( (test_category<is_empty, int&>(false)) ); + VERIFY( (test_category<is_empty, int (ClassType::*)>(false)) ); + VERIFY( (test_category<is_empty, EnumType>(false)) ); + VERIFY( (test_category<is_empty, int (int)>(false)) ); + + VERIFY( (test_category<is_empty, AbstractClass>(false)) ); + VERIFY( (test_category<is_empty, NonEmptyClassOne>(false)) ); + VERIFY( (test_category<is_empty, NonEmptyClassTwo>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/24808.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/24808.cc new file mode 100644 index 000000000..b59e826d6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/24808.cc @@ -0,0 +1,40 @@ +// 2005-11-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +// libstdc++/24808 +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_enum; + using namespace __gnu_test; + + VERIFY( (test_category<is_enum, IncompleteClass>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..fd962fabe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_enum<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/typedefs.cc new file mode 100644 index 000000000..4fe26b8a7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-25 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_enum<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/value.cc new file mode 100644 index 000000000..ccacfd94d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/value.cc @@ -0,0 +1,58 @@ +// 2004-12-25 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_enum; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_enum, EnumType>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_enum, void>(false)) ); + VERIFY( (test_category<is_enum, int>(false)) ); + VERIFY( (test_category<is_enum, float>(false)) ); + VERIFY( (test_category<is_enum, int[2]>(false)) ); + VERIFY( (test_category<is_enum, int*>(false)) ); + VERIFY( (test_category<is_enum, int(*)(int)>(false)) ); + VERIFY( (test_category<is_enum, float&>(false)) ); + VERIFY( (test_category<is_enum, float(&)(float)>(false)) ); + VERIFY( (test_category<is_enum, int (ClassType::*)>(false)) ); + VERIFY( (test_category<is_enum, int (ClassType::*) (int)>(false)) ); + VERIFY( (test_category<is_enum, int (int)>(false)) ); + + VERIFY( (test_category<is_enum, ConvType>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_enum, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..0ca78b427 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_floating_point<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/typedefs.cc new file mode 100644 index 000000000..471fdd472 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_floating_point<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/value.cc new file mode 100644 index 000000000..e227cf45b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/value.cc @@ -0,0 +1,60 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_floating_point; + using namespace __gnu_test; + + VERIFY( (test_category<is_floating_point, void>(false)) ); + VERIFY( (test_category<is_floating_point, char>(false)) ); + VERIFY( (test_category<is_floating_point, signed char>(false)) ); + VERIFY( (test_category<is_floating_point, unsigned char>(false)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category<is_floating_point, wchar_t>(false)) ); +#endif + VERIFY( (test_category<is_floating_point, short>(false)) ); + VERIFY( (test_category<is_floating_point, unsigned short>(false)) ); + VERIFY( (test_category<is_floating_point, int>(false)) ); + VERIFY( (test_category<is_floating_point, unsigned int>(false)) ); + VERIFY( (test_category<is_floating_point, long>(false)) ); + VERIFY( (test_category<is_floating_point, unsigned long>(false)) ); + VERIFY( (test_category<is_floating_point, long long>(false)) ); + VERIFY( (test_category<is_floating_point, unsigned long long>(false)) ); + + VERIFY( (test_category<is_floating_point, float>(true)) ); + VERIFY( (test_category<is_floating_point, double>(true)) ); + VERIFY( (test_category<is_floating_point, long double>(true)) ); + + // Sanity check. + VERIFY( (test_category<is_floating_point, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/24808.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/24808.cc new file mode 100644 index 000000000..b57161fa3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/24808.cc @@ -0,0 +1,40 @@ +// 2005-11-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +// libstdc++/24808 +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_function; + using namespace __gnu_test; + + VERIFY( (test_category<is_function, IncompleteClass>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/35637.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/35637.cc new file mode 100644 index 000000000..efd5db402 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/35637.cc @@ -0,0 +1,34 @@ +// { dg-options "-pedantic-errors" } +// { dg-do compile } + +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/functional> + +struct S +{ + void F() const {} +}; + +// libstdc++/35637 +void test01() +{ + std::tr1::function<void (S *)> a(&S::F); +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..d15ac23cf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_function<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/typedefs.cc new file mode 100644 index 000000000..5503e1f88 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-16 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_function<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/value.cc new file mode 100644 index 000000000..30e26d768 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/value.cc @@ -0,0 +1,54 @@ +// 2004-12-16 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_function; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_function, int (int)>(true)) ); + VERIFY( (test_category<is_function, ClassType (ClassType)>(true)) ); + VERIFY( (test_category<is_function, float (int, float, int[], int&)>(true)) ); + VERIFY( (test_category<is_function, int (int, ...)>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_function, int&>(false)) ); + VERIFY( (test_category<is_function, void>(false)) ); + VERIFY( (test_category<is_function, const void>(false)) ); + + VERIFY( (test_category<is_function, AbstractClass>(false)) ); + VERIFY( (test_category<is_function, int(&)(int)>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_function, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..dcecc44d8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_fundamental<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/typedefs.cc new file mode 100644 index 000000000..116afebf8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_fundamental<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/value.cc new file mode 100644 index 000000000..f2e2c4ade --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/value.cc @@ -0,0 +1,59 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.2 Composite type traits + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_fundamental; + using namespace __gnu_test; + + VERIFY( (test_category<is_fundamental, void>(true)) ); + VERIFY( (test_category<is_fundamental, char>(true)) ); + VERIFY( (test_category<is_fundamental, signed char>(true)) ); + VERIFY( (test_category<is_fundamental, unsigned char>(true)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category<is_fundamental, wchar_t>(true)) ); +#endif + VERIFY( (test_category<is_fundamental, short>(true)) ); + VERIFY( (test_category<is_fundamental, unsigned short>(true)) ); + VERIFY( (test_category<is_fundamental, int>(true)) ); + VERIFY( (test_category<is_fundamental, unsigned int>(true)) ); + VERIFY( (test_category<is_fundamental, long>(true)) ); + VERIFY( (test_category<is_fundamental, unsigned long>(true)) ); + VERIFY( (test_category<is_fundamental, long long>(true)) ); + VERIFY( (test_category<is_fundamental, unsigned long long>(true)) ); + VERIFY( (test_category<is_fundamental, float>(true)) ); + VERIFY( (test_category<is_fundamental, double>(true)) ); + VERIFY( (test_category<is_fundamental, long double>(true)) ); + + // Sanity check. + VERIFY( (test_category<is_fundamental, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..f806cf39b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_integral<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/typedefs.cc new file mode 100644 index 000000000..92601999e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_integral<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/value.cc new file mode 100644 index 000000000..9cd4ef801 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/value.cc @@ -0,0 +1,61 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_integral; + using namespace __gnu_test; + + VERIFY( (test_category<is_integral, void>(false)) ); + + VERIFY( (test_category<is_integral, char>(true)) ); + VERIFY( (test_category<is_integral, signed char>(true)) ); + VERIFY( (test_category<is_integral, unsigned char>(true)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category<is_integral, wchar_t>(true)) ); +#endif + VERIFY( (test_category<is_integral, short>(true)) ); + VERIFY( (test_category<is_integral, unsigned short>(true)) ); + VERIFY( (test_category<is_integral, int>(true)) ); + VERIFY( (test_category<is_integral, unsigned int>(true)) ); + VERIFY( (test_category<is_integral, long>(true)) ); + VERIFY( (test_category<is_integral, unsigned long>(true)) ); + VERIFY( (test_category<is_integral, long long>(true)) ); + VERIFY( (test_category<is_integral, unsigned long long>(true)) ); + + VERIFY( (test_category<is_integral, float>(false)) ); + VERIFY( (test_category<is_integral, double>(false)) ); + VERIFY( (test_category<is_integral, long double>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_integral, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..02d470305 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_member_function_pointer<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/typedefs.cc new file mode 100644 index 000000000..39083321e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_member_function_pointer<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/value.cc new file mode 100644 index 000000000..ef6bd9980 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/value.cc @@ -0,0 +1,60 @@ +// 2004-12-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_member_function_pointer; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_member_function_pointer, + int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<is_member_function_pointer, + int (ClassType::*) (int) const>(true)) ); + VERIFY( (test_category<is_member_function_pointer, + int (ClassType::*) (float, ...)>(true)) ); + VERIFY( (test_category<is_member_function_pointer, + ClassType (ClassType::*) (ClassType)>(true)) ); + VERIFY( (test_category<is_member_function_pointer, + float (ClassType::*) (int, float, int[], int&)>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_member_function_pointer, + int (ClassType::*)>(false)) ); + VERIFY( (test_category<is_member_function_pointer, + const int (ClassType::*)>(false)) ); + VERIFY( (test_category<is_member_function_pointer, + ClassType (ClassType::*)>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_member_function_pointer, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..6f92ba189 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_member_object_pointer<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/typedefs.cc new file mode 100644 index 000000000..823a701eb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_member_object_pointer<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/value.cc new file mode 100644 index 000000000..34871e452 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/value.cc @@ -0,0 +1,60 @@ +// 2004-12-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_member_object_pointer; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_member_object_pointer, + int (ClassType::*)>(true)) ); + VERIFY( (test_category<is_member_object_pointer, + const int (ClassType::*)>(true)) ); + VERIFY( (test_category<is_member_object_pointer, + ClassType (ClassType::*)>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_member_object_pointer, + int (ClassType::*) (int)>(false)) ); + VERIFY( (test_category<is_member_object_pointer, + int (ClassType::*) (int) const>(false)) ); + VERIFY( (test_category<is_member_object_pointer, + int (ClassType::*) (float, ...)>(false)) ); + VERIFY( (test_category<is_member_object_pointer, + ClassType (ClassType::*) (ClassType)>(false)) ); + VERIFY( (test_category<is_member_object_pointer, + float (ClassType::*) (int, float, int[], int&)>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_member_object_pointer, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..99d1222c7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_member_pointer<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/typedefs.cc new file mode 100644 index 000000000..1f8df3856 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_member_pointer<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/value.cc new file mode 100644 index 000000000..37db405f1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/value.cc @@ -0,0 +1,55 @@ +// 2004-12-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.2 Composite type traits + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_member_pointer; + using namespace __gnu_test; + + VERIFY( (test_category<is_member_pointer, int (ClassType::*)>(true)) ); + VERIFY( (test_category<is_member_pointer, const int (ClassType::*)>(true)) ); + VERIFY( (test_category<is_member_pointer, ClassType (ClassType::*)>(true)) ); + + VERIFY( (test_category<is_member_pointer, + int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<is_member_pointer, + int (ClassType::*) (int) const>(true)) ); + VERIFY( (test_category<is_member_pointer, + int (ClassType::*) (float, ...)>(true)) ); + VERIFY( (test_category<is_member_pointer, + ClassType (ClassType::*) (ClassType)>(true)) ); + VERIFY( (test_category<is_member_pointer, + float (ClassType::*) (int, float, int[], int&)>(true)) ); + + // Sanity check. + VERIFY( (test_category<is_member_pointer, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/24808.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/24808.cc new file mode 100644 index 000000000..50cd97dd6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/24808.cc @@ -0,0 +1,40 @@ +// 2005-11-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.2 Composite type traits + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +// libstdc++/24808 +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_object; + using namespace __gnu_test; + + VERIFY( (test_category<is_object, IncompleteClass>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..2bb025b5c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_object<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/typedefs.cc new file mode 100644 index 000000000..31c526b3f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-16 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_object<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/value.cc new file mode 100644 index 000000000..a3c954d8d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/value.cc @@ -0,0 +1,49 @@ +// 2004-12-16 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.2 Composite type traits + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_object; + using namespace __gnu_test; + + VERIFY( (test_category<is_object, int (int)>(false)) ); + VERIFY( (test_category<is_object, ClassType (ClassType)>(false)) ); + VERIFY( (test_category<is_object, float (int, float, int[], int&)>(false)) ); + VERIFY( (test_category<is_object, int&>(false)) ); + VERIFY( (test_category<is_object, ClassType&>(false)) ); + VERIFY( (test_category<is_object, int(&)(int)>(false)) ); + VERIFY( (test_category<is_object, void>(false)) ); + VERIFY( (test_category<is_object, const void>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_object, ClassType>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..97de6aa1b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_pod<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/typedefs.cc new file mode 100644 index 000000000..22950c3aa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_pod<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/value.cc new file mode 100644 index 000000000..6cf88c922 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/value.cc @@ -0,0 +1,54 @@ +// 2004-12-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_pod; + using namespace __gnu_test; + + VERIFY( (test_category<is_pod, void>(true)) ); + VERIFY( (test_category<is_pod, int>(true)) ); + VERIFY( (test_category<is_pod, float>(true)) ); + VERIFY( (test_category<is_pod, EnumType>(true)) ); + VERIFY( (test_category<is_pod, int*>(true)) ); + VERIFY( (test_category<is_pod, int(*)(int)>(true)) ); + VERIFY( (test_category<is_pod, int (ClassType::*)>(true)) ); + VERIFY( (test_category<is_pod, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<is_pod, int[2]>(true)) ); + VERIFY( (test_category<is_pod, float[][3]>(true)) ); + VERIFY( (test_category<is_pod, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<is_pod, int*[3]>(true)) ); + VERIFY( (test_category<is_pod, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<is_pod, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<is_pod, int (ClassType::*[][2][3]) (int)>(true)) ); + VERIFY( (test_category<is_pod, ClassType>(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..fd820d557 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_pointer<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/typedefs.cc new file mode 100644 index 000000000..806ee5738 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-12 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_pointer<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/value.cc new file mode 100644 index 000000000..e4a7e3cd2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/value.cc @@ -0,0 +1,44 @@ +// 2004-12-12 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_pointer; + using namespace __gnu_test; + + VERIFY( (test_category<is_pointer, int*>(true)) ); + VERIFY( (test_category<is_pointer, ClassType*>(true)) ); + VERIFY( (test_category<is_pointer, int(*)(int)>(true)) ); + + // Sanity check. + VERIFY( (test_category<is_pointer, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/24809.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/24809.cc new file mode 100644 index 000000000..7c479344a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/24809.cc @@ -0,0 +1,26 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <exception> + +// libstdc++/24809 +static const bool b = std::tr1::is_polymorphic<std::exception>::value; diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..890fa0db3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_polymorphic<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/typedefs.cc new file mode 100644 index 000000000..cb612f99f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-03-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_polymorphic<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/value.cc new file mode 100644 index 000000000..c73c2d6f9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/value.cc @@ -0,0 +1,54 @@ +// 2005-03-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <iostream> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_polymorphic; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_polymorphic, PolymorphicClass>(true)) ); + VERIFY( (test_category<is_polymorphic, DerivedPolymorphic>(true)) ); + VERIFY( (test_category<is_polymorphic, AbstractClass>(true)) ); + VERIFY( (test_category<is_polymorphic, VirtualDestructorClass>(true)) ); + VERIFY( (test_category<is_polymorphic, std::iostream>(true)) ); + VERIFY( (test_category<is_polymorphic, std::streambuf>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_polymorphic, void>(false)) ); + VERIFY( (test_category<is_polymorphic, int (int)>(false)) ); + VERIFY( (test_category<is_polymorphic, int&>(false)) ); + VERIFY( (test_category<is_polymorphic, EnumType>(false)) ); + VERIFY( (test_category<is_polymorphic, ClassType>(false)) ); + VERIFY( (test_category<is_polymorphic, DerivedType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..cf141a364 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_reference<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/typedefs.cc new file mode 100644 index 000000000..e64db083a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-06 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_reference<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/value.cc new file mode 100644 index 000000000..6eae838dd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/value.cc @@ -0,0 +1,44 @@ +// 2004-12-06 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_reference; + using namespace __gnu_test; + + VERIFY( (test_category<is_reference, int&>(true)) ); + VERIFY( (test_category<is_reference, ClassType&>(true)) ); + VERIFY( (test_category<is_reference, int(&)(int)>(true)) ); + + // Sanity check. + VERIFY( (test_category<is_reference, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..8a862e736 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_same<test_type, test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/typedefs.cc new file mode 100644 index 000000000..5adb7a159 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_same<int, int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/value.cc new file mode 100644 index 000000000..b98754ad9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/value.cc @@ -0,0 +1,49 @@ +// 2004-12-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.6 Relationships between types + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_same; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_relationship<is_same, int, int>(true)) ); + VERIFY( (test_relationship<is_same, const int, const int>(true)) ); + VERIFY( (test_relationship<is_same, int&, int&>(true)) ); + VERIFY( (test_relationship<is_same, ClassType, ClassType>(true)) ); + + // Negative tests. + VERIFY( (test_relationship<is_same, void, int>(false)) ); + VERIFY( (test_relationship<is_same, int, const int>(false)) ); + VERIFY( (test_relationship<is_same, int, int&>(false)) ); + VERIFY( (test_relationship<is_same, int, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..bf127cf2d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_scalar<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/typedefs.cc new file mode 100644 index 000000000..2513a20dc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-25 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_scalar<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/value.cc new file mode 100644 index 000000000..567b6d9b2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/value.cc @@ -0,0 +1,48 @@ +// 2004-12-25 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.2 Composite type traits + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_scalar; + using namespace __gnu_test; + + VERIFY( (test_category<is_scalar, int>(true)) ); + VERIFY( (test_category<is_scalar, float>(true)) ); + VERIFY( (test_category<is_scalar, EnumType>(true)) ); + VERIFY( (test_category<is_scalar, int*>(true)) ); + VERIFY( (test_category<is_scalar, int(*)(int)>(true)) ); + VERIFY( (test_category<is_scalar, int (ClassType::*)>(true)) ); + VERIFY( (test_category<is_scalar, int (ClassType::*) (int)>(true)) ); + + // Sanity check. + VERIFY( (test_category<is_scalar, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..db5fbe48d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_signed<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/typedefs.cc new file mode 100644 index 000000000..27f319317 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_signed<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/value.cc new file mode 100644 index 000000000..e19a1eac2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/value.cc @@ -0,0 +1,61 @@ +// 2005-01-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_signed; + using namespace __gnu_test; + + VERIFY( (test_category<is_signed, void>(false)) ); + + VERIFY( (test_category<is_signed, char>(false)) ); + VERIFY( (test_category<is_signed, signed char>(true)) ); + VERIFY( (test_category<is_signed, unsigned char>(false)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category<is_signed, wchar_t>(false)) ); +#endif + VERIFY( (test_category<is_signed, short>(true)) ); + VERIFY( (test_category<is_signed, unsigned short>(false)) ); + VERIFY( (test_category<is_signed, int>(true)) ); + VERIFY( (test_category<is_signed, unsigned int>(false)) ); + VERIFY( (test_category<is_signed, long>(true)) ); + VERIFY( (test_category<is_signed, unsigned long>(false)) ); + VERIFY( (test_category<is_signed, long long>(true)) ); + VERIFY( (test_category<is_signed, unsigned long long>(false)) ); + + VERIFY( (test_category<is_signed, float>(false)) ); + VERIFY( (test_category<is_signed, double>(false)) ); + VERIFY( (test_category<is_signed, long double>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_signed, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..7e9e6ea4f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_union<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/typedefs.cc new file mode 100644 index 000000000..0d352765c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2007-04-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_union<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/value.cc new file mode 100644 index 000000000..90ace4937 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/value.cc @@ -0,0 +1,60 @@ +// 2007-04-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_union; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category<is_union, UnionType>(true)) ); + + // Negative tests. + VERIFY( (test_category<is_union, ClassType>(false)) ); + VERIFY( (test_category<is_union, DerivedType>(false)) ); + VERIFY( (test_category<is_union, ConvType>(false)) ); + VERIFY( (test_category<is_union, AbstractClass>(false)) ); + VERIFY( (test_category<is_union, PolymorphicClass>(false)) ); + VERIFY( (test_category<is_union, DerivedPolymorphic>(false)) ); + VERIFY( (test_category<is_union, void>(false)) ); + VERIFY( (test_category<is_union, int>(false)) ); + VERIFY( (test_category<is_union, float>(false)) ); + VERIFY( (test_category<is_union, int[2]>(false)) ); + VERIFY( (test_category<is_union, int*>(false)) ); + VERIFY( (test_category<is_union, int(*)(int)>(false)) ); + VERIFY( (test_category<is_union, float&>(false)) ); + VERIFY( (test_category<is_union, float(&)(float)>(false)) ); + VERIFY( (test_category<is_union, int (ClassType::*)>(false)) ); + VERIFY( (test_category<is_union, int (ClassType::*) (int)>(false)) ); + VERIFY( (test_category<is_union, int (int)>(false)) ); + VERIFY( (test_category<is_union, EnumType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..da382cdbe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_unsigned<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/typedefs.cc new file mode 100644 index 000000000..381a15d59 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_unsigned<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/value.cc new file mode 100644 index 000000000..991d9cf6d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/value.cc @@ -0,0 +1,61 @@ +// 2005-01-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_unsigned; + using namespace __gnu_test; + + VERIFY( (test_category<is_unsigned, void>(false)) ); + + VERIFY( (test_category<is_unsigned, char>(false)) ); + VERIFY( (test_category<is_unsigned, signed char>(false)) ); + VERIFY( (test_category<is_unsigned, unsigned char>(true)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category<is_unsigned, wchar_t>(false)) ); +#endif + VERIFY( (test_category<is_unsigned, short>(false)) ); + VERIFY( (test_category<is_unsigned, unsigned short>(true)) ); + VERIFY( (test_category<is_unsigned, int>(false)) ); + VERIFY( (test_category<is_unsigned, unsigned int>(true)) ); + VERIFY( (test_category<is_unsigned, long>(false)) ); + VERIFY( (test_category<is_unsigned, unsigned long>(true)) ); + VERIFY( (test_category<is_unsigned, long long>(false)) ); + VERIFY( (test_category<is_unsigned, unsigned long long>(true)) ); + + VERIFY( (test_category<is_unsigned, float>(false)) ); + VERIFY( (test_category<is_unsigned, double>(false)) ); + VERIFY( (test_category<is_unsigned, long double>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_unsigned, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..3dcb5da73 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_void<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/typedefs.cc new file mode 100644 index 000000000..c3c005036 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_void<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/value.cc new file mode 100644 index 000000000..76676c322 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/value.cc @@ -0,0 +1,60 @@ +// 2004-12-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.1 Primary type categories + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_void; + using namespace __gnu_test; + + VERIFY( (test_category<is_void, void>(true)) ); + + VERIFY( (test_category<is_void, char>(false)) ); + VERIFY( (test_category<is_void, signed char>(false)) ); + VERIFY( (test_category<is_void, unsigned char>(false)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category<is_void, wchar_t>(false)) ); +#endif + VERIFY( (test_category<is_void, short>(false)) ); + VERIFY( (test_category<is_void, unsigned short>(false)) ); + VERIFY( (test_category<is_void, int>(false)) ); + VERIFY( (test_category<is_void, unsigned int>(false)) ); + VERIFY( (test_category<is_void, long>(false)) ); + VERIFY( (test_category<is_void, unsigned long>(false)) ); + VERIFY( (test_category<is_void, long long>(false)) ); + VERIFY( (test_category<is_void, unsigned long long>(false)) ); + VERIFY( (test_category<is_void, float>(false)) ); + VERIFY( (test_category<is_void, double>(false)) ); + VERIFY( (test_category<is_void, long double>(false)) ); + + // Sanity check. + VERIFY( (test_category<is_void, ClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..d09b08b7c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_volatile<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/typedefs.cc new file mode 100644 index 000000000..b52b5dae5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_volatile<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/value.cc new file mode 100644 index 000000000..3453c6e0f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/value.cc @@ -0,0 +1,49 @@ +// 2004-12-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_volatile; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_property<is_volatile, volatile int>(true)) ); + VERIFY( (test_property<is_volatile, const volatile int>(true)) ); + VERIFY( (test_property<is_volatile, vClassType>(true)) ); + VERIFY( (test_property<is_volatile, cvClassType>(true)) ); + + // Negative tests. + VERIFY( (test_property<is_volatile, int>(false)) ); + VERIFY( (test_property<is_volatile, const int>(false)) ); + VERIFY( (test_property<is_volatile, ClassType>(false)) ); + VERIFY( (test_property<is_volatile, cClassType>(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..f3aa7f658 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct rank<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/typedefs.cc new file mode 100644 index 000000000..74982f1e6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::rank<int> test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/value.cc new file mode 100644 index 000000000..ff001ec96 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/value.cc @@ -0,0 +1,46 @@ +// 2004-12-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.5.3 Type properties + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::rank; + using namespace __gnu_test; + + VERIFY( (test_property<rank, int>(0)) ); + VERIFY( (test_property<rank, int[2]>(1)) ); + VERIFY( (test_property<rank, int[][4]>(2)) ); + VERIFY( (test_property<rank, int[2][2][4][4][6][6]>(6)) ); + VERIFY( (test_property<rank, ClassType>(0)) ); + VERIFY( (test_property<rank, ClassType[2]>(1)) ); + VERIFY( (test_property<rank, ClassType[][4]>(2)) ); + VERIFY( (test_property<rank, ClassType[2][2][4][4][6][6]>(6)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..0dc8510f0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_all_extents<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/value.cc new file mode 100644 index 000000000..eb97b7274 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/value.cc @@ -0,0 +1,53 @@ +// 2004-12-09 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.3 Array modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_all_extents; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<remove_all_extents<int>::type, int>::value) ); + VERIFY( (is_same<remove_all_extents<int[2]>::type, int>::value) ); + VERIFY( (is_same<remove_all_extents<int[2][3]>::type, int>::value) ); + VERIFY( (is_same<remove_all_extents<int[][3]>::type, int>::value) ); + VERIFY( (is_same<remove_all_extents<const int[2][3]>::type, + const int>::value) ); + VERIFY( (is_same<remove_all_extents<ClassType>::type, ClassType>::value) ); + VERIFY( (is_same<remove_all_extents<ClassType[2]>::type, ClassType>::value) ); + VERIFY( (is_same<remove_all_extents<ClassType[2][3]>::type, + ClassType>::value) ); + VERIFY( (is_same<remove_all_extents<ClassType[][3]>::type, + ClassType>::value) ); + VERIFY( (is_same<remove_all_extents<const ClassType[2][3]>::type, + const ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..87fffe1bd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_const<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/value.cc new file mode 100644 index 000000000..f3ad1502e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/value.cc @@ -0,0 +1,46 @@ +// 2004-12-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.1 Const-volatile modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_const; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<remove_const<const volatile int>::type, + volatile int>::value) ); + VERIFY( (is_same<remove_const<const int*>::type, const int*>::value) ); + VERIFY( (is_same<remove_const<const volatile ClassType>::type, + volatile ClassType>::value) ); + VERIFY( (is_same<remove_const<const ClassType*>::type, + const ClassType*>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..50a3dc551 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_cv<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/value.cc new file mode 100644 index 000000000..5e9f397cf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/value.cc @@ -0,0 +1,46 @@ +// 2004-12-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.1 Const-volatile modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_cv; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<remove_cv<const volatile int>::type, int>::value) ); + VERIFY( (is_same<remove_cv<const volatile int*>::type, + const volatile int*>::value) ); + VERIFY( (is_same<remove_cv<const volatile ClassType>::type, + ClassType>::value) ); + VERIFY( (is_same<remove_cv<const volatile ClassType*>::type, + const volatile ClassType*>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..dd15bcbe4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_extent<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/value.cc new file mode 100644 index 000000000..322aa2d89 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/value.cc @@ -0,0 +1,52 @@ +// 2004-12-09 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.3 Array modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_extent; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<remove_extent<int>::type, int>::value) ); + VERIFY( (is_same<remove_extent<int[2]>::type, int>::value) ); + VERIFY( (is_same<remove_extent<int[2][3]>::type, int[3]>::value) ); + VERIFY( (is_same<remove_extent<int[][3]>::type, int[3]>::value) ); + VERIFY( (is_same<remove_extent<const int[2]>::type, const int>::value) ); + VERIFY( (is_same<remove_extent<ClassType>::type, ClassType>::value) ); + VERIFY( (is_same<remove_extent<ClassType[2]>::type, ClassType>::value) ); + VERIFY( (is_same<remove_extent<ClassType[2][3]>::type, + ClassType[3]>::value) ); + VERIFY( (is_same<remove_extent<ClassType[][3]>::type, + ClassType[3]>::value) ); + VERIFY( (is_same<remove_extent<const ClassType[2]>::type, + const ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..aa19e24c2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_pointer<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/value.cc new file mode 100644 index 000000000..c6cf05332 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/value.cc @@ -0,0 +1,45 @@ +// 2004-12-12 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.2 Reference modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_pointer; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<remove_pointer<int*>::type, int>::value) ); + VERIFY( (is_same<remove_pointer<int>::type, int>::value) ); + VERIFY( (is_same<remove_pointer<const int*>::type, const int>::value) ); + VERIFY( (is_same<remove_pointer<int**>::type, int*>::value) ); + VERIFY( (is_same<remove_pointer<ClassType*>::type, ClassType>::value) ); + VERIFY( (is_same<remove_pointer<ClassType>::type, ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..778c75b57 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_reference<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/value.cc new file mode 100644 index 000000000..8ad89b2bb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/value.cc @@ -0,0 +1,45 @@ +// 2004-12-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.2 Reference modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_reference; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<remove_reference<int&>::type, int>::value) ); + VERIFY( (is_same<remove_reference<int>::type, int>::value) ); + VERIFY( (is_same<remove_reference<const int&>::type, const int>::value) ); + VERIFY( (is_same<remove_reference<int*&>::type, int*>::value) ); + VERIFY( (is_same<remove_reference<ClassType&>::type, ClassType>::value) ); + VERIFY( (is_same<remove_reference<ClassType>::type, ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..4f39bd13d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik <bkoz@redhat.com> + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include <tr1/type_traits> + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_volatile<test_type>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/value.cc new file mode 100644 index 000000000..48d9876a0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/value.cc @@ -0,0 +1,47 @@ +// 2004-12-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 4.7.1 Const-volatile modifications + +#include <tr1/type_traits> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_volatile; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same<remove_volatile<const volatile int>::type, + const int>::value) ); + VERIFY( (is_same<remove_volatile<volatile int*>::type, + volatile int*>::value) ); + VERIFY( (is_same<remove_volatile<const volatile ClassType>::type, + const ClassType>::value) ); + VERIFY( (is_same<remove_volatile<volatile ClassType*>::type, + volatile ClassType*>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/headers/random/synopsis.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/headers/random/synopsis.cc new file mode 100644 index 000000000..e2c8a7313 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/headers/random/synopsis.cc @@ -0,0 +1,96 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/random> + +namespace std { +namespace tr1 { + + // [5.1.3] Class template variate_generator + template<class UniformRandomNumberGenerator, class Distribution> + class variate_generator; + + // [5.1.4.1] Class template linear_congruential + template<class IntType, IntType a, IntType c, IntType m> + class linear_congruential; + + // [5.1.4.2] Class template mersenne_twister + template<class UIntType, int w, int n, int m, int r, + UIntType a, int u, int s, UIntType b, int t, UIntType c, int l> + class mersenne_twister; + + // [5.1.4.3] Class template subtract_with_carry + template<class IntType, IntType m, int s, int r> + class subtract_with_carry; + + // [5.1.4.4] Class template subtract_with_carry_01 + template<class RealType, int w, int s, int r> + class subtract_with_carry_01; + + // [5.1.4.5] Class template discard_block + template<class UniformRandomNumberGenerator, int p, int r> + class discard_block; + + // [5.1.4.6] Class template xor_combine + template<class UniformRandomNumberGenerator1, int s1, + class UniformRandomNumberGenerator2, int s2> + class xor_combine; + + // [5.1.6] Class random_device + class random_device; + + // [5.1.7.1] Class template uniform_int + template<class IntType> + class uniform_int; + + // [5.1.7.2] Class bernoulli_distribution + class bernoulli_distribution; + + // [5.1.7.3] Class template geometric_distribution + template<class IntType, class RealType> + class geometric_distribution; + + // [5.1.7.4] Class template poisson_distribution + template<class IntType, class RealType> + class poisson_distribution; + + // [5.1.7.5] Class template binomial_distribution + template<class IntType, class RealType> + class binomial_distribution; + + // [5.1.7.6] Class template uniform_real + template<class RealType> + class uniform_real; + + // [5.1.7.7] Class template exponential_distribution + template<class RealType> + class exponential_distribution; + + // [5.1.7.8] Class template normal_distribution + template<class RealType> + class normal_distribution; + + // [5.1.7.9] Class template gamma_distribution + template<class RealType> + class gamma_distribution; + +} // namespace tr1 +} // namespace std diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/headers/random/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/headers/random/types_std_tr1.cc new file mode 100644 index 000000000..8d76259c9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/headers/random/types_std_tr1.cc @@ -0,0 +1,26 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/random> + +namespace gnu +{ + using std::tr1::random_device; + using std::tr1::bernoulli_distribution; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/bernoulli_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/bernoulli_distribution/requirements/typedefs.cc new file mode 100644 index 000000000..9fe0122ed --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/bernoulli_distribution/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-06-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.2 Class template bernoulli_distribution [tr.rand.dist.bern] +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef bernoulli_distribution test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/binomial_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/binomial_distribution/requirements/typedefs.cc new file mode 100644 index 000000000..af4537aee --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/binomial_distribution/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-08-18 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.5 Class template binomial_distribution [tr.rand.dist.bin] +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef binomial_distribution<int, double> test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/equal.cc new file mode 100644 index 000000000..146b502af --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/equal.cc @@ -0,0 +1,52 @@ +// 2006-06-19 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.5 class template discard_block [tr.rand.eng.disc] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + discard_block + < + subtract_with_carry<long, (1 << 24), 10, 24>, + 389, 24 + > u, v; + + VERIFY( u == v ); + + for (int i = 0; i < 100; ++i) + { + u(); + v(); + } + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/not_equal.cc new file mode 100644 index 000000000..0e3cb0fa5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/not_equal.cc @@ -0,0 +1,51 @@ +// 2006-06-19 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.5 class template discard_block [tr.rand.eng.disc] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + discard_block + < + subtract_with_carry<long, (1 << 24), 10, 24>, + 389, 24 + > u(1); + + discard_block + < + subtract_with_carry<long, (1 << 24), 10, 24>, + 389, 24 + > v(2); + + VERIFY( u != v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/serialize.cc new file mode 100644 index 000000000..716a1d839 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/operators/serialize.cc @@ -0,0 +1,54 @@ +// 2006-06-19 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.5 class template discard_block [tr.rand.eng.disc] +// 5.1.1 Table 16 + +#include <sstream> +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::discard_block; + using std::tr1::subtract_with_carry; + + std::stringstream str; + discard_block + < + subtract_with_carry<long, (1 << 24), 10, 24>, + 389, 24 + > u, v; + + u(); // advance + str << u; + + VERIFY( u != v ); + + str >> v; + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/constants.cc new file mode 100644 index 000000000..be04a2c90 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/constants.cc @@ -0,0 +1,37 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com> +// +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/random> + +void test01() +{ + std::tr1::ranlux3 db; + + const void* p = &db.block_size; + p = &db.used_block; + p = p; // Suppress unused warning. +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/typedefs.cc new file mode 100644 index 000000000..6e138083f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/discard_block/requirements/typedefs.cc @@ -0,0 +1,39 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.5 Class template linear_congruential +// 5.1.1 [1] Table 15 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef discard_block + < + subtract_with_carry<long, (1 << 24), 10, 24>, + 389, 24 + > test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/exponential_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/exponential_distribution/requirements/typedefs.cc new file mode 100644 index 000000000..72dfaf5d5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/exponential_distribution/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-06-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.7 Class template exponential_distribution [tr.rand.dist.exp] +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef exponential_distribution<double> test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/gamma_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/gamma_distribution/requirements/typedefs.cc new file mode 100644 index 000000000..94da754d7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/gamma_distribution/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-07-06 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.9 Class template gamma_distribution [tr.rand.dist.gamma] +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef gamma_distribution<double> test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/geometric_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/geometric_distribution/requirements/typedefs.cc new file mode 100644 index 000000000..b7d317e63 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/geometric_distribution/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-06-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.3 Class template geometric_distribution [tr.rand.dist.geom] +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef geometric_distribution<int, double> test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/default.cc new file mode 100644 index 000000000..351b7b3f8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/default.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.4.1 [4] + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + linear_congruential<unsigned long, 48271, 0, 2147483647> x; + VERIFY( x.min() == 1 ); + VERIFY( x.max() == 2147483647-1 ); + VERIFY( x() == 48271 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc new file mode 100644 index 000000000..75181ff9c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/gen1.cc @@ -0,0 +1,51 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.1 Table 16 line 3 template ctor(gen) + +// { dg-require-time "" } + +#include <ctime> +#include <tr1/random> +#include <testsuite_hooks.h> + +// a not untypical initialization function +unsigned long +gen() +{ + return std::time(0); +} + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + linear_congruential<unsigned long, 48271, 0, 2147483647> x(gen); + VERIFY( x.min() == 1 ); + VERIFY( x.max() == 2147483647-1 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed1.cc new file mode 100644 index 000000000..0e87ec5ba --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed1.cc @@ -0,0 +1,39 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.1 [4] para 2 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::tr1; + + unsigned long seed = 2; + linear_congruential<unsigned long, 48271, 0, 2147483647> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed2.cc new file mode 100644 index 000000000..7e8e2841c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/cons/seed2.cc @@ -0,0 +1,39 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.1 [4] para 2 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::tr1; + + double seed = 2.0; + linear_congruential<unsigned long, 48271, 0, 2147483647> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/equal.cc new file mode 100644 index 000000000..8ab90388c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/equal.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.1 Class template linear_congruential +// 5.1 [3] Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::minstd_rand0 a; + std::tr1::minstd_rand0 b; + std::tr1::minstd_rand0 c(120); + + VERIFY( a == b ); + VERIFY( !(a == c) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/not_equal.cc new file mode 100644 index 000000000..325f530ea --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/not_equal.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.1 Class template linear_congruential +// 5.1 [3] Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::minstd_rand0 a; + std::tr1::minstd_rand0 b; + std::tr1::minstd_rand0 c(120); + + VERIFY( !(a != b) ); + VERIFY( a != c ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/serialize.cc new file mode 100644 index 000000000..6abdc1ed6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/operators/serialize.cc @@ -0,0 +1,49 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.1 Class template linear_congruential +// 5.1 [3] Table 16 + +#include <sstream> +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::stringstream str; + std::tr1::minstd_rand0 a; + std::tr1::minstd_rand0 b; + + a(); // advance + str << a; + + VERIFY( a != b ); + + str >> b; + VERIFY( a == b ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/constants.cc new file mode 100644 index 000000000..bdc366ea7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/constants.cc @@ -0,0 +1,38 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com> +// +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/random> + +void test01() +{ + std::tr1::minstd_rand0 lc; + + const void* p = &lc.multiplier; + p = &lc.increment; + p = &lc.modulus; + p = p; // Suppress unused warning. +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc new file mode 100644 index 000000000..a8cdf2557 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc @@ -0,0 +1,31 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// { dg-do compile } +// { dg-options "-D_GLIBCXX_CONCEPT_CHECKS" } +// { dg-error "not a valid type" "" { target *-*-* } 30 } +// { dg-error "invalid type" "" { target *-*-* } 30 } + +// 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong] +// 5.1.4.1 [4] + +#include <tr1/random> + +std::tr1::linear_congruential<double, 48271, 0, 2147483647> x; + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/typedefs.cc new file mode 100644 index 000000000..5b5f62d6b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/typedefs.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.1 Class template linear_congruential +// 5.1.1 [1] Table 15 + +#include <tr1/random> + +void +test01() +{ + typedef std::tr1::linear_congruential<unsigned long, 2, 0, 4> test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/default.cc new file mode 100644 index 000000000..7df19f113 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/default.cc @@ -0,0 +1,47 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 line 1 default ctor + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + using namespace std::tr1; + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> x; + + VERIFY( x.min() == 0 ); + VERIFY( x.max() == 4294967295ul ); + VERIFY( x() == 3499211612ul ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc new file mode 100644 index 000000000..8ca829b8d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/gen1.cc @@ -0,0 +1,56 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 line 3 Gen ctor + +// { dg-require-time "" } + +#include <ctime> +#include <tr1/random> +#include <testsuite_hooks.h> + +// a not untypical initialization function +unsigned long +gen() +{ + return std::time(0); +} + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> x(gen); + + VERIFY( x.min() == 0 ); + VERIFY( x.max() == 4294967295ul ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed1.cc new file mode 100644 index 000000000..4ed309204 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed1.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 line 2 seed ctor + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::tr1; + + unsigned long seed = 2; + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed2.cc new file mode 100644 index 000000000..1e24b48f2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/cons/seed2.cc @@ -0,0 +1,44 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 line 2 seed ctor +// 5.1.1 (4) point 2: Gen is a fundamental type. + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::tr1; + + double seed = 2.0; + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/equal.cc new file mode 100644 index 000000000..6a6a2a571 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/equal.cc @@ -0,0 +1,52 @@ +// 2006-06-06 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> u, v; + + VERIFY( u == v ); + + for (int i = 0; i < 100; ++i) + { + u(); + v(); + } + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/not_equal.cc new file mode 100644 index 000000000..7d200e068 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/not_equal.cc @@ -0,0 +1,51 @@ +// 2006-06-06 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> u(1); + + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> v(2); + + VERIFY( u != v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/serialize.cc new file mode 100644 index 000000000..335d23938 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/operators/serialize.cc @@ -0,0 +1,53 @@ +// 2006-06-06 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.2 class template mersenne_twister [tr.rand.eng.mers] +// 5.1.1 Table 16 + +#include <sstream> +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::mersenne_twister; + + std::stringstream str; + mersenne_twister< + unsigned long, 32, 624, 397, 31, + 0x9908b0dful, 11, 7, + 0x9d2c5680ul, 15, + 0xefc60000ul, 18> u, v; + + u(); // advance + str << u; + + VERIFY( u != v ); + + str >> v; + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/constants.cc new file mode 100644 index 000000000..52fd3a50b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/constants.cc @@ -0,0 +1,46 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com> +// +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/random> + +void test01() +{ + std::tr1::mt19937 mt; + + const void* p = &mt.word_size; + p = &mt.state_size; + p = &mt.shift_size; + p = &mt.mask_bits; + p = &mt.parameter_a; + p = &mt.output_u; + p = &mt.output_s; + p = &mt.output_b; + p = &mt.output_t; + p = &mt.output_c; + p = &mt.output_l; + p = p; // Suppress unused warning. +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/typedefs.cc new file mode 100644 index 000000000..dddb79d27 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mersenne_twister/requirements/typedefs.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.2 Class template mersenne_twister +// 5.1.1 [1] Table 15 + +#include <tr1/random> + +void +test01() +{ + typedef std::tr1::mersenne_twister<unsigned long, + 32, 624, 397, 31, + 0x9908b0df, 11, 7, + 0x9d2c5680, 15, + 0xefc60000, 18> test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand.cc new file mode 100644 index 000000000..c75e164df --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [1] + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::minstd_rand a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 399268537 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand0.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand0.cc new file mode 100644 index 000000000..8438ee7e1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/minstd_rand0.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [1] + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::minstd_rand0 a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 1043618065 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mt19937.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mt19937.cc new file mode 100644 index 000000000..f3fb05323 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/mt19937.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [2] + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::mt19937 a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 4123659995ul ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/normal_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/normal_distribution/requirements/typedefs.cc new file mode 100644 index 000000000..8c189eef7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/normal_distribution/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-06-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.8 Class template normal_distribution [tr.rand.dist.norm] +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef normal_distribution<double> test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/poisson_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/poisson_distribution/requirements/typedefs.cc new file mode 100644 index 000000000..79d716b59 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/poisson_distribution/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-08-13 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.4 Class template poisson_distribution [tr.rand.dist.pois] +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef poisson_distribution<int, double> test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/cons/default.cc new file mode 100644 index 000000000..319113afd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/cons/default.cc @@ -0,0 +1,42 @@ +// 2006-06-09 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.6 class random_device [tr.rand.device] +// 5.1.1 Table 15 default ctor + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + using namespace std::tr1; + random_device x; + + VERIFY( x.min() == std::numeric_limits<random_device::result_type>::min() ); + VERIFY( x.max() == std::numeric_limits<random_device::result_type>::max() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/cons/token.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/cons/token.cc new file mode 100644 index 000000000..1e3c97e75 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/cons/token.cc @@ -0,0 +1,46 @@ +// 2006-06-09 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.6 class random_device [tr.rand.device] +// 5.1.6, p3 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + +#ifdef _GLIBCXX_USE_RANDOM_TR1 + random_device x("/dev/random"); +#else + random_device x("0"); +#endif + + VERIFY( x.min() == std::numeric_limits<random_device::result_type>::min() ); + VERIFY( x.max() == std::numeric_limits<random_device::result_type>::max() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/requirements/typedefs.cc new file mode 100644 index 000000000..cc1f63439 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/random_device/requirements/typedefs.cc @@ -0,0 +1,31 @@ +// { dg-do compile } +// +// 2006-06-09 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.6 class random_device [tr.rand.device] + +#include <tr1/random> + +void +test01() +{ + typedef std::tr1::random_device test_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3.cc new file mode 100644 index 000000000..7e436b820 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3.cc @@ -0,0 +1,43 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [3] + +#include <iostream> +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::ranlux3 a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 5957620 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc new file mode 100644 index 000000000..388e79efe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc @@ -0,0 +1,47 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [3] + +#include <iostream> +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::ranlux3_01 a; + for (int i = 0; i < 9999; ++i) + a(); + +#if _GLIBCXX_USE_C99_MATH_TR1 + VERIFY( a() == 5957620 * std::tr1::ldexp(float(1), -24) ); +#else + VERIFY( a() == 5957620 * std::pow(float(2), -24) ); +#endif +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4.cc new file mode 100644 index 000000000..6c61429dc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [3] + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::ranlux4 a; + for (int i = 0; i < 9999; ++i) + a(); + + VERIFY( a() == 8587295 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc new file mode 100644 index 000000000..8a5e3ff3b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc @@ -0,0 +1,46 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.5 Engines with predefined parameters +// 5.1.5 [3] + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::ranlux4_01 a; + for (int i = 0; i < 9999; ++i) + a(); + +#if _GLIBCXX_USE_C99_MATH_TR1 + VERIFY( a() == 8587295 * std::tr1::ldexp(float(1), -24) ); +#else + VERIFY( a() == 8587295 * std::pow(float(2), -24) ); +#endif +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/default.cc new file mode 100644 index 000000000..5e439e7ce --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/default.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 line 1 default ctor + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> x; + VERIFY( x.min() == 0 ); + VERIFY( x.max() == ((1UL << 24) - 1) ); + VERIFY( x() == 15039276 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc new file mode 100644 index 000000000..9f33e765b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/gen1.cc @@ -0,0 +1,51 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 line 3 Gen ctor + +// { dg-require-time "" } + +#include <ctime> +#include <tr1/random> +#include <testsuite_hooks.h> + +// a not untypical initialization function +unsigned long +gen() +{ + return std::time(0); +} + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> x(gen); + VERIFY( x.min() == 0 ); + VERIFY( x.max() == ((1UL << 24) - 1) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed1.cc new file mode 100644 index 000000000..217e1ab54 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed1.cc @@ -0,0 +1,39 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 line 2 seed ctor + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::tr1; + + unsigned long seed = 2; + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed2.cc new file mode 100644 index 000000000..08e672ab6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/cons/seed2.cc @@ -0,0 +1,40 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 line 2 seed ctor +// 5.1.1 (4) point 2: Gen is a fundamental type. + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::tr1; + + double seed = 2.0; + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/equal.cc new file mode 100644 index 000000000..11536132a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/equal.cc @@ -0,0 +1,49 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> u; + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> v; + + VERIFY( u == v ); + + for (int i = 0; i < 100; ++i) + { + u(); + v(); + } + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/not_equal.cc new file mode 100644 index 000000000..535701940 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/not_equal.cc @@ -0,0 +1,42 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> u(1); + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> v(2); + + VERIFY( u != v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/serialize.cc new file mode 100644 index 000000000..6b52a1888 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/operators/serialize.cc @@ -0,0 +1,50 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.3 class template subtract_with_carry [tr.rand.eng.sub] +// 5.1.1 Table 16 + +#include <sstream> +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::subtract_with_carry; + + std::stringstream str; + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> u; + subtract_with_carry<unsigned long, (1UL << 24), 10, 24> v; + + u(); // advance + str << u; + + VERIFY( u != v ); + + str >> v; + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/constants.cc new file mode 100644 index 000000000..a34938ee0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/constants.cc @@ -0,0 +1,38 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com> +// +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/random> + +void test01() +{ + std::tr1::subtract_with_carry<unsigned long, (1UL << 24), 10, 24> swc; + + const void* p = &swc.modulus; + p = &swc.long_lag; + p = &swc.short_lag; + p = p; // Suppress unused warning. +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/typedefs.cc new file mode 100644 index 000000000..445083446 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/requirements/typedefs.cc @@ -0,0 +1,34 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.3 Class template subtract_with_carry +// 5.1.1 [1] Table 15 + +#include <tr1/random> + +void +test01() +{ + typedef std::tr1::subtract_with_carry<unsigned long, (1UL << 24), 10, 24> + test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/default.cc new file mode 100644 index 000000000..a094c5521 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/default.cc @@ -0,0 +1,47 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1] +// 5.1.1 Table 16 line 1 default ctor + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry_01<float, 24, 10, 24> x; + VERIFY( x.min() == 0.0 ); + VERIFY( x.max() == 1.0 ); + +#if _GLIBCXX_USE_C99_MATH_TR1 + VERIFY( x() == 15039276 * std::tr1::ldexp(float(1), -24) ); +#else + VERIFY( x() == 15039276 * std::pow(float(2), -24) ); +#endif +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc new file mode 100644 index 000000000..138a1ef2c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/gen1.cc @@ -0,0 +1,51 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1] +// 5.1.1 Table 16 line 3 Gen ctor + +// { dg-require-time "" } + +#include <ctime> +#include <tr1/random> +#include <testsuite_hooks.h> + +// a not untypical initialization function +unsigned long +gen() +{ + return std::time(0); +} + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry_01<float, 24, 10, 24> x(gen); + VERIFY( x.min() == 0.0 ); + VERIFY( x.max() == 1.0 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/seed1.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/seed1.cc new file mode 100644 index 000000000..b7f12d4bd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/seed1.cc @@ -0,0 +1,39 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1] +// 5.1.1 Table 16 line 2 seed ctor + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::tr1; + + unsigned long seed = 2; + subtract_with_carry_01<float, 24, 10, 24> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/seed2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/seed2.cc new file mode 100644 index 000000000..964bffe41 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/cons/seed2.cc @@ -0,0 +1,40 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1] +// 5.1.1 Table 16 line 2 seed ctor +// 5.1.1 (4) point 2: Gen is a fundamental type. + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::tr1; + + double seed = 2.0; + subtract_with_carry_01<float, 24, 10, 24> x(seed); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/equal.cc new file mode 100644 index 000000000..062d3fe56 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/equal.cc @@ -0,0 +1,49 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry_01<float, 24, 10, 24> u; + subtract_with_carry_01<float, 24, 10, 24> v; + + VERIFY( u == v ); + + for (int i = 0; i < 100; ++i) + { + u(); + v(); + } + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/not_equal.cc new file mode 100644 index 000000000..25b4b4efe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/not_equal.cc @@ -0,0 +1,42 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + subtract_with_carry_01<float, 24, 10, 24> u(1); + subtract_with_carry_01<float, 24, 10, 24> v(2); + + VERIFY( u != v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/serialize.cc new file mode 100644 index 000000000..5ea668a99 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/operators/serialize.cc @@ -0,0 +1,50 @@ +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.4 class template subtract_with_carry_01 [tr.rand.eng.sub1] +// 5.1.1 Table 16 + +#include <sstream> +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::subtract_with_carry_01; + + std::stringstream str; + subtract_with_carry_01<float, 24, 10, 24> u; + subtract_with_carry_01<float, 24, 10, 24> v; + + u(); // advance + str << u; + + VERIFY( u != v ); + + str >> v; + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/constants.cc new file mode 100644 index 000000000..a0a360d73 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/constants.cc @@ -0,0 +1,38 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com> +// +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/random> + +void test01() +{ + std::tr1::ranlux_base_01 swc_01; + + const void* p = &swc_01.word_size; + p = &swc_01.long_lag; + p = &swc_01.short_lag; + p = p; // Suppress unused warning. +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/typedefs.cc new file mode 100644 index 000000000..7f49a918e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/subtract_with_carry_01/requirements/typedefs.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// +// 2006-08-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.4 Class template subtract_with_carry_01 +// 5.1.1 [1] Table 15 + +#include <tr1/random> + +void +test01() +{ + typedef std::tr1::subtract_with_carry_01<float, 24, 10, 24> test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/33128.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/33128.cc new file mode 100644 index 000000000..715f0b78e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/33128.cc @@ -0,0 +1,42 @@ +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.1 Class template uniform_int +// 5.1.1 [7] Table 17 + +#include <tr1/random> +#include <testsuite_hooks.h> + +// libstdc++/33128 +void test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::mt19937 rng; + std::tr1::uniform_int<> six(1,6); + std::tr1::variate_generator<std::tr1::mt19937, std::tr1::uniform_int<> > + die(rng, six); + + int val = die(); + VERIFY( val >= 1 && val <= 6 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/default.cc new file mode 100644 index 000000000..ede56698e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/default.cc @@ -0,0 +1,41 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.1 class template uniform_int +// 5.1.7.1 [2] constructors and member functions + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + uniform_int<int> u; + VERIFY( u.min() == 0 ); + VERIFY( u.max() == 9 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range.cc new file mode 100644 index 000000000..837de2a85 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/cons/range.cc @@ -0,0 +1,41 @@ +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.1 class template uniform_int +// 5.1.7.1 [2] constructors and member functions + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + uniform_int<int> u(1, 20); + VERIFY( u.min() == 1 ); + VERIFY( u.max() == 20 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/requirements/typedefs.cc new file mode 100644 index 000000000..b1a35b793 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.1 Class template uniform_int +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef uniform_int<int> test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_real/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_real/requirements/typedefs.cc new file mode 100644 index 000000000..40ce7a1d9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_real/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.7.6 Class template uniform_real [tr.rand.dist.runif] +// 5.1.1 [7] Table 17 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef uniform_real<double> test_type; + + typedef test_type::input_type input_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/37986.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/37986.cc new file mode 100644 index 000000000..b32d9daea --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/37986.cc @@ -0,0 +1,48 @@ +// { dg-do compile } +// +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.3 class template variate_generator + +#include <tr1/random> + +// libtsdc++/37986 +void test01() +{ + std::tr1::mt19937 mt; + std::tr1::uniform_real<double> dist; + + std::tr1::variate_generator< + std::tr1::mt19937, + std::tr1::uniform_real<double> + > g1(mt, dist); + + std::tr1::variate_generator< + std::tr1::mt19937&, + std::tr1::uniform_real<double> + > g2(mt, dist); + + std::tr1::variate_generator< + std::tr1::mt19937*, + std::tr1::uniform_real<double> + > g3(&mt, dist); + + g1(); + g2(); + g3(); +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/requirements/typedefs.cc new file mode 100644 index 000000000..e0e7a54b2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/variate_generator/requirements/typedefs.cc @@ -0,0 +1,41 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.3 class template variate_generator + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef variate_generator + < + linear_congruential<unsigned long, 16807 , 0 , 2147483647>, + uniform_int<int> + > test_type; + + typedef test_type::engine_type engine_type; + typedef test_type::engine_value_type engine_value_type; + typedef test_type::distribution_type distribution_type; + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/cons/default.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/cons/default.cc new file mode 100644 index 000000000..229434f60 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/cons/default.cc @@ -0,0 +1,45 @@ +// 2006-06-15 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.6 Class template xor_combine [tr.rand.eng.xor] +// 5.1.1 Table 15 default ctor + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + using namespace std::tr1; + xor_combine + < + minstd_rand, 1, + minstd_rand0, 2 + > x; + + VERIFY( x() == 32644 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/equal.cc new file mode 100644 index 000000000..298449c1a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/equal.cc @@ -0,0 +1,52 @@ +// 2006-06-19 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.6 class template xor_combine [tr.rand.eng.xor] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + xor_combine + < + minstd_rand, 1, + mt19937, 2 + > u, v; + + VERIFY( u == v ); + + for (int i = 0; i < 100; ++i) + { + u(); + v(); + } + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/not_equal.cc new file mode 100644 index 000000000..0d9d91789 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/not_equal.cc @@ -0,0 +1,51 @@ +// 2006-06-19 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.6 class template discard_block [tr.rand.eng.xor] +// 5.1.1 Table 16 + +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + xor_combine + < + minstd_rand, 1, + mt19937, 2 + > u(1); + + xor_combine + < + minstd_rand, 1, + mt19937, 2 + > v(2); + + VERIFY( u != v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/serialize.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/serialize.cc new file mode 100644 index 000000000..85eb73c74 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/operators/serialize.cc @@ -0,0 +1,55 @@ +// 2006-06-19 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.6 class template xor_combine [tr.rand.eng.xor] +// 5.1.1 Table 16 + +#include <sstream> +#include <tr1/random> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::xor_combine; + using std::tr1::minstd_rand; + using std::tr1::mt19937; + + std::stringstream str; + xor_combine + < + minstd_rand, 1, + mt19937, 2 + > u, v; + + u(); // advance + str << u; + + VERIFY( u != v ); + + str >> v; + VERIFY( u == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/constants.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/constants.cc new file mode 100644 index 000000000..3fbd55247 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/constants.cc @@ -0,0 +1,38 @@ +// { dg-do link } +// +// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com> +// +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/random> + +void test01() +{ + std::tr1::xor_combine<std::tr1::minstd_rand, 1, std::tr1::mt19937, 2> + xor_c; + + const void* p = &xor_c.shift1; + p = &xor_c.shift2; + p = p; // Suppress unused warning. +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/typedefs.cc new file mode 100644 index 000000000..db36bdb97 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/xor_combine/requirements/typedefs.cc @@ -0,0 +1,39 @@ +// { dg-do compile } +// +// 2006-06-04 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.1.4.6 Class template xor_combine +// 5.1.1 [1] Table 15 + +#include <tr1/random> + +void +test01() +{ + using namespace std::tr1; + + typedef xor_combine + < + minstd_rand, 1, + mt19937, 2 + > test_type; + + typedef test_type::result_type result_type; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_nan.cc new file mode 100644 index 000000000..c1e026a6f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_nan.cc @@ -0,0 +1,57 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.1 assoc_laguerre + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + unsigned int n = 2, m = 1; + + float a = std::tr1::assoc_laguerre(n, m, xf); + float b = std::tr1::assoc_laguerref(n, m, xf); + double c = std::tr1::assoc_laguerre(n, m, xd); + long double d = std::tr1::assoc_laguerre(n, m, xl); + long double e = std::tr1::assoc_laguerrel(n, m, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_value.cc new file mode 100644 index 000000000..d6fdcfeaf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_value.cc @@ -0,0 +1,3565 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// assoc_laguerre + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for n=0, m=0. +testcase_assoc_laguerre<double> data001[] = { + { 1.0000000000000000, 0, 0, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 0, + 10.000000000000000 }, + { 1.0000000000000000, 0, 0, + 20.000000000000000 }, + { 1.0000000000000000, 0, 0, + 30.000000000000000 }, + { 1.0000000000000000, 0, 0, + 40.000000000000000 }, + { 1.0000000000000000, 0, 0, + 50.000000000000000 }, + { 1.0000000000000000, 0, 0, + 60.000000000000000 }, + { 1.0000000000000000, 0, 0, + 70.000000000000000 }, + { 1.0000000000000000, 0, 0, + 80.000000000000000 }, + { 1.0000000000000000, 0, 0, + 90.000000000000000 }, + { 1.0000000000000000, 0, 0, + 100.00000000000000 }, +}; + +// Test function for n=0, m=0. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data001[i].n), Tp(data001[i].m), + Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=0, m=1. +testcase_assoc_laguerre<double> data002[] = { + { 1.0000000000000000, 0, 1, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 1, + 10.000000000000000 }, + { 1.0000000000000000, 0, 1, + 20.000000000000000 }, + { 1.0000000000000000, 0, 1, + 30.000000000000000 }, + { 1.0000000000000000, 0, 1, + 40.000000000000000 }, + { 1.0000000000000000, 0, 1, + 50.000000000000000 }, + { 1.0000000000000000, 0, 1, + 60.000000000000000 }, + { 1.0000000000000000, 0, 1, + 70.000000000000000 }, + { 1.0000000000000000, 0, 1, + 80.000000000000000 }, + { 1.0000000000000000, 0, 1, + 90.000000000000000 }, + { 1.0000000000000000, 0, 1, + 100.00000000000000 }, +}; + +// Test function for n=0, m=1. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data002[i].n), Tp(data002[i].m), + Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=0, m=2. +testcase_assoc_laguerre<double> data003[] = { + { 1.0000000000000000, 0, 2, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 2, + 10.000000000000000 }, + { 1.0000000000000000, 0, 2, + 20.000000000000000 }, + { 1.0000000000000000, 0, 2, + 30.000000000000000 }, + { 1.0000000000000000, 0, 2, + 40.000000000000000 }, + { 1.0000000000000000, 0, 2, + 50.000000000000000 }, + { 1.0000000000000000, 0, 2, + 60.000000000000000 }, + { 1.0000000000000000, 0, 2, + 70.000000000000000 }, + { 1.0000000000000000, 0, 2, + 80.000000000000000 }, + { 1.0000000000000000, 0, 2, + 90.000000000000000 }, + { 1.0000000000000000, 0, 2, + 100.00000000000000 }, +}; + +// Test function for n=0, m=2. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data003[i].n), Tp(data003[i].m), + Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=0, m=5. +testcase_assoc_laguerre<double> data004[] = { + { 1.0000000000000000, 0, 5, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 5, + 10.000000000000000 }, + { 1.0000000000000000, 0, 5, + 20.000000000000000 }, + { 1.0000000000000000, 0, 5, + 30.000000000000000 }, + { 1.0000000000000000, 0, 5, + 40.000000000000000 }, + { 1.0000000000000000, 0, 5, + 50.000000000000000 }, + { 1.0000000000000000, 0, 5, + 60.000000000000000 }, + { 1.0000000000000000, 0, 5, + 70.000000000000000 }, + { 1.0000000000000000, 0, 5, + 80.000000000000000 }, + { 1.0000000000000000, 0, 5, + 90.000000000000000 }, + { 1.0000000000000000, 0, 5, + 100.00000000000000 }, +}; + +// Test function for n=0, m=5. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data004[i].n), Tp(data004[i].m), + Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=0, m=10. +testcase_assoc_laguerre<double> data005[] = { + { 1.0000000000000000, 0, 10, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 10, + 10.000000000000000 }, + { 1.0000000000000000, 0, 10, + 20.000000000000000 }, + { 1.0000000000000000, 0, 10, + 30.000000000000000 }, + { 1.0000000000000000, 0, 10, + 40.000000000000000 }, + { 1.0000000000000000, 0, 10, + 50.000000000000000 }, + { 1.0000000000000000, 0, 10, + 60.000000000000000 }, + { 1.0000000000000000, 0, 10, + 70.000000000000000 }, + { 1.0000000000000000, 0, 10, + 80.000000000000000 }, + { 1.0000000000000000, 0, 10, + 90.000000000000000 }, + { 1.0000000000000000, 0, 10, + 100.00000000000000 }, +}; + +// Test function for n=0, m=10. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data005[i].n), Tp(data005[i].m), + Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=0, m=20. +testcase_assoc_laguerre<double> data006[] = { + { 1.0000000000000000, 0, 20, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 20, + 10.000000000000000 }, + { 1.0000000000000000, 0, 20, + 20.000000000000000 }, + { 1.0000000000000000, 0, 20, + 30.000000000000000 }, + { 1.0000000000000000, 0, 20, + 40.000000000000000 }, + { 1.0000000000000000, 0, 20, + 50.000000000000000 }, + { 1.0000000000000000, 0, 20, + 60.000000000000000 }, + { 1.0000000000000000, 0, 20, + 70.000000000000000 }, + { 1.0000000000000000, 0, 20, + 80.000000000000000 }, + { 1.0000000000000000, 0, 20, + 90.000000000000000 }, + { 1.0000000000000000, 0, 20, + 100.00000000000000 }, +}; + +// Test function for n=0, m=20. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data006[i].n), Tp(data006[i].m), + Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=0, m=50. +testcase_assoc_laguerre<double> data007[] = { + { 1.0000000000000000, 0, 50, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 50, + 10.000000000000000 }, + { 1.0000000000000000, 0, 50, + 20.000000000000000 }, + { 1.0000000000000000, 0, 50, + 30.000000000000000 }, + { 1.0000000000000000, 0, 50, + 40.000000000000000 }, + { 1.0000000000000000, 0, 50, + 50.000000000000000 }, + { 1.0000000000000000, 0, 50, + 60.000000000000000 }, + { 1.0000000000000000, 0, 50, + 70.000000000000000 }, + { 1.0000000000000000, 0, 50, + 80.000000000000000 }, + { 1.0000000000000000, 0, 50, + 90.000000000000000 }, + { 1.0000000000000000, 0, 50, + 100.00000000000000 }, +}; + +// Test function for n=0, m=50. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data007[i].n), Tp(data007[i].m), + Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=0, m=100. +testcase_assoc_laguerre<double> data008[] = { + { 1.0000000000000000, 0, 100, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 100, + 10.000000000000000 }, + { 1.0000000000000000, 0, 100, + 20.000000000000000 }, + { 1.0000000000000000, 0, 100, + 30.000000000000000 }, + { 1.0000000000000000, 0, 100, + 40.000000000000000 }, + { 1.0000000000000000, 0, 100, + 50.000000000000000 }, + { 1.0000000000000000, 0, 100, + 60.000000000000000 }, + { 1.0000000000000000, 0, 100, + 70.000000000000000 }, + { 1.0000000000000000, 0, 100, + 80.000000000000000 }, + { 1.0000000000000000, 0, 100, + 90.000000000000000 }, + { 1.0000000000000000, 0, 100, + 100.00000000000000 }, +}; + +// Test function for n=0, m=100. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data008[i].n), Tp(data008[i].m), + Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1, m=0. +testcase_assoc_laguerre<double> data009[] = { + { 1.0000000000000000, 1, 0, + 0.0000000000000000 }, + { -9.0000000000000000, 1, 0, + 10.000000000000000 }, + { -19.000000000000000, 1, 0, + 20.000000000000000 }, + { -29.000000000000000, 1, 0, + 30.000000000000000 }, + { -39.000000000000000, 1, 0, + 40.000000000000000 }, + { -49.000000000000000, 1, 0, + 50.000000000000000 }, + { -59.000000000000000, 1, 0, + 60.000000000000000 }, + { -69.000000000000000, 1, 0, + 70.000000000000000 }, + { -79.000000000000000, 1, 0, + 80.000000000000000 }, + { -89.000000000000000, 1, 0, + 90.000000000000000 }, + { -99.000000000000000, 1, 0, + 100.00000000000000 }, +}; + +// Test function for n=1, m=0. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data009[i].n), Tp(data009[i].m), + Tp(data009[i].x)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1, m=1. +testcase_assoc_laguerre<double> data010[] = { + { 2.0000000000000000, 1, 1, + 0.0000000000000000 }, + { -8.0000000000000000, 1, 1, + 10.000000000000000 }, + { -18.000000000000000, 1, 1, + 20.000000000000000 }, + { -28.000000000000000, 1, 1, + 30.000000000000000 }, + { -38.000000000000000, 1, 1, + 40.000000000000000 }, + { -48.000000000000000, 1, 1, + 50.000000000000000 }, + { -58.000000000000000, 1, 1, + 60.000000000000000 }, + { -68.000000000000000, 1, 1, + 70.000000000000000 }, + { -78.000000000000000, 1, 1, + 80.000000000000000 }, + { -88.000000000000000, 1, 1, + 90.000000000000000 }, + { -98.000000000000000, 1, 1, + 100.00000000000000 }, +}; + +// Test function for n=1, m=1. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data010[i].n), Tp(data010[i].m), + Tp(data010[i].x)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1, m=2. +testcase_assoc_laguerre<double> data011[] = { + { 3.0000000000000000, 1, 2, + 0.0000000000000000 }, + { -7.0000000000000000, 1, 2, + 10.000000000000000 }, + { -17.000000000000000, 1, 2, + 20.000000000000000 }, + { -27.000000000000000, 1, 2, + 30.000000000000000 }, + { -37.000000000000000, 1, 2, + 40.000000000000000 }, + { -47.000000000000000, 1, 2, + 50.000000000000000 }, + { -57.000000000000000, 1, 2, + 60.000000000000000 }, + { -67.000000000000000, 1, 2, + 70.000000000000000 }, + { -77.000000000000000, 1, 2, + 80.000000000000000 }, + { -87.000000000000000, 1, 2, + 90.000000000000000 }, + { -97.000000000000000, 1, 2, + 100.00000000000000 }, +}; + +// Test function for n=1, m=2. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data011[i].n), Tp(data011[i].m), + Tp(data011[i].x)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1, m=5. +testcase_assoc_laguerre<double> data012[] = { + { 6.0000000000000000, 1, 5, + 0.0000000000000000 }, + { -4.0000000000000000, 1, 5, + 10.000000000000000 }, + { -14.000000000000000, 1, 5, + 20.000000000000000 }, + { -24.000000000000000, 1, 5, + 30.000000000000000 }, + { -34.000000000000000, 1, 5, + 40.000000000000000 }, + { -44.000000000000000, 1, 5, + 50.000000000000000 }, + { -54.000000000000000, 1, 5, + 60.000000000000000 }, + { -64.000000000000000, 1, 5, + 70.000000000000000 }, + { -74.000000000000000, 1, 5, + 80.000000000000000 }, + { -84.000000000000000, 1, 5, + 90.000000000000000 }, + { -94.000000000000000, 1, 5, + 100.00000000000000 }, +}; + +// Test function for n=1, m=5. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data012[i].n), Tp(data012[i].m), + Tp(data012[i].x)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1, m=10. +testcase_assoc_laguerre<double> data013[] = { + { 11.000000000000000, 1, 10, + 0.0000000000000000 }, + { 1.0000000000000000, 1, 10, + 10.000000000000000 }, + { -9.0000000000000000, 1, 10, + 20.000000000000000 }, + { -19.000000000000000, 1, 10, + 30.000000000000000 }, + { -29.000000000000000, 1, 10, + 40.000000000000000 }, + { -39.000000000000000, 1, 10, + 50.000000000000000 }, + { -49.000000000000000, 1, 10, + 60.000000000000000 }, + { -59.000000000000000, 1, 10, + 70.000000000000000 }, + { -69.000000000000000, 1, 10, + 80.000000000000000 }, + { -79.000000000000000, 1, 10, + 90.000000000000000 }, + { -89.000000000000000, 1, 10, + 100.00000000000000 }, +}; + +// Test function for n=1, m=10. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data013[i].n), Tp(data013[i].m), + Tp(data013[i].x)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1, m=20. +testcase_assoc_laguerre<double> data014[] = { + { 21.000000000000000, 1, 20, + 0.0000000000000000 }, + { 11.000000000000000, 1, 20, + 10.000000000000000 }, + { 1.0000000000000000, 1, 20, + 20.000000000000000 }, + { -9.0000000000000000, 1, 20, + 30.000000000000000 }, + { -19.000000000000000, 1, 20, + 40.000000000000000 }, + { -29.000000000000000, 1, 20, + 50.000000000000000 }, + { -39.000000000000000, 1, 20, + 60.000000000000000 }, + { -49.000000000000000, 1, 20, + 70.000000000000000 }, + { -59.000000000000000, 1, 20, + 80.000000000000000 }, + { -69.000000000000000, 1, 20, + 90.000000000000000 }, + { -79.000000000000000, 1, 20, + 100.00000000000000 }, +}; + +// Test function for n=1, m=20. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data014[i].n), Tp(data014[i].m), + Tp(data014[i].x)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1, m=50. +testcase_assoc_laguerre<double> data015[] = { + { 51.000000000000000, 1, 50, + 0.0000000000000000 }, + { 41.000000000000000, 1, 50, + 10.000000000000000 }, + { 31.000000000000000, 1, 50, + 20.000000000000000 }, + { 21.000000000000000, 1, 50, + 30.000000000000000 }, + { 11.000000000000000, 1, 50, + 40.000000000000000 }, + { 1.0000000000000000, 1, 50, + 50.000000000000000 }, + { -9.0000000000000000, 1, 50, + 60.000000000000000 }, + { -19.000000000000000, 1, 50, + 70.000000000000000 }, + { -29.000000000000000, 1, 50, + 80.000000000000000 }, + { -39.000000000000000, 1, 50, + 90.000000000000000 }, + { -49.000000000000000, 1, 50, + 100.00000000000000 }, +}; + +// Test function for n=1, m=50. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data015[i].n), Tp(data015[i].m), + Tp(data015[i].x)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1, m=100. +testcase_assoc_laguerre<double> data016[] = { + { 101.00000000000000, 1, 100, + 0.0000000000000000 }, + { 91.000000000000000, 1, 100, + 10.000000000000000 }, + { 81.000000000000000, 1, 100, + 20.000000000000000 }, + { 71.000000000000000, 1, 100, + 30.000000000000000 }, + { 61.000000000000000, 1, 100, + 40.000000000000000 }, + { 51.000000000000000, 1, 100, + 50.000000000000000 }, + { 41.000000000000000, 1, 100, + 60.000000000000000 }, + { 31.000000000000000, 1, 100, + 70.000000000000000 }, + { 21.000000000000000, 1, 100, + 80.000000000000000 }, + { 11.000000000000000, 1, 100, + 90.000000000000000 }, + { 1.0000000000000000, 1, 100, + 100.00000000000000 }, +}; + +// Test function for n=1, m=100. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data016[i].n), Tp(data016[i].m), + Tp(data016[i].x)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=2, m=0. +testcase_assoc_laguerre<double> data017[] = { + { 1.0000000000000000, 2, 0, + 0.0000000000000000 }, + { 31.000000000000000, 2, 0, + 10.000000000000000 }, + { 161.00000000000000, 2, 0, + 20.000000000000000 }, + { 391.00000000000000, 2, 0, + 30.000000000000000 }, + { 721.00000000000000, 2, 0, + 40.000000000000000 }, + { 1151.0000000000000, 2, 0, + 50.000000000000000 }, + { 1681.0000000000000, 2, 0, + 60.000000000000000 }, + { 2311.0000000000000, 2, 0, + 70.000000000000000 }, + { 3041.0000000000000, 2, 0, + 80.000000000000000 }, + { 3871.0000000000000, 2, 0, + 90.000000000000000 }, + { 4801.0000000000000, 2, 0, + 100.00000000000000 }, +}; + +// Test function for n=2, m=0. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data017[i].n), Tp(data017[i].m), + Tp(data017[i].x)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=2, m=1. +testcase_assoc_laguerre<double> data018[] = { + { 3.0000000000000000, 2, 1, + 0.0000000000000000 }, + { 23.000000000000000, 2, 1, + 10.000000000000000 }, + { 143.00000000000000, 2, 1, + 20.000000000000000 }, + { 363.00000000000000, 2, 1, + 30.000000000000000 }, + { 683.00000000000000, 2, 1, + 40.000000000000000 }, + { 1103.0000000000000, 2, 1, + 50.000000000000000 }, + { 1623.0000000000000, 2, 1, + 60.000000000000000 }, + { 2243.0000000000000, 2, 1, + 70.000000000000000 }, + { 2963.0000000000000, 2, 1, + 80.000000000000000 }, + { 3783.0000000000000, 2, 1, + 90.000000000000000 }, + { 4703.0000000000000, 2, 1, + 100.00000000000000 }, +}; + +// Test function for n=2, m=1. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data018[i].n), Tp(data018[i].m), + Tp(data018[i].x)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=2, m=2. +testcase_assoc_laguerre<double> data019[] = { + { 6.0000000000000000, 2, 2, + 0.0000000000000000 }, + { 16.000000000000000, 2, 2, + 10.000000000000000 }, + { 126.00000000000000, 2, 2, + 20.000000000000000 }, + { 336.00000000000000, 2, 2, + 30.000000000000000 }, + { 646.00000000000000, 2, 2, + 40.000000000000000 }, + { 1056.0000000000000, 2, 2, + 50.000000000000000 }, + { 1566.0000000000000, 2, 2, + 60.000000000000000 }, + { 2176.0000000000000, 2, 2, + 70.000000000000000 }, + { 2886.0000000000000, 2, 2, + 80.000000000000000 }, + { 3696.0000000000000, 2, 2, + 90.000000000000000 }, + { 4606.0000000000000, 2, 2, + 100.00000000000000 }, +}; + +// Test function for n=2, m=2. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data019[i].n), Tp(data019[i].m), + Tp(data019[i].x)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=2, m=5. +testcase_assoc_laguerre<double> data020[] = { + { 21.000000000000000, 2, 5, + 0.0000000000000000 }, + { 0.99999999999999645, 2, 5, + 10.000000000000000 }, + { 81.000000000000000, 2, 5, + 20.000000000000000 }, + { 261.00000000000000, 2, 5, + 30.000000000000000 }, + { 541.00000000000000, 2, 5, + 40.000000000000000 }, + { 921.00000000000000, 2, 5, + 50.000000000000000 }, + { 1401.0000000000000, 2, 5, + 60.000000000000000 }, + { 1981.0000000000000, 2, 5, + 70.000000000000000 }, + { 2661.0000000000000, 2, 5, + 80.000000000000000 }, + { 3441.0000000000000, 2, 5, + 90.000000000000000 }, + { 4321.0000000000000, 2, 5, + 100.00000000000000 }, +}; + +// Test function for n=2, m=5. +template <typename Tp> +void test020() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data020) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data020[i].n), Tp(data020[i].m), + Tp(data020[i].x)); + const Tp f0 = data020[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=2, m=10. +testcase_assoc_laguerre<double> data021[] = { + { 66.000000000000000, 2, 10, + 0.0000000000000000 }, + { -4.0000000000000089, 2, 10, + 10.000000000000000 }, + { 25.999999999999964, 2, 10, + 20.000000000000000 }, + { 156.00000000000000, 2, 10, + 30.000000000000000 }, + { 386.00000000000000, 2, 10, + 40.000000000000000 }, + { 716.00000000000000, 2, 10, + 50.000000000000000 }, + { 1146.0000000000000, 2, 10, + 60.000000000000000 }, + { 1676.0000000000000, 2, 10, + 70.000000000000000 }, + { 2306.0000000000000, 2, 10, + 80.000000000000000 }, + { 3036.0000000000000, 2, 10, + 90.000000000000000 }, + { 3866.0000000000000, 2, 10, + 100.00000000000000 }, +}; + +// Test function for n=2, m=10. +template <typename Tp> +void test021() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data021) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data021[i].n), Tp(data021[i].m), + Tp(data021[i].x)); + const Tp f0 = data021[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=2, m=20. +testcase_assoc_laguerre<double> data022[] = { + { 231.00000000000000, 2, 20, + 0.0000000000000000 }, + { 61.000000000000206, 2, 20, + 10.000000000000000 }, + { -8.9999999999999982, 2, 20, + 20.000000000000000 }, + { 21.000000000000135, 2, 20, + 30.000000000000000 }, + { 151.00000000000054, 2, 20, + 40.000000000000000 }, + { 381.00000000000000, 2, 20, + 50.000000000000000 }, + { 711.00000000000000, 2, 20, + 60.000000000000000 }, + { 1141.0000000000000, 2, 20, + 70.000000000000000 }, + { 1670.9999999999998, 2, 20, + 80.000000000000000 }, + { 2301.0000000000000, 2, 20, + 90.000000000000000 }, + { 3031.0000000000000, 2, 20, + 100.00000000000000 }, +}; + +// Test function for n=2, m=20. +template <typename Tp> +void test022() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data022) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data022[i].n), Tp(data022[i].m), + Tp(data022[i].x)); + const Tp f0 = data022[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for n=2, m=50. +testcase_assoc_laguerre<double> data023[] = { + { 1326.0000000000000, 2, 50, + 0.0000000000000000 }, + { 855.99999999999716, 2, 50, + 10.000000000000000 }, + { 485.99999999999829, 2, 50, + 20.000000000000000 }, + { 215.99999999999935, 2, 50, + 30.000000000000000 }, + { 45.999999999999787, 2, 50, + 40.000000000000000 }, + { -23.999999999999684, 2, 50, + 50.000000000000000 }, + { 6.0000000000001217, 2, 50, + 60.000000000000000 }, + { 135.99999999999972, 2, 50, + 70.000000000000000 }, + { 365.99999999999892, 2, 50, + 80.000000000000000 }, + { 695.99999999999784, 2, 50, + 90.000000000000000 }, + { 1125.9999999999964, 2, 50, + 100.00000000000000 }, +}; + +// Test function for n=2, m=50. +template <typename Tp> +void test023() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data023) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data023[i].n), Tp(data023[i].m), + Tp(data023[i].x)); + const Tp f0 = data023[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for n=2, m=100. +testcase_assoc_laguerre<double> data024[] = { + { 5151.0000000000000, 2, 100, + 0.0000000000000000 }, + { 4181.0000000000655, 2, 100, + 10.000000000000000 }, + { 3311.0000000000518, 2, 100, + 20.000000000000000 }, + { 2541.0000000000400, 2, 100, + 30.000000000000000 }, + { 1871.0000000000291, 2, 100, + 40.000000000000000 }, + { 1301.0000000000207, 2, 100, + 50.000000000000000 }, + { 831.00000000001364, 2, 100, + 60.000000000000000 }, + { 461.00000000000682, 2, 100, + 70.000000000000000 }, + { 191.00000000000227, 2, 100, + 80.000000000000000 }, + { 21.000000000000128, 2, 100, + 90.000000000000000 }, + { -49.000000000000369, 2, 100, + 100.00000000000000 }, +}; + +// Test function for n=2, m=100. +template <typename Tp> +void test024() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data024) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data024[i].n), Tp(data024[i].m), + Tp(data024[i].x)); + const Tp f0 = data024[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=5, m=0. +testcase_assoc_laguerre<double> data025[] = { + { 1.0000000000000000, 5, 0, + 0.0000000000000000 }, + { 34.333333333333329, 5, 0, + 10.000000000000000 }, + { -4765.6666666666670, 5, 0, + 20.000000000000000 }, + { -74399.000000000000, 5, 0, + 30.000000000000000 }, + { -418865.66666666663, 5, 0, + 40.000000000000000 }, + { -1498165.6666666665, 5, 0, + 50.000000000000000 }, + { -4122299.0000000000, 5, 0, + 60.000000000000000 }, + { -9551265.6666666679, 5, 0, + 70.000000000000000 }, + { -19595065.666666664, 5, 0, + 80.000000000000000 }, + { -36713699.000000000, 5, 0, + 90.000000000000000 }, + { -64117165.666666664, 5, 0, + 100.00000000000000 }, +}; + +// Test function for n=5, m=0. +template <typename Tp> +void test025() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data025) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data025[i].n), Tp(data025[i].m), + Tp(data025[i].x)); + const Tp f0 = data025[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=5, m=1. +testcase_assoc_laguerre<double> data026[] = { + { 6.0000000000000000, 5, 1, + 0.0000000000000000 }, + { 22.666666666666661, 5, 1, + 10.000000000000000 }, + { -2960.6666666666661, 5, 1, + 20.000000000000000 }, + { -58944.000000000000, 5, 1, + 30.000000000000000 }, + { -357927.33333333326, 5, 1, + 40.000000000000000 }, + { -1329910.6666666665, 5, 1, + 50.000000000000000 }, + { -3744894.0000000000, 5, 1, + 60.000000000000000 }, + { -8812877.3333333321, 5, 1, + 70.000000000000000 }, + { -18283860.666666664, 5, 1, + 80.000000000000000 }, + { -34547844.000000000, 5, 1, + 90.000000000000000 }, + { -60734827.333333336, 5, 1, + 100.00000000000000 }, +}; + +// Test function for n=5, m=1. +template <typename Tp> +void test026() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data026) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data026[i].n), Tp(data026[i].m), + Tp(data026[i].x)); + const Tp f0 = data026[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=5, m=2. +testcase_assoc_laguerre<double> data027[] = { + { 21.000000000000000, 5, 2, + 0.0000000000000000 }, + { 4.3333333333333339, 5, 2, + 10.000000000000000 }, + { -1679.0000000000000, 5, 2, + 20.000000000000000 }, + { -46029.000000000000, 5, 2, + 30.000000000000000 }, + { -304045.66666666669, 5, 2, + 40.000000000000000 }, + { -1176729.0000000002, 5, 2, + 50.000000000000000 }, + { -3395079.0000000000, 5, 2, + 60.000000000000000 }, + { -8120095.6666666660, 5, 2, + 70.000000000000000 }, + { -17042778.999999996, 5, 2, + 80.000000000000000 }, + { -32484129.000000000, 5, 2, + 90.000000000000000 }, + { -57495145.666666664, 5, 2, + 100.00000000000000 }, +}; + +// Test function for n=5, m=2. +template <typename Tp> +void test027() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data027) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data027[i].n), Tp(data027[i].m), + Tp(data027[i].x)); + const Tp f0 = data027[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=5, m=5. +testcase_assoc_laguerre<double> data028[] = { + { 252.00000000000000, 5, 5, + 0.0000000000000000 }, + { -14.666666666666657, 5, 5, + 10.000000000000000 }, + { 51.999999999999957, 5, 5, + 20.000000000000000 }, + { -19548.000000000000, 5, 5, + 30.000000000000000 }, + { -178814.66666666660, 5, 5, + 40.000000000000000 }, + { -797747.99999999977, 5, 5, + 50.000000000000000 }, + { -2496348.0000000000, 5, 5, + 60.000000000000000 }, + { -6294614.6666666660, 5, 5, + 70.000000000000000 }, + { -13712547.999999996, 5, 5, + 80.000000000000000 }, + { -26870147.999999993, 5, 5, + 90.000000000000000 }, + { -48587414.666666672, 5, 5, + 100.00000000000000 }, +}; + +// Test function for n=5, m=5. +template <typename Tp> +void test028() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data028) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data028[i].n), Tp(data028[i].m), + Tp(data028[i].x)); + const Tp f0 = data028[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=5, m=10. +testcase_assoc_laguerre<double> data029[] = { + { 3003.0000000000000, 5, 10, + 0.0000000000000000 }, + { 19.666666666666668, 5, 10, + 10.000000000000000 }, + { 36.333333333333272, 5, 10, + 20.000000000000000 }, + { -1947.0000000000000, 5, 10, + 30.000000000000000 }, + { -60930.333333333314, 5, 10, + 40.000000000000000 }, + { -381913.66666666651, 5, 10, + 50.000000000000000 }, + { -1419897.0000000000, 5, 10, + 60.000000000000000 }, + { -3979880.3333333330, 5, 10, + 70.000000000000000 }, + { -9316863.6666666642, 5, 10, + 80.000000000000000 }, + { -19235847.000000000, 5, 10, + 90.000000000000000 }, + { -36191830.333333328, 5, 10, + 100.00000000000000 }, +}; + +// Test function for n=5, m=10. +template <typename Tp> +void test029() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data029) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data029[i].n), Tp(data029[i].m), + Tp(data029[i].x)); + const Tp f0 = data029[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=5, m=20. +testcase_assoc_laguerre<double> data030[] = { + { 53130.000000000000, 5, 20, + 0.0000000000000000 }, + { 1213.3333333333335, 5, 20, + 10.000000000000000 }, + { 129.99999999999963, 5, 20, + 20.000000000000000 }, + { -119.99999999999974, 5, 20, + 30.000000000000000 }, + { 463.33333333333320, 5, 20, + 40.000000000000000 }, + { -48120.000000000015, 5, 20, + 50.000000000000000 }, + { -345870.00000000017, 5, 20, + 60.000000000000000 }, + { -1342786.6666666667, 5, 20, + 70.000000000000000 }, + { -3838870.0000000009, 5, 20, + 80.000000000000000 }, + { -9084120.0000000000, 5, 20, + 90.000000000000000 }, + { -18878536.666666668, 5, 20, + 100.00000000000000 }, +}; + +// Test function for n=5, m=20. +template <typename Tp> +void test030() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data030) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data030[i].n), Tp(data030[i].m), + Tp(data030[i].x)); + const Tp f0 = data030[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=5, m=50. +testcase_assoc_laguerre<double> data031[] = { + { 3478761.0000000000, 5, 50, + 0.0000000000000000 }, + { 1154544.3333333335, 5, 50, + 10.000000000000000 }, + { 264661.00000000006, 5, 50, + 20.000000000000000 }, + { 24111.000000000000, 5, 50, + 30.000000000000000 }, + { -2105.6666666666665, 5, 50, + 40.000000000000000 }, + { 1011.0000000000000, 5, 50, + 50.000000000000000 }, + { -1538.9999999999955, 5, 50, + 60.000000000000000 }, + { 5244.3333333333449, 5, 50, + 70.000000000000000 }, + { -13639.000000000015, 5, 50, + 80.000000000000000 }, + { -243189.00000000006, 5, 50, + 90.000000000000000 }, + { -1118405.6666666667, 5, 50, + 100.00000000000000 }, +}; + +// Test function for n=5, m=50. +template <typename Tp> +void test031() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data031) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data031[i].n), Tp(data031[i].m), + Tp(data031[i].x)); + const Tp f0 = data031[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=5, m=100. +testcase_assoc_laguerre<double> data032[] = { + { 96560646.000000000, 5, 100, + 0.0000000000000000 }, + { 57264262.666666649, 5, 100, + 10.000000000000000 }, + { 31841379.333333332, 5, 100, + 20.000000000000000 }, + { 16281996.000000000, 5, 100, + 30.000000000000000 }, + { 7426112.6666666670, 5, 100, + 40.000000000000000 }, + { 2863729.3333333330, 5, 100, + 50.000000000000000 }, + { 834846.00000000000, 5, 100, + 60.000000000000000 }, + { 129462.66666666663, 5, 100, + 70.000000000000000 }, + { -12420.666666666666, 5, 100, + 80.000000000000000 }, + { -804.00000000000000, 5, 100, + 90.000000000000000 }, + { 4312.6666666666661, 5, 100, + 100.00000000000000 }, +}; + +// Test function for n=5, m=100. +template <typename Tp> +void test032() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data032) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data032[i].n), Tp(data032[i].m), + Tp(data032[i].x)); + const Tp f0 = data032[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=10, m=0. +testcase_assoc_laguerre<double> data033[] = { + { 1.0000000000000000, 10, 0, + 0.0000000000000000 }, + { 27.984126984126981, 10, 0, + 10.000000000000000 }, + { 3227.8077601410932, 10, 0, + 20.000000000000000 }, + { 15129.571428571489, 10, 0, + 30.000000000000000 }, + { 79724066.608465582, 10, 0, + 40.000000000000000 }, + { 2037190065.3738980, 10, 0, + 50.000000000000000 }, + { 21804200401.000000, 10, 0, + 60.000000000000000 }, + { 144688291819.51855, 10, 0, + 70.000000000000000 }, + { 703324772760.08276, 10, 0, + 80.000000000000000 }, + { 2741055412243.8569, 10, 0, + 90.000000000000000 }, + { 9051283795429.5723, 10, 0, + 100.00000000000000 }, +}; + +// Test function for n=10, m=0. +template <typename Tp> +void test033() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data033) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data033[i].n), Tp(data033[i].m), + Tp(data033[i].x)); + const Tp f0 = data033[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for n=10, m=1. +testcase_assoc_laguerre<double> data034[] = { + { 11.000000000000000, 10, 1, + 0.0000000000000000 }, + { 14.791887125220455, 10, 1, + 10.000000000000000 }, + { 2704.6507936507933, 10, 1, + 20.000000000000000 }, + { -182924.71428571426, 10, 1, + 30.000000000000000 }, + { 48066036.749559075, 10, 1, + 40.000000000000000 }, + { 1486264192.2169311, 10, 1, + 50.000000000000000 }, + { 17239562282.428574, 10, 1, + 60.000000000000000 }, + { 119837491630.13579, 10, 1, + 70.000000000000000 }, + { 600681375251.21167, 10, 1, + 80.000000000000000 }, + { 2392908405632.4287, 10, 1, + 90.000000000000000 }, + { 8033035722509.2373, 10, 1, + 100.00000000000000 }, +}; + +// Test function for n=10, m=1. +template <typename Tp> +void test034() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data034) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data034[i].n), Tp(data034[i].m), + Tp(data034[i].x)); + const Tp f0 = data034[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=10, m=2. +testcase_assoc_laguerre<double> data035[] = { + { 66.000000000000000, 10, 2, + 0.0000000000000000 }, + { -14.511463844797174, 10, 2, + 10.000000000000000 }, + { 1064.5890652557318, 10, 2, + 20.000000000000000 }, + { -194569.71428571426, 10, 2, + 30.000000000000000 }, + { 27343569.350970022, 10, 2, + 40.000000000000000 }, + { 1067807661.6790125, 10, 2, + 50.000000000000000 }, + { 13529451580.285713, 10, 2, + 60.000000000000000 }, + { 98812724224.641937, 10, 2, + 70.000000000000000 }, + { 511482736187.34021, 10, 2, + 80.000000000000000 }, + { 2084478393087.4285, 10, 2, + 90.000000000000000 }, + { 7117724862237.0752, 10, 2, + 100.00000000000000 }, +}; + +// Test function for n=10, m=2. +template <typename Tp> +void test035() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data035) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data035[i].n), Tp(data035[i].m), + Tp(data035[i].x)); + const Tp f0 = data035[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=10, m=5. +testcase_assoc_laguerre<double> data036[] = { + { 3003.0000000000000, 10, 5, + 0.0000000000000000 }, + { 11.641975308642024, 10, 5, + 10.000000000000000 }, + { -1137.5643738977069, 10, 5, + 20.000000000000000 }, + { -9254.1428571428605, 10, 5, + 30.000000000000000 }, + { 2121878.8377425023, 10, 5, + 40.000000000000000 }, + { 352060171.43033499, 10, 5, + 50.000000000000000 }, + { 6212028560.1428576, 10, 5, + 60.000000000000000 }, + { 53782171674.604919, 10, 5, + 70.000000000000000 }, + { 309720255837.56775, 10, 5, + 80.000000000000000 }, + { 1359043035731.5713, 10, 5, + 90.000000000000000 }, + { 4900625954398.9434, 10, 5, + 100.00000000000000 }, +}; + +// Test function for n=10, m=5. +template <typename Tp> +void test036() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data036) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data036[i].n), Tp(data036[i].m), + Tp(data036[i].x)); + const Tp f0 = data036[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=10, m=10. +testcase_assoc_laguerre<double> data037[] = { + { 184756.00000000000, 10, 10, + 0.0000000000000000 }, + { -210.84303350970018, 10, 10, + 10.000000000000000 }, + { 508.38095238095184, 10, 10, + 20.000000000000000 }, + { 2098.8571428571431, 10, 10, + 30.000000000000000 }, + { -536338.88536155189, 10, 10, + 40.000000000000000 }, + { 24865988.804232784, 10, 10, + 50.000000000000000 }, + { 1343756013.1428571, 10, 10, + 60.000000000000000 }, + { 17298791247.358025, 10, 10, + 70.000000000000000 }, + { 124528450897.79892, 10, 10, + 80.000000000000000 }, + { 632674413641.71423, 10, 10, + 90.000000000000000 }, + { 2533008935405.0298, 10, 10, + 100.00000000000000 }, +}; + +// Test function for n=10, m=10. +template <typename Tp> +void test037() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data037) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data037[i].n), Tp(data037[i].m), + Tp(data037[i].x)); + const Tp f0 = data037[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=10, m=20. +testcase_assoc_laguerre<double> data038[] = { + { 30045014.999999993, 10, 20, + 0.0000000000000000 }, + { -23087.733686067022, 10, 20, + 10.000000000000000 }, + { 207.23985890652347, 10, 20, + 20.000000000000000 }, + { 1407.8571428571497, 10, 20, + 30.000000000000000 }, + { -44618.156966490329, 10, 20, + 40.000000000000000 }, + { 158690.04409171085, 10, 20, + 50.000000000000000 }, + { -6870413.5714285728, 10, 20, + 60.000000000000000 }, + { 793841351.41975331, 10, 20, + 70.000000000000000 }, + { 13358288958.562618, 10, 20, + 80.000000000000000 }, + { 106073722407.85715, 10, 20, + 90.000000000000000 }, + { 566337213392.42493, 10, 20, + 100.00000000000000 }, +}; + +// Test function for n=10, m=20. +template <typename Tp> +void test038() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data038) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data038[i].n), Tp(data038[i].m), + Tp(data038[i].x)); + const Tp f0 = data038[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=10, m=50. +testcase_assoc_laguerre<double> data039[] = { + { 75394027566.000000, 10, 50, + 0.0000000000000000 }, + { 8048106183.3721361, 10, 50, + 10.000000000000000 }, + { 328045023.84832466, 10, 50, + 20.000000000000000 }, + { -2568769.7142857141, 10, 50, + 30.000000000000000 }, + { 6971.9964726631733, 10, 50, + 40.000000000000000 }, + { 136111.41446208110, 10, 50, + 50.000000000000000 }, + { -62462.571428570242, 10, 50, + 60.000000000000000 }, + { -248167.95061728527, 10, 50, + 70.000000000000000 }, + { 1941270.4091710777, 10, 50, + 80.000000000000000 }, + { -8643512.5714285783, 10, 50, + 90.000000000000000 }, + { -140863522.18342155, 10, 50, + 100.00000000000000 }, +}; + +// Test function for n=10, m=50. +template <typename Tp> +void test039() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data039) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data039[i].n), Tp(data039[i].m), + Tp(data039[i].x)); + const Tp f0 = data039[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=10, m=100. +testcase_assoc_laguerre<double> data040[] = { + { 46897636623981.000, 10, 100, + 0.0000000000000000 }, + { 16444031323272.084, 10, 100, + 10.000000000000000 }, + { 5020343986463.5391, 10, 100, + 20.000000000000000 }, + { 1270977490645.2859, 10, 100, + 30.000000000000000 }, + { 244835756822.62262, 10, 100, + 40.000000000000000 }, + { 29786827693.962963, 10, 100, + 50.000000000000000 }, + { 1127612095.2857144, 10, 100, + 60.000000000000000 }, + { -66370555.419753075, 10, 100, + 70.000000000000000 }, + { 10420852.957671957, 10, 100, + 80.000000000000000 }, + { -3373097.5714285718, 10, 100, + 90.000000000000000 }, + { 2065423.6807760142, 10, 100, + 100.00000000000000 }, +}; + +// Test function for n=10, m=100. +template <typename Tp> +void test040() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data040) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data040[i].n), Tp(data040[i].m), + Tp(data040[i].x)); + const Tp f0 = data040[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=20, m=0. +testcase_assoc_laguerre<double> data041[] = { + { 1.0000000000000000, 20, 0, + 0.0000000000000000 }, + { -11.961333867812119, 20, 0, + 10.000000000000000 }, + { 2829.4728613531738, 20, 0, + 20.000000000000000 }, + { -18439.424502520938, 20, 0, + 30.000000000000000 }, + { 24799805.877530701, 20, 0, + 40.000000000000000 }, + { 7551960453.7672529, 20, 0, + 50.000000000000000 }, + { -1379223608444.9155, 20, 0, + 60.000000000000000 }, + { 165423821874449.94, 20, 0, + 70.000000000000000 }, + { 29500368536981676., 20, 0, + 80.000000000000000 }, + { 1.1292309514432899e+18, 20, 0, + 90.000000000000000 }, + { 2.2061882785931735e+19, 20, 0, + 100.00000000000000 }, +}; + +// Test function for n=20, m=0. +template <typename Tp> +void test041() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data041) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data041[i].n), Tp(data041[i].m), + Tp(data041[i].x)); + const Tp f0 = data041[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=20, m=1. +testcase_assoc_laguerre<double> data042[] = { + { 21.000000000000000, 20, 1, + 0.0000000000000000 }, + { 19.900488129734079, 20, 1, + 10.000000000000000 }, + { 2208.0318569557589, 20, 1, + 20.000000000000000 }, + { 263690.96303121914, 20, 1, + 30.000000000000000 }, + { 40667285.630564235, 20, 1, + 40.000000000000000 }, + { 1737442572.8115418, 20, 1, + 50.000000000000000 }, + { -588280953643.28125, 20, 1, + 60.000000000000000 }, + { 45617733778241.359, 20, 1, + 70.000000000000000 }, + { 17293487114876860., 20, 1, + 80.000000000000000 }, + { 7.6219135858585024e+17, 20, 1, + 90.000000000000000 }, + { 1.6037288204336759e+19, 20, 1, + 100.00000000000000 }, +}; + +// Test function for n=20, m=1. +template <typename Tp> +void test042() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data042) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data042[i].n), Tp(data042[i].m), + Tp(data042[i].x)); + const Tp f0 = data042[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=20, m=2. +testcase_assoc_laguerre<double> data043[] = { + { 231.00000000000003, 20, 2, + 0.0000000000000000 }, + { 47.009338065112935, 20, 2, + 10.000000000000000 }, + { -652.51305461728566, 20, 2, + 20.000000000000000 }, + { 285388.25895069109, 20, 2, + 30.000000000000000 }, + { 28664069.685624726, 20, 2, + 40.000000000000000 }, + { -1399631966.3144732, 20, 2, + 50.000000000000000 }, + { -115357373248.28198, 20, 2, + 60.000000000000000 }, + { -3357730872975.8545, 20, 2, + 70.000000000000000 }, + { 9765808962855122.0, 20, 2, + 80.000000000000000 }, + { 5.0717292945559181e+17, 20, 2, + 90.000000000000000 }, + { 1.1564665701334458e+19, 20, 2, + 100.00000000000000 }, +}; + +// Test function for n=20, m=2. +template <typename Tp> +void test043() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data043) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data043[i].n), Tp(data043[i].m), + Tp(data043[i].x)); + const Tp f0 = data043[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=20, m=5. +testcase_assoc_laguerre<double> data044[] = { + { 53130.000000000000, 20, 5, + 0.0000000000000000 }, + { -158.69554500944145, 20, 5, + 10.000000000000000 }, + { 334.08012288038969, 20, 5, + 20.000000000000000 }, + { -198372.47662554169, 20, 5, + 30.000000000000000 }, + { -13627144.088579427, 20, 5, + 40.000000000000000 }, + { -780579985.44731593, 20, 5, + 50.000000000000000 }, + { 116648634237.73526, 20, 5, + 60.000000000000000 }, + { -12347348707739.742, 20, 5, + 70.000000000000000 }, + { 1199516248034090.8, 20, 5, + 80.000000000000000 }, + { 1.3451503195078531e+17, 20, 5, + 90.000000000000000 }, + { 4.1058904276111483e+18, 20, 5, + 100.00000000000000 }, +}; + +// Test function for n=20, m=5. +template <typename Tp> +void test044() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data044) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data044[i].n), Tp(data044[i].m), + Tp(data044[i].x)); + const Tp f0 = data044[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=20, m=10. +testcase_assoc_laguerre<double> data045[] = { + { 30045015.000000000, 20, 10, + 0.0000000000000000 }, + { -1755.6226861258590, 20, 10, + 10.000000000000000 }, + { -9081.6726644737901, 20, 10, + 20.000000000000000 }, + { 95771.650912113109, 20, 10, + 30.000000000000000 }, + { 5089151.9272779226, 20, 10, + 40.000000000000000 }, + { 97400399.450206712, 20, 10, + 50.000000000000000 }, + { -16009352450.477026, 20, 10, + 60.000000000000000 }, + { 842271286905.01038, 20, 10, + 70.000000000000000 }, + { -79901725466796.938, 20, 10, + 80.000000000000000 }, + { 7944103675858638.0, 20, 10, + 90.000000000000000 }, + { 5.7429821893388288e+17, 20, 10, + 100.00000000000000 }, +}; + +// Test function for n=20, m=10. +template <typename Tp> +void test045() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data045) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data045[i].n), Tp(data045[i].m), + Tp(data045[i].x)); + const Tp f0 = data045[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=20, m=20. +testcase_assoc_laguerre<double> data046[] = { + { 137846528819.99994, 20, 20, + 0.0000000000000000 }, + { -136976.49571333214, 20, 20, + 10.000000000000000 }, + { 113878.49908041637, 20, 20, + 20.000000000000000 }, + { -342529.21778796182, 20, 20, + 30.000000000000000 }, + { -350112.66981443466, 20, 20, + 40.000000000000000 }, + { -10791735.172977794, 20, 20, + 50.000000000000000 }, + { -1038073940.0811402, 20, 20, + 60.000000000000000 }, + { 667312550.63616371, 20, 20, + 70.000000000000000 }, + { 741537869902.29028, 20, 20, + 80.000000000000000 }, + { -32378376755737.418, 20, 20, + 90.000000000000000 }, + { -601760332167934.75, 20, 20, + 100.00000000000000 }, +}; + +// Test function for n=20, m=20. +template <typename Tp> +void test046() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data046) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data046[i].n), Tp(data046[i].m), + Tp(data046[i].x)); + const Tp f0 = data046[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=20, m=50. +testcase_assoc_laguerre<double> data047[] = { + { 1.6188460366265789e+17, 20, 50, + 0.0000000000000000 }, + { 1599011936804291.5, 20, 50, + 10.000000000000000 }, + { -131273880831.42412, 20, 50, + 20.000000000000000 }, + { -3133213093.6903501, 20, 50, + 30.000000000000000 }, + { -213935628.04985175, 20, 50, + 40.000000000000000 }, + { -47375578.495921209, 20, 50, + 50.000000000000000 }, + { -115731015.14034875, 20, 50, + 60.000000000000000 }, + { -737415147.29420292, 20, 50, + 70.000000000000000 }, + { -2123455626.8621781, 20, 50, + 80.000000000000000 }, + { 29801266858.608925, 20, 50, + 90.000000000000000 }, + { -132886631026.82561, 20, 50, + 100.00000000000000 }, +}; + +// Test function for n=20, m=50. +template <typename Tp> +void test047() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data047) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data047[i].n), Tp(data047[i].m), + Tp(data047[i].x)); + const Tp f0 = data047[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=20, m=100. +testcase_assoc_laguerre<double> data048[] = { + { 2.9462227291176643e+22, 20, 100, + 0.0000000000000000 }, + { 3.5777890748701244e+21, 20, 100, + 10.000000000000000 }, + { 3.1584925521456765e+20, 20, 100, + 20.000000000000000 }, + { 1.7389599388424860e+19, 20, 100, + 30.000000000000000 }, + { 4.1401342745980646e+17, 20, 100, + 40.000000000000000 }, + { -79359706102062.672, 20, 100, + 50.000000000000000 }, + { 22736203650743.145, 20, 100, + 60.000000000000000 }, + { 65679006380.095215, 20, 100, + 70.000000000000000 }, + { -236263257610.77969, 20, 100, + 80.000000000000000 }, + { -38072644585.303085, 20, 100, + 90.000000000000000 }, + { 68236474365.173950, 20, 100, + 100.00000000000000 }, +}; + +// Test function for n=20, m=100. +template <typename Tp> +void test048() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data048) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data048[i].n), Tp(data048[i].m), + Tp(data048[i].x)); + const Tp f0 = data048[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for n=50, m=0. +testcase_assoc_laguerre<double> data049[] = { + { 1.0000000000000000, 50, 0, + 0.0000000000000000 }, + { 17.534183446338233, 50, 0, + 10.000000000000000 }, + { 980.26961889790766, 50, 0, + 20.000000000000000 }, + { 293000.50735962350, 50, 0, + 30.000000000000000 }, + { -14896937.968694847, 50, 0, + 40.000000000000000 }, + { 2513677852.6916885, 50, 0, + 50.000000000000000 }, + { -883876565337.99207, 50, 0, + 60.000000000000000 }, + { -80967880733583.219, 50, 0, + 70.000000000000000 }, + { -8217471769564850.0, 50, 0, + 80.000000000000000 }, + { -2.1140031308048906e+18, 50, 0, + 90.000000000000000 }, + { -3.9710103487094673e+20, 50, 0, + 100.00000000000000 }, +}; + +// Test function for n=50, m=0. +template <typename Tp> +void test049() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data049) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data049[i].n), Tp(data049[i].m), + Tp(data049[i].x)); + const Tp f0 = data049[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=50, m=1. +testcase_assoc_laguerre<double> data050[] = { + { 51.000000000000021, 50, 1, + 0.0000000000000000 }, + { 1.4214573271640045, 50, 1, + 10.000000000000000 }, + { -2574.8072295127863, 50, 1, + 20.000000000000000 }, + { 35846.479728359256, 50, 1, + 30.000000000000000 }, + { -48263698.768318526, 50, 1, + 40.000000000000000 }, + { 6161525870.2738571, 50, 1, + 50.000000000000000 }, + { -382655486658.47101, 50, 1, + 60.000000000000000 }, + { -109635579833241.69, 50, 1, + 70.000000000000000 }, + { -14623805817283476., 50, 1, + 80.000000000000000 }, + { -2.0666847190878118e+18, 50, 1, + 90.000000000000000 }, + { -1.4385187953997626e+20, 50, 1, + 100.00000000000000 }, +}; + +// Test function for n=50, m=1. +template <typename Tp> +void test050() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data050) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data050[i].n), Tp(data050[i].m), + Tp(data050[i].x)); + const Tp f0 = data050[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for n=50, m=2. +testcase_assoc_laguerre<double> data051[] = { + { 1326.0000000000000, 50, 2, + 0.0000000000000000 }, + { -87.860732516444671, 50, 2, + 10.000000000000000 }, + { -5203.2351191780890, 50, 2, + 20.000000000000000 }, + { -461059.50012538873, 50, 2, + 30.000000000000000 }, + { -30476695.327440601, 50, 2, + 40.000000000000000 }, + { 3720804977.9338136, 50, 2, + 50.000000000000000 }, + { 362262002434.51440, 50, 2, + 60.000000000000000 }, + { -52210917867820.273, 50, 2, + 70.000000000000000 }, + { -9567965136901918.0, 50, 2, + 80.000000000000000 }, + { -8.9171277517712806e+17, 50, 2, + 90.000000000000000 }, + { 5.7231129448807039e+19, 50, 2, + 100.00000000000000 }, +}; + +// Test function for n=50, m=2. +template <typename Tp> +void test051() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data051) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data051[i].n), Tp(data051[i].m), + Tp(data051[i].x)); + const Tp f0 = data051[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=50, m=5. +testcase_assoc_laguerre<double> data052[] = { + { 3478761.0000000000, 50, 5, + 0.0000000000000000 }, + { 1055.8381917651493, 50, 5, + 10.000000000000000 }, + { 15264.646660345048, 50, 5, + 20.000000000000000 }, + { 1229651.8966600855, 50, 5, + 30.000000000000000 }, + { 39270451.823656857, 50, 5, + 40.000000000000000 }, + { -4424062601.1152067, 50, 5, + 50.000000000000000 }, + { -186017434284.19220, 50, 5, + 60.000000000000000 }, + { 50972853949302.602, 50, 5, + 70.000000000000000 }, + { 6530702754012518.0, 50, 5, + 80.000000000000000 }, + { 6.8387592714678016e+17, 50, 5, + 90.000000000000000 }, + { 3.9198742504338366e+19, 50, 5, + 100.00000000000000 }, +}; + +// Test function for n=50, m=5. +template <typename Tp> +void test052() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data052) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data052[i].n), Tp(data052[i].m), + Tp(data052[i].x)); + const Tp f0 = data052[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=50, m=10. +testcase_assoc_laguerre<double> data053[] = { + { 75394027565.999985, 50, 10, + 0.0000000000000000 }, + { 91833.924098770134, 50, 10, + 10.000000000000000 }, + { 330501.87929778261, 50, 10, + 20.000000000000000 }, + { 3625088.1635972545, 50, 10, + 30.000000000000000 }, + { 213954727.28632003, 50, 10, + 40.000000000000000 }, + { -9381006937.7517643, 50, 10, + 50.000000000000000 }, + { 535333683777.48627, 50, 10, + 60.000000000000000 }, + { 18824406573722.156, 50, 10, + 70.000000000000000 }, + { -533858276780012.81, 50, 10, + 80.000000000000000 }, + { -52995774666704024., 50, 10, + 90.000000000000000 }, + { 6.0504182862448855e+18, 50, 10, + 100.00000000000000 }, +}; + +// Test function for n=50, m=10. +template <typename Tp> +void test053() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data053) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data053[i].n), Tp(data053[i].m), + Tp(data053[i].x)); + const Tp f0 = data053[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=50, m=20. +testcase_assoc_laguerre<double> data054[] = { + { 1.6188460366265779e+17, 50, 20, + 0.0000000000000000 }, + { -307637087.25169420, 50, 20, + 10.000000000000000 }, + { 12524651.102974579, 50, 20, + 20.000000000000000 }, + { -315460483.86210549, 50, 20, + 30.000000000000000 }, + { -1889683587.3459976, 50, 20, + 40.000000000000000 }, + { 37457044404.200340, 50, 20, + 50.000000000000000 }, + { -843831858224.71826, 50, 20, + 60.000000000000000 }, + { -92231643172.313248, 50, 20, + 70.000000000000000 }, + { 904211757769501.25, 50, 20, + 80.000000000000000 }, + { 46508193600283288., 50, 20, + 90.000000000000000 }, + { 2.3216887928162714e+18, 50, 20, + 100.00000000000000 }, +}; + +// Test function for n=50, m=20. +template <typename Tp> +void test054() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data054) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data054[i].n), Tp(data054[i].m), + Tp(data054[i].x)); + const Tp f0 = data054[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for n=50, m=50. +testcase_assoc_laguerre<double> data055[] = { + { 1.0089134454556417e+29, 50, 50, + 0.0000000000000000 }, + { 1.3822795753070569e+23, 50, 50, + 10.000000000000000 }, + { 95817260381628416., 50, 50, + 20.000000000000000 }, + { -910798580856013.88, 50, 50, + 30.000000000000000 }, + { 50513254049166.719, 50, 50, + 40.000000000000000 }, + { 84159703903349.859, 50, 50, + 50.000000000000000 }, + { -138805244691822.69, 50, 50, + 60.000000000000000 }, + { 181046391269246.25, 50, 50, + 70.000000000000000 }, + { 2086884905317107.2, 50, 50, + 80.000000000000000 }, + { -2765620139862432.5, 50, 50, + 90.000000000000000 }, + { -1.3706751678146291e+17, 50, 50, + 100.00000000000000 }, +}; + +// Test function for n=50, m=50. +template <typename Tp> +void test055() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data055) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data055[i].n), Tp(data055[i].m), + Tp(data055[i].x)); + const Tp f0 = data055[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for n=50, m=100. +testcase_assoc_laguerre<double> data056[] = { + { 2.0128660909731929e+40, 50, 100, + 0.0000000000000000 }, + { 9.3675094807695474e+37, 50, 100, + 10.000000000000000 }, + { 1.3009321481877196e+35, 50, 100, + 20.000000000000000 }, + { 7.3720026893233823e+30, 50, 100, + 30.000000000000000 }, + { -6.0824679079634607e+25, 50, 100, + 40.000000000000000 }, + { -6.0053188793543624e+23, 50, 100, + 50.000000000000000 }, + { 1.4178129287264701e+22, 50, 100, + 60.000000000000000 }, + { -5.4652099341566765e+20, 50, 100, + 70.000000000000000 }, + { -1.0817271759263398e+20, 50, 100, + 80.000000000000000 }, + { 3.8058734007924187e+19, 50, 100, + 90.000000000000000 }, + { 4.7439240848028353e+19, 50, 100, + 100.00000000000000 }, +}; + +// Test function for n=50, m=100. +template <typename Tp> +void test056() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data056) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data056[i].n), Tp(data056[i].m), + Tp(data056[i].x)); + const Tp f0 = data056[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for n=100, m=0. +testcase_assoc_laguerre<double> data057[] = { + { 1.0000000000000000, 100, 0, + 0.0000000000000000 }, + { 13.277662844303402, 100, 0, + 10.000000000000000 }, + { 1854.0367283243393, 100, 0, + 20.000000000000000 }, + { 170141.86987046539, 100, 0, + 30.000000000000000 }, + { -7272442.3156007063, 100, 0, + 40.000000000000000 }, + { 4847420871.2690468, 100, 0, + 50.000000000000000 }, + { 693492765740.29736, 100, 0, + 60.000000000000000 }, + { 17125518672239.707, 100, 0, + 70.000000000000000 }, + { -13763178176383754., 100, 0, + 80.000000000000000 }, + { 2.1307220490380198e+18, 100, 0, + 90.000000000000000 }, + { -2.6292260693068920e+20, 100, 0, + 100.00000000000000 }, +}; + +// Test function for n=100, m=0. +template <typename Tp> +void test057() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data057) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data057[i].n), Tp(data057[i].m), + Tp(data057[i].x)); + const Tp f0 = data057[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=100, m=1. +testcase_assoc_laguerre<double> data058[] = { + { 101.00000000000003, 100, 1, + 0.0000000000000000 }, + { -14.650661983680466, 100, 1, + 10.000000000000000 }, + { 1626.5010939361609, 100, 1, + 20.000000000000000 }, + { 417884.77658268705, 100, 1, + 30.000000000000000 }, + { -55617646.951649830, 100, 1, + 40.000000000000000 }, + { 884829874.26626098, 100, 1, + 50.000000000000000 }, + { 154466082750.32114, 100, 1, + 60.000000000000000 }, + { -101423973484646.05, 100, 1, + 70.000000000000000 }, + { -1388352348671755.5, 100, 1, + 80.000000000000000 }, + { 7.8048705513268326e+17, 100, 1, + 90.000000000000000 }, + { 1.6948925059042787e+19, 100, 1, + 100.00000000000000 }, +}; + +// Test function for n=100, m=1. +template <typename Tp> +void test058() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data058) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data058[i].n), Tp(data058[i].m), + Tp(data058[i].x)); + const Tp f0 = data058[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=100, m=2. +testcase_assoc_laguerre<double> data059[] = { + { 5151.0000000000055, 100, 2, + 0.0000000000000000 }, + { -150.22012290951341, 100, 2, + 10.000000000000000 }, + { -7655.0593294049440, 100, 2, + 20.000000000000000 }, + { -140996.69276179170, 100, 2, + 30.000000000000000 }, + { -38645171.278549291, 100, 2, + 40.000000000000000 }, + { -8889263688.2118778, 100, 2, + 50.000000000000000 }, + { -1010338971533.3397, 100, 2, + 60.000000000000000 }, + { -127582564332943.91, 100, 2, + 70.000000000000000 }, + { 15970305694654336., 100, 2, + 80.000000000000000 }, + { -1.6019844992862840e+18, 100, 2, + 90.000000000000000 }, + { 2.8267024730962919e+20, 100, 2, + 100.00000000000000 }, +}; + +// Test function for n=100, m=2. +template <typename Tp> +void test059() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data059) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data059[i].n), Tp(data059[i].m), + Tp(data059[i].x)); + const Tp f0 = data059[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=100, m=5. +testcase_assoc_laguerre<double> data060[] = { + { 96560646.000000030, 100, 5, + 0.0000000000000000 }, + { 2430.6732236677576, 100, 5, + 10.000000000000000 }, + { 111162.32026994640, 100, 5, + 20.000000000000000 }, + { 4036708.2599413753, 100, 5, + 30.000000000000000 }, + { -34055982.664405435, 100, 5, + 40.000000000000000 }, + { 30110688343.562344, 100, 5, + 50.000000000000000 }, + { 2651429940558.2920, 100, 5, + 60.000000000000000 }, + { 192108556058942.84, 100, 5, + 70.000000000000000 }, + { -25410533973455528., 100, 5, + 80.000000000000000 }, + { 2.1072955633564431e+18, 100, 5, + 90.000000000000000 }, + { -2.9434005355877260e+20, 100, 5, + 100.00000000000000 }, +}; + +// Test function for n=100, m=5. +template <typename Tp> +void test060() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data060) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data060[i].n), Tp(data060[i].m), + Tp(data060[i].x)); + const Tp f0 = data060[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for n=100, m=10. +testcase_assoc_laguerre<double> data061[] = { + { 46897636623981.039, 100, 10, + 0.0000000000000000 }, + { 529208.11550990446, 100, 10, + 10.000000000000000 }, + { 7402892.1748803742, 100, 10, + 20.000000000000000 }, + { 88369632.083243459, 100, 10, + 30.000000000000000 }, + { 822187797.59096730, 100, 10, + 40.000000000000000 }, + { 180231446033.06866, 100, 10, + 50.000000000000000 }, + { 7922942703798.1309, 100, 10, + 60.000000000000000 }, + { 784424250559043.38, 100, 10, + 70.000000000000000 }, + { -16325634720239362., 100, 10, + 80.000000000000000 }, + { -1.0879588307443181e+18, 100, 10, + 90.000000000000000 }, + { 3.0114394463610495e+19, 100, 10, + 100.00000000000000 }, +}; + +// Test function for n=100, m=10. +template <typename Tp> +void test061() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data061) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data061[i].n), Tp(data061[i].m), + Tp(data061[i].x)); + const Tp f0 = data061[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=100, m=20. +testcase_assoc_laguerre<double> data062[] = { + { 2.9462227291176614e+22, 100, 20, + 0.0000000000000000 }, + { 313694958939.90436, 100, 20, + 10.000000000000000 }, + { 45396489338.096252, 100, 20, + 20.000000000000000 }, + { -7215826758.0078783, 100, 20, + 30.000000000000000 }, + { 825949194005.88831, 100, 20, + 40.000000000000000 }, + { -2764742119971.0747, 100, 20, + 50.000000000000000 }, + { -219802198273516.03, 100, 20, + 60.000000000000000 }, + { -1699053306145266.0, 100, 20, + 70.000000000000000 }, + { 3.5495709345023853e+17, 100, 20, + 80.000000000000000 }, + { -9.6128675110292439e+18, 100, 20, + 90.000000000000000 }, + { 4.3619868422072153e+20, 100, 20, + 100.00000000000000 }, +}; + +// Test function for n=100, m=20. +template <typename Tp> +void test062() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data062) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data062[i].n), Tp(data062[i].m), + Tp(data062[i].x)); + const Tp f0 = data062[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=100, m=50. +testcase_assoc_laguerre<double> data063[] = { + { 2.0128660909731931e+40, 100, 50, + 0.0000000000000000 }, + { -4.0151443913473681e+28, 100, 50, + 10.000000000000000 }, + { 3.2199632594552201e+22, 100, 50, + 20.000000000000000 }, + { -2.7568702092659717e+20, 100, 50, + 30.000000000000000 }, + { 7.5553066015421530e+19, 100, 50, + 40.000000000000000 }, + { -2.7651625252388041e+19, 100, 50, + 50.000000000000000 }, + { -5.8963680147283821e+19, 100, 50, + 60.000000000000000 }, + { -1.8082798163033126e+20, 100, 50, + 70.000000000000000 }, + { -3.9044276986817249e+20, 100, 50, + 80.000000000000000 }, + { 6.9926310700401904e+21, 100, 50, + 90.000000000000000 }, + { -5.5727272809923697e+22, 100, 50, + 100.00000000000000 }, +}; + +// Test function for n=100, m=50. +template <typename Tp> +void test063() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data063) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data063[i].n), Tp(data063[i].m), + Tp(data063[i].x)); + const Tp f0 = data063[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=100, m=100. +testcase_assoc_laguerre<double> data064[] = { + { 9.0548514656103225e+58, 100, 100, + 0.0000000000000000 }, + { 1.3334078033060576e+54, 100, 100, + 10.000000000000000 }, + { 2.1002639254211231e+46, 100, 100, + 20.000000000000000 }, + { -1.1073158068796240e+39, 100, 100, + 30.000000000000000 }, + { -8.3640937363981405e+35, 100, 100, + 40.000000000000000 }, + { -6.5879339429312671e+32, 100, 100, + 50.000000000000000 }, + { -2.4190645077698453e+30, 100, 100, + 60.000000000000000 }, + { -7.9224960465662002e+29, 100, 100, + 70.000000000000000 }, + { -2.8605772478408853e+29, 100, 100, + 80.000000000000000 }, + { 2.4149589189610125e+28, 100, 100, + 90.000000000000000 }, + { 5.1146476014859003e+28, 100, 100, + 100.00000000000000 }, +}; + +// Test function for n=100, m=100. +template <typename Tp> +void test064() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data064) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data064[i].n), Tp(data064[i].m), + Tp(data064[i].x)); + const Tp f0 = data064[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + test037<double>(); + test038<double>(); + test039<double>(); + test040<double>(); + test041<double>(); + test042<double>(); + test043<double>(); + test044<double>(); + test045<double>(); + test046<double>(); + test047<double>(); + test048<double>(); + test049<double>(); + test050<double>(); + test051<double>(); + test052<double>(); + test053<double>(); + test054<double>(); + test055<double>(); + test056<double>(); + test057<double>(); + test058<double>(); + test059<double>(); + test060<double>(); + test061<double>(); + test062<double>(); + test063<double>(); + test064<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile.cc new file mode 100644 index 000000000..4725126da --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.1 assoc_laguerre + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 2, m = 1; + + std::tr1::assoc_laguerre(n, m, xf); + std::tr1::assoc_laguerref(n, m, xf); + std::tr1::assoc_laguerre(n, m, xd); + std::tr1::assoc_laguerre(n, m, xl); + std::tr1::assoc_laguerrel(n, m, xl); + + return; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile_2.cc new file mode 100644 index 000000000..eabad0587 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile_2.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.1 assoc_laguerre + +#include <tr1/math.h> + +void +test01() +{ + + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 2, m = 1; + + assoc_laguerre(n, m, xf); + assoc_laguerref(n, m, xf); + assoc_laguerre(n, m, xd); + assoc_laguerre(n, m, xl); + assoc_laguerrel(n, m, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_nan.cc new file mode 100644 index 000000000..ced0f907b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_nan.cc @@ -0,0 +1,59 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.2 assoc_legendre + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + unsigned int l = 2, m = 1; + + float a = std::tr1::assoc_legendre(l, m, xf); + float b = std::tr1::assoc_legendref(l, m, xf); + double c = std::tr1::assoc_legendre(l, m, xd); + long double d = std::tr1::assoc_legendre(l, m, xl); + long double e = std::tr1::assoc_legendrel(l, m, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_value.cc new file mode 100644 index 000000000..f93a4c936 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_value.cc @@ -0,0 +1,2745 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// assoc_legendre + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for l=0, m=0. +testcase_assoc_legendre<double> data001[] = { + { 1.0000000000000000, 0, 0, + -1.0000000000000000 }, + { 1.0000000000000000, 0, 0, + -0.90000000000000002 }, + { 1.0000000000000000, 0, 0, + -0.80000000000000004 }, + { 1.0000000000000000, 0, 0, + -0.69999999999999996 }, + { 1.0000000000000000, 0, 0, + -0.59999999999999998 }, + { 1.0000000000000000, 0, 0, + -0.50000000000000000 }, + { 1.0000000000000000, 0, 0, + -0.40000000000000002 }, + { 1.0000000000000000, 0, 0, + -0.30000000000000004 }, + { 1.0000000000000000, 0, 0, + -0.19999999999999996 }, + { 1.0000000000000000, 0, 0, + -0.099999999999999978 }, + { 1.0000000000000000, 0, 0, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 0, + 0.10000000000000009 }, + { 1.0000000000000000, 0, 0, + 0.19999999999999996 }, + { 1.0000000000000000, 0, 0, + 0.30000000000000004 }, + { 1.0000000000000000, 0, 0, + 0.39999999999999991 }, + { 1.0000000000000000, 0, 0, + 0.50000000000000000 }, + { 1.0000000000000000, 0, 0, + 0.60000000000000009 }, + { 1.0000000000000000, 0, 0, + 0.69999999999999996 }, + { 1.0000000000000000, 0, 0, + 0.80000000000000004 }, + { 1.0000000000000000, 0, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 0, 0, + 1.0000000000000000 }, +}; + +// Test function for l=0, m=0. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data001[i].l), Tp(data001[i].m), + Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=1, m=0. +testcase_assoc_legendre<double> data002[] = { + { -1.0000000000000000, 1, 0, + -1.0000000000000000 }, + { -0.90000000000000002, 1, 0, + -0.90000000000000002 }, + { -0.80000000000000004, 1, 0, + -0.80000000000000004 }, + { -0.69999999999999996, 1, 0, + -0.69999999999999996 }, + { -0.59999999999999998, 1, 0, + -0.59999999999999998 }, + { -0.50000000000000000, 1, 0, + -0.50000000000000000 }, + { -0.40000000000000002, 1, 0, + -0.40000000000000002 }, + { -0.30000000000000004, 1, 0, + -0.30000000000000004 }, + { -0.19999999999999996, 1, 0, + -0.19999999999999996 }, + { -0.099999999999999978, 1, 0, + -0.099999999999999978 }, + { 0.0000000000000000, 1, 0, + 0.0000000000000000 }, + { 0.10000000000000009, 1, 0, + 0.10000000000000009 }, + { 0.19999999999999996, 1, 0, + 0.19999999999999996 }, + { 0.30000000000000004, 1, 0, + 0.30000000000000004 }, + { 0.39999999999999991, 1, 0, + 0.39999999999999991 }, + { 0.50000000000000000, 1, 0, + 0.50000000000000000 }, + { 0.60000000000000009, 1, 0, + 0.60000000000000009 }, + { 0.69999999999999996, 1, 0, + 0.69999999999999996 }, + { 0.80000000000000004, 1, 0, + 0.80000000000000004 }, + { 0.89999999999999991, 1, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 1, 0, + 1.0000000000000000 }, +}; + +// Test function for l=1, m=0. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data002[i].l), Tp(data002[i].m), + Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=1, m=1. +testcase_assoc_legendre<double> data003[] = { + { -0.0000000000000000, 1, 1, + -1.0000000000000000 }, + { -0.43588989435406728, 1, 1, + -0.90000000000000002 }, + { -0.59999999999999987, 1, 1, + -0.80000000000000004 }, + { -0.71414284285428509, 1, 1, + -0.69999999999999996 }, + { -0.80000000000000004, 1, 1, + -0.59999999999999998 }, + { -0.86602540378443860, 1, 1, + -0.50000000000000000 }, + { -0.91651513899116799, 1, 1, + -0.40000000000000002 }, + { -0.95393920141694577, 1, 1, + -0.30000000000000004 }, + { -0.97979589711327120, 1, 1, + -0.19999999999999996 }, + { -0.99498743710661997, 1, 1, + -0.099999999999999978 }, + { -1.0000000000000000, 1, 1, + 0.0000000000000000 }, + { -0.99498743710661997, 1, 1, + 0.10000000000000009 }, + { -0.97979589711327120, 1, 1, + 0.19999999999999996 }, + { -0.95393920141694577, 1, 1, + 0.30000000000000004 }, + { -0.91651513899116799, 1, 1, + 0.39999999999999991 }, + { -0.86602540378443860, 1, 1, + 0.50000000000000000 }, + { -0.79999999999999993, 1, 1, + 0.60000000000000009 }, + { -0.71414284285428509, 1, 1, + 0.69999999999999996 }, + { -0.59999999999999987, 1, 1, + 0.80000000000000004 }, + { -0.43588989435406750, 1, 1, + 0.89999999999999991 }, + { -0.0000000000000000, 1, 1, + 1.0000000000000000 }, +}; + +// Test function for l=1, m=1. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data003[i].l), Tp(data003[i].m), + Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=2, m=0. +testcase_assoc_legendre<double> data004[] = { + { 1.0000000000000000, 2, 0, + -1.0000000000000000 }, + { 0.71500000000000008, 2, 0, + -0.90000000000000002 }, + { 0.46000000000000019, 2, 0, + -0.80000000000000004 }, + { 0.23499999999999982, 2, 0, + -0.69999999999999996 }, + { 0.039999999999999925, 2, 0, + -0.59999999999999998 }, + { -0.12500000000000000, 2, 0, + -0.50000000000000000 }, + { -0.25999999999999995, 2, 0, + -0.40000000000000002 }, + { -0.36499999999999994, 2, 0, + -0.30000000000000004 }, + { -0.44000000000000000, 2, 0, + -0.19999999999999996 }, + { -0.48499999999999999, 2, 0, + -0.099999999999999978 }, + { -0.50000000000000000, 2, 0, + 0.0000000000000000 }, + { -0.48499999999999999, 2, 0, + 0.10000000000000009 }, + { -0.44000000000000000, 2, 0, + 0.19999999999999996 }, + { -0.36499999999999994, 2, 0, + 0.30000000000000004 }, + { -0.26000000000000012, 2, 0, + 0.39999999999999991 }, + { -0.12500000000000000, 2, 0, + 0.50000000000000000 }, + { 0.040000000000000160, 2, 0, + 0.60000000000000009 }, + { 0.23499999999999982, 2, 0, + 0.69999999999999996 }, + { 0.46000000000000019, 2, 0, + 0.80000000000000004 }, + { 0.71499999999999975, 2, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 2, 0, + 1.0000000000000000 }, +}; + +// Test function for l=2, m=0. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data004[i].l), Tp(data004[i].m), + Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=2, m=1. +testcase_assoc_legendre<double> data005[] = { + { 0.0000000000000000, 2, 1, + -1.0000000000000000 }, + { 1.1769027147559816, 2, 1, + -0.90000000000000002 }, + { 1.4399999999999999, 2, 1, + -0.80000000000000004 }, + { 1.4996999699939983, 2, 1, + -0.69999999999999996 }, + { 1.4399999999999999, 2, 1, + -0.59999999999999998 }, + { 1.2990381056766580, 2, 1, + -0.50000000000000000 }, + { 1.0998181667894018, 2, 1, + -0.40000000000000002 }, + { 0.85854528127525132, 2, 1, + -0.30000000000000004 }, + { 0.58787753826796263, 2, 1, + -0.19999999999999996 }, + { 0.29849623113198592, 2, 1, + -0.099999999999999978 }, + { -0.0000000000000000, 2, 1, + 0.0000000000000000 }, + { -0.29849623113198626, 2, 1, + 0.10000000000000009 }, + { -0.58787753826796263, 2, 1, + 0.19999999999999996 }, + { -0.85854528127525132, 2, 1, + 0.30000000000000004 }, + { -1.0998181667894014, 2, 1, + 0.39999999999999991 }, + { -1.2990381056766580, 2, 1, + 0.50000000000000000 }, + { -1.4400000000000002, 2, 1, + 0.60000000000000009 }, + { -1.4996999699939983, 2, 1, + 0.69999999999999996 }, + { -1.4399999999999999, 2, 1, + 0.80000000000000004 }, + { -1.1769027147559821, 2, 1, + 0.89999999999999991 }, + { -0.0000000000000000, 2, 1, + 1.0000000000000000 }, +}; + +// Test function for l=2, m=1. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data005[i].l), Tp(data005[i].m), + Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=2, m=2. +testcase_assoc_legendre<double> data006[] = { + { 0.0000000000000000, 2, 2, + -1.0000000000000000 }, + { 0.56999999999999984, 2, 2, + -0.90000000000000002 }, + { 1.0799999999999996, 2, 2, + -0.80000000000000004 }, + { 1.5300000000000005, 2, 2, + -0.69999999999999996 }, + { 1.9200000000000004, 2, 2, + -0.59999999999999998 }, + { 2.2500000000000000, 2, 2, + -0.50000000000000000 }, + { 2.5200000000000000, 2, 2, + -0.40000000000000002 }, + { 2.7300000000000004, 2, 2, + -0.30000000000000004 }, + { 2.8799999999999999, 2, 2, + -0.19999999999999996 }, + { 2.9700000000000002, 2, 2, + -0.099999999999999978 }, + { 3.0000000000000000, 2, 2, + 0.0000000000000000 }, + { 2.9700000000000002, 2, 2, + 0.10000000000000009 }, + { 2.8799999999999999, 2, 2, + 0.19999999999999996 }, + { 2.7300000000000004, 2, 2, + 0.30000000000000004 }, + { 2.5200000000000000, 2, 2, + 0.39999999999999991 }, + { 2.2500000000000000, 2, 2, + 0.50000000000000000 }, + { 1.9199999999999997, 2, 2, + 0.60000000000000009 }, + { 1.5300000000000005, 2, 2, + 0.69999999999999996 }, + { 1.0799999999999996, 2, 2, + 0.80000000000000004 }, + { 0.57000000000000040, 2, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 2, 2, + 1.0000000000000000 }, +}; + +// Test function for l=2, m=2. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data006[i].l), Tp(data006[i].m), + Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5, m=0. +testcase_assoc_legendre<double> data007[] = { + { -1.0000000000000000, 5, 0, + -1.0000000000000000 }, + { 0.041141249999999997, 5, 0, + -0.90000000000000002 }, + { 0.39951999999999993, 5, 0, + -0.80000000000000004 }, + { 0.36519874999999991, 5, 0, + -0.69999999999999996 }, + { 0.15263999999999994, 5, 0, + -0.59999999999999998 }, + { -0.089843750000000000, 5, 0, + -0.50000000000000000 }, + { -0.27063999999999988, 5, 0, + -0.40000000000000002 }, + { -0.34538624999999995, 5, 0, + -0.30000000000000004 }, + { -0.30751999999999996, 5, 0, + -0.19999999999999996 }, + { -0.17882874999999995, 5, 0, + -0.099999999999999978 }, + { 0.0000000000000000, 5, 0, + 0.0000000000000000 }, + { 0.17882875000000015, 5, 0, + 0.10000000000000009 }, + { 0.30751999999999996, 5, 0, + 0.19999999999999996 }, + { 0.34538624999999995, 5, 0, + 0.30000000000000004 }, + { 0.27064000000000010, 5, 0, + 0.39999999999999991 }, + { 0.089843750000000000, 5, 0, + 0.50000000000000000 }, + { -0.15264000000000022, 5, 0, + 0.60000000000000009 }, + { -0.36519874999999991, 5, 0, + 0.69999999999999996 }, + { -0.39951999999999993, 5, 0, + 0.80000000000000004 }, + { -0.041141250000000407, 5, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 5, 0, + 1.0000000000000000 }, +}; + +// Test function for l=5, m=0. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data007[i].l), Tp(data007[i].m), + Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5, m=1. +testcase_assoc_legendre<double> data008[] = { + { 0.0000000000000000, 5, 1, + -1.0000000000000000 }, + { -2.8099369608350973, 5, 1, + -0.90000000000000002 }, + { -0.72180000000000089, 5, 1, + -0.80000000000000004 }, + { 1.0951826834447254, 5, 1, + -0.69999999999999996 }, + { 1.9775999999999998, 5, 1, + -0.59999999999999998 }, + { 1.9282596881137892, 5, 1, + -0.50000000000000000 }, + { 1.2070504380513685, 5, 1, + -0.40000000000000002 }, + { 0.16079837663884430, 5, 1, + -0.30000000000000004 }, + { -0.87005875663658538, 5, 1, + -0.19999999999999996 }, + { -1.6083350053680323, 5, 1, + -0.099999999999999978 }, + { -1.8750000000000000, 5, 1, + 0.0000000000000000 }, + { -1.6083350053680314, 5, 1, + 0.10000000000000009 }, + { -0.87005875663658538, 5, 1, + 0.19999999999999996 }, + { 0.16079837663884430, 5, 1, + 0.30000000000000004 }, + { 1.2070504380513674, 5, 1, + 0.39999999999999991 }, + { 1.9282596881137892, 5, 1, + 0.50000000000000000 }, + { 1.9775999999999996, 5, 1, + 0.60000000000000009 }, + { 1.0951826834447254, 5, 1, + 0.69999999999999996 }, + { -0.72180000000000089, 5, 1, + 0.80000000000000004 }, + { -2.8099369608350959, 5, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 5, 1, + 1.0000000000000000 }, +}; + +// Test function for l=5, m=1. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data008[i].l), Tp(data008[i].m), + Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5, m=2. +testcase_assoc_legendre<double> data009[] = { + { 0.0000000000000000, 5, 2, + -1.0000000000000000 }, + { -12.837824999999995, 5, 2, + -0.90000000000000002 }, + { -13.910399999999997, 5, 2, + -0.80000000000000004 }, + { -8.8089749999999984, 5, 2, + -0.69999999999999996 }, + { -1.6128000000000009, 5, 2, + -0.59999999999999998 }, + { 4.9218750000000000, 5, 2, + -0.50000000000000000 }, + { 9.1728000000000005, 5, 2, + -0.40000000000000002 }, + { 10.462725000000001, 5, 2, + -0.30000000000000004 }, + { 8.8703999999999983, 5, 2, + -0.19999999999999996 }, + { 5.0415749999999999, 5, 2, + -0.099999999999999978 }, + { -0.0000000000000000, 5, 2, + 0.0000000000000000 }, + { -5.0415750000000044, 5, 2, + 0.10000000000000009 }, + { -8.8703999999999983, 5, 2, + 0.19999999999999996 }, + { -10.462725000000001, 5, 2, + 0.30000000000000004 }, + { -9.1728000000000005, 5, 2, + 0.39999999999999991 }, + { -4.9218750000000000, 5, 2, + 0.50000000000000000 }, + { 1.6128000000000071, 5, 2, + 0.60000000000000009 }, + { 8.8089749999999984, 5, 2, + 0.69999999999999996 }, + { 13.910399999999997, 5, 2, + 0.80000000000000004 }, + { 12.837825000000004, 5, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 5, 2, + 1.0000000000000000 }, +}; + +// Test function for l=5, m=2. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data009[i].l), Tp(data009[i].m), + Tp(data009[i].x)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5, m=5. +testcase_assoc_legendre<double> data010[] = { + { -0.0000000000000000, 5, 5, + -1.0000000000000000 }, + { -14.870165800941818, 5, 5, + -0.90000000000000002 }, + { -73.483199999999925, 5, 5, + -0.80000000000000004 }, + { -175.53238298794764, 5, 5, + -0.69999999999999996 }, + { -309.65760000000006, 5, 5, + -0.59999999999999998 }, + { -460.34662869916559, 5, 5, + -0.50000000000000000 }, + { -611.12496255819883, 5, 5, + -0.40000000000000002 }, + { -746.50941479523760, 5, 5, + -0.30000000000000004 }, + { -853.31600434671316, 5, 5, + -0.19999999999999996 }, + { -921.55189181724734, 5, 5, + -0.099999999999999978 }, + { -945.00000000000000, 5, 5, + 0.0000000000000000 }, + { -921.55189181724734, 5, 5, + 0.10000000000000009 }, + { -853.31600434671316, 5, 5, + 0.19999999999999996 }, + { -746.50941479523760, 5, 5, + 0.30000000000000004 }, + { -611.12496255819883, 5, 5, + 0.39999999999999991 }, + { -460.34662869916559, 5, 5, + 0.50000000000000000 }, + { -309.65759999999989, 5, 5, + 0.60000000000000009 }, + { -175.53238298794764, 5, 5, + 0.69999999999999996 }, + { -73.483199999999925, 5, 5, + 0.80000000000000004 }, + { -14.870165800941855, 5, 5, + 0.89999999999999991 }, + { -0.0000000000000000, 5, 5, + 1.0000000000000000 }, +}; + +// Test function for l=5, m=5. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data010[i].l), Tp(data010[i].m), + Tp(data010[i].x)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10, m=0. +testcase_assoc_legendre<double> data011[] = { + { 1.0000000000000000, 10, 0, + -1.0000000000000000 }, + { -0.26314561785585977, 10, 0, + -0.90000000000000002 }, + { 0.30052979559999998, 10, 0, + -0.80000000000000004 }, + { 0.085805795531640333, 10, 0, + -0.69999999999999996 }, + { -0.24366274560000006, 10, 0, + -0.59999999999999998 }, + { -0.18822860717773438, 10, 0, + -0.50000000000000000 }, + { 0.096839064399999869, 10, 0, + -0.40000000000000002 }, + { 0.25147634951601561, 10, 0, + -0.30000000000000004 }, + { 0.12907202559999989, 10, 0, + -0.19999999999999996 }, + { -0.12212499738710947, 10, 0, + -0.099999999999999978 }, + { -0.24609375000000000, 10, 0, + 0.0000000000000000 }, + { -0.12212499738710922, 10, 0, + 0.10000000000000009 }, + { 0.12907202559999989, 10, 0, + 0.19999999999999996 }, + { 0.25147634951601561, 10, 0, + 0.30000000000000004 }, + { 0.096839064400000258, 10, 0, + 0.39999999999999991 }, + { -0.18822860717773438, 10, 0, + 0.50000000000000000 }, + { -0.24366274559999987, 10, 0, + 0.60000000000000009 }, + { 0.085805795531640333, 10, 0, + 0.69999999999999996 }, + { 0.30052979559999998, 10, 0, + 0.80000000000000004 }, + { -0.26314561785585888, 10, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 10, 0, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=0. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data011[i].l), Tp(data011[i].m), + Tp(data011[i].x)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10, m=1. +testcase_assoc_legendre<double> data012[] = { + { -0.0000000000000000, 10, 1, + -1.0000000000000000 }, + { -3.0438748781479061, 10, 1, + -0.90000000000000002 }, + { -0.87614260800000199, 10, 1, + -0.80000000000000004 }, + { 2.9685359952934522, 10, 1, + -0.69999999999999996 }, + { 1.2511825919999990, 10, 1, + -0.59999999999999998 }, + { -2.0066877394361260, 10, 1, + -0.50000000000000000 }, + { -2.4822196173476661, 10, 1, + -0.40000000000000002 }, + { -0.12309508907433941, 10, 1, + -0.30000000000000004 }, + { 2.2468221751958408, 10, 1, + -0.19999999999999996 }, + { 2.2472659777983512, 10, 1, + -0.099999999999999978 }, + { -0.0000000000000000, 10, 1, + 0.0000000000000000 }, + { -2.2472659777983530, 10, 1, + 0.10000000000000009 }, + { -2.2468221751958408, 10, 1, + 0.19999999999999996 }, + { 0.12309508907433941, 10, 1, + 0.30000000000000004 }, + { 2.4822196173476643, 10, 1, + 0.39999999999999991 }, + { 2.0066877394361260, 10, 1, + 0.50000000000000000 }, + { -1.2511825920000037, 10, 1, + 0.60000000000000009 }, + { -2.9685359952934522, 10, 1, + 0.69999999999999996 }, + { 0.87614260800000199, 10, 1, + 0.80000000000000004 }, + { 3.0438748781479110, 10, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 10, 1, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=1. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data012[i].l), Tp(data012[i].m), + Tp(data012[i].x)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10, m=2. +testcase_assoc_legendre<double> data013[] = { + { 0.0000000000000000, 10, 2, + -1.0000000000000000 }, + { 16.376387762496122, 10, 2, + -0.90000000000000002 }, + { -35.394657803999991, 10, 2, + -0.80000000000000004 }, + { -3.6191429423788892, 10, 2, + -0.69999999999999996 }, + { 28.679675904000010, 10, 2, + -0.59999999999999998 }, + { 18.388023376464844, 10, 2, + -0.50000000000000000 }, + { -12.818955995999996, 10, 2, + -0.40000000000000002 }, + { -27.739821675972660, 10, 2, + -0.30000000000000004 }, + { -13.280661503999987, 10, 2, + -0.19999999999999996 }, + { 13.885467170308596, 10, 2, + -0.099999999999999978 }, + { 27.070312500000000, 10, 2, + 0.0000000000000000 }, + { 13.885467170308573, 10, 2, + 0.10000000000000009 }, + { -13.280661503999987, 10, 2, + 0.19999999999999996 }, + { -27.739821675972660, 10, 2, + 0.30000000000000004 }, + { -12.818955996000019, 10, 2, + 0.39999999999999991 }, + { 18.388023376464844, 10, 2, + 0.50000000000000000 }, + { 28.679675903999982, 10, 2, + 0.60000000000000009 }, + { -3.6191429423788892, 10, 2, + 0.69999999999999996 }, + { -35.394657803999991, 10, 2, + 0.80000000000000004 }, + { 16.376387762495984, 10, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 10, 2, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=2. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data013[i].l), Tp(data013[i].m), + Tp(data013[i].x)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=10, m=5. +testcase_assoc_legendre<double> data014[] = { + { 0.0000000000000000, 10, 5, + -1.0000000000000000 }, + { 21343.618518164669, 10, 5, + -0.90000000000000002 }, + { 40457.016407807983, 10, 5, + -0.80000000000000004 }, + { 20321.279317331318, 10, 5, + -0.69999999999999996 }, + { -14410.820616192013, 10, 5, + -0.59999999999999998 }, + { -30086.169706116176, 10, 5, + -0.50000000000000000 }, + { -17177.549337582859, 10, 5, + -0.40000000000000002 }, + { 9272.5119495412346, 10, 5, + -0.30000000000000004 }, + { 26591.511184414714, 10, 5, + -0.19999999999999996 }, + { 21961.951238504211, 10, 5, + -0.099999999999999978 }, + { -0.0000000000000000, 10, 5, + 0.0000000000000000 }, + { -21961.951238504229, 10, 5, + 0.10000000000000009 }, + { -26591.511184414714, 10, 5, + 0.19999999999999996 }, + { -9272.5119495412346, 10, 5, + 0.30000000000000004 }, + { 17177.549337582830, 10, 5, + 0.39999999999999991 }, + { 30086.169706116176, 10, 5, + 0.50000000000000000 }, + { 14410.820616191975, 10, 5, + 0.60000000000000009 }, + { -20321.279317331318, 10, 5, + 0.69999999999999996 }, + { -40457.016407807983, 10, 5, + 0.80000000000000004 }, + { -21343.618518164698, 10, 5, + 0.89999999999999991 }, + { 0.0000000000000000, 10, 5, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=5. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data014[i].l), Tp(data014[i].m), + Tp(data014[i].x)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10, m=10. +testcase_assoc_legendre<double> data015[] = { + { 0.0000000000000000, 10, 10, + -1.0000000000000000 }, + { 162117.40078784220, 10, 10, + -0.90000000000000002 }, + { 3958896.3481267113, 10, 10, + -0.80000000000000004 }, + { 22589806.343887307, 10, 10, + -0.69999999999999996 }, + { 70300999.121633321, 10, 10, + -0.59999999999999998 }, + { 155370278.54003900, 10, 10, + -0.50000000000000000 }, + { 273815518.20150518, 10, 10, + -0.40000000000000002 }, + { 408571989.13158917, 10, 10, + -0.30000000000000004 }, + { 533848212.07990247, 10, 10, + -0.19999999999999996 }, + { 622640835.70523083, 10, 10, + -0.099999999999999978 }, + { 654729075.00000000, 10, 10, + 0.0000000000000000 }, + { 622640835.70523083, 10, 10, + 0.10000000000000009 }, + { 533848212.07990247, 10, 10, + 0.19999999999999996 }, + { 408571989.13158917, 10, 10, + 0.30000000000000004 }, + { 273815518.20150518, 10, 10, + 0.39999999999999991 }, + { 155370278.54003900, 10, 10, + 0.50000000000000000 }, + { 70300999.121633217, 10, 10, + 0.60000000000000009 }, + { 22589806.343887307, 10, 10, + 0.69999999999999996 }, + { 3958896.3481267113, 10, 10, + 0.80000000000000004 }, + { 162117.40078784304, 10, 10, + 0.89999999999999991 }, + { 0.0000000000000000, 10, 10, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=10. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data015[i].l), Tp(data015[i].m), + Tp(data015[i].x)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20, m=0. +testcase_assoc_legendre<double> data016[] = { + { 1.0000000000000000, 20, 0, + -1.0000000000000000 }, + { -0.14930823530984821, 20, 0, + -0.90000000000000002 }, + { 0.22420460541741344, 20, 0, + -0.80000000000000004 }, + { -0.20457394463834172, 20, 0, + -0.69999999999999996 }, + { 0.15916752910098114, 20, 0, + -0.59999999999999998 }, + { -0.048358381067373557, 20, 0, + -0.50000000000000000 }, + { -0.10159261558628156, 20, 0, + -0.40000000000000002 }, + { 0.18028715947998047, 20, 0, + -0.30000000000000004 }, + { -0.098042194344594741, 20, 0, + -0.19999999999999996 }, + { -0.082077130944527649, 20, 0, + -0.099999999999999978 }, + { 0.17619705200195312, 20, 0, + 0.0000000000000000 }, + { -0.082077130944528037, 20, 0, + 0.10000000000000009 }, + { -0.098042194344594741, 20, 0, + 0.19999999999999996 }, + { 0.18028715947998047, 20, 0, + 0.30000000000000004 }, + { -0.10159261558628112, 20, 0, + 0.39999999999999991 }, + { -0.048358381067373557, 20, 0, + 0.50000000000000000 }, + { 0.15916752910098084, 20, 0, + 0.60000000000000009 }, + { -0.20457394463834172, 20, 0, + 0.69999999999999996 }, + { 0.22420460541741344, 20, 0, + 0.80000000000000004 }, + { -0.14930823530984949, 20, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 20, 0, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=0. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data016[i].l), Tp(data016[i].m), + Tp(data016[i].x)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20, m=1. +testcase_assoc_legendre<double> data017[] = { + { 0.0000000000000000, 20, 1, + -1.0000000000000000 }, + { 4.3838334818220490, 20, 1, + -0.90000000000000002 }, + { -0.63138296146340556, 20, 1, + -0.80000000000000004 }, + { 0.72274871413391228, 20, 1, + -0.69999999999999996 }, + { -2.3203528743824893, 20, 1, + -0.59999999999999998 }, + { 3.7399919228791405, 20, 1, + -0.50000000000000000 }, + { -3.1692202279270028, 20, 1, + -0.40000000000000002 }, + { 0.15804468835344049, 20, 1, + -0.30000000000000004 }, + { 3.0366182393271162, 20, 1, + -0.19999999999999996 }, + { -3.2115523815580209, 20, 1, + -0.099999999999999978 }, + { 0.0000000000000000, 20, 1, + 0.0000000000000000 }, + { 3.2115523815580160, 20, 1, + 0.10000000000000009 }, + { -3.0366182393271162, 20, 1, + 0.19999999999999996 }, + { -0.15804468835344049, 20, 1, + 0.30000000000000004 }, + { 3.1692202279270076, 20, 1, + 0.39999999999999991 }, + { -3.7399919228791405, 20, 1, + 0.50000000000000000 }, + { 2.3203528743825008, 20, 1, + 0.60000000000000009 }, + { -0.72274871413391228, 20, 1, + 0.69999999999999996 }, + { 0.63138296146340556, 20, 1, + 0.80000000000000004 }, + { -4.3838334818220304, 20, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 1, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=1. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data017[i].l), Tp(data017[i].m), + Tp(data017[i].x)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=20, m=2. +testcase_assoc_legendre<double> data018[] = { + { 0.0000000000000000, 20, 2, + -1.0000000000000000 }, + { 80.812425587310116, 20, 2, + -0.90000000000000002 }, + { -95.849622172549317, 20, 2, + -0.80000000000000004 }, + { 87.337927630325510, 20, 2, + -0.69999999999999996 }, + { -70.330891533985834, 20, 2, + -0.59999999999999998 }, + { 24.629090735179489, 20, 2, + -0.50000000000000000 }, + { 39.902576338912418, 20, 2, + -0.40000000000000002 }, + { -75.621201471396589, 20, 2, + -0.30000000000000004 }, + { 42.417415829726487, 20, 2, + -0.19999999999999996 }, + { 33.826848678871301, 20, 2, + -0.099999999999999978 }, + { -74.002761840820312, 20, 2, + 0.0000000000000000 }, + { 33.826848678871457, 20, 2, + 0.10000000000000009 }, + { 42.417415829726487, 20, 2, + 0.19999999999999996 }, + { -75.621201471396589, 20, 2, + 0.30000000000000004 }, + { 39.902576338912240, 20, 2, + 0.39999999999999991 }, + { 24.629090735179489, 20, 2, + 0.50000000000000000 }, + { -70.330891533985664, 20, 2, + 0.60000000000000009 }, + { 87.337927630325510, 20, 2, + 0.69999999999999996 }, + { -95.849622172549317, 20, 2, + 0.80000000000000004 }, + { 80.812425587310585, 20, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 2, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=2. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data018[i].l), Tp(data018[i].m), + Tp(data018[i].x)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20, m=5. +testcase_assoc_legendre<double> data019[] = { + { -0.0000000000000000, 20, 5, + -1.0000000000000000 }, + { -315702.32715134107, 20, 5, + -0.90000000000000002 }, + { 503060.91484852595, 20, 5, + -0.80000000000000004 }, + { -298127.28360361949, 20, 5, + -0.69999999999999996 }, + { -114444.61447464002, 20, 5, + -0.59999999999999998 }, + { 543428.40914592857, 20, 5, + -0.50000000000000000 }, + { -613842.07728185481, 20, 5, + -0.40000000000000002 }, + { 143765.42411270953, 20, 5, + -0.30000000000000004 }, + { 472600.45321372297, 20, 5, + -0.19999999999999996 }, + { -563861.76771496492, 20, 5, + -0.099999999999999978 }, + { 0.0000000000000000, 20, 5, + 0.0000000000000000 }, + { 563861.76771496458, 20, 5, + 0.10000000000000009 }, + { -472600.45321372297, 20, 5, + 0.19999999999999996 }, + { -143765.42411270953, 20, 5, + 0.30000000000000004 }, + { 613842.07728185505, 20, 5, + 0.39999999999999991 }, + { -543428.40914592857, 20, 5, + 0.50000000000000000 }, + { 114444.61447464184, 20, 5, + 0.60000000000000009 }, + { 298127.28360361949, 20, 5, + 0.69999999999999996 }, + { -503060.91484852595, 20, 5, + 0.80000000000000004 }, + { 315702.32715134590, 20, 5, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 5, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=5. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data019[i].l), Tp(data019[i].m), + Tp(data019[i].x)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20, m=10. +testcase_assoc_legendre<double> data020[] = { + { -0.0000000000000000, 20, 10, + -1.0000000000000000 }, + { 990017476694.99084, 20, 10, + -0.90000000000000002 }, + { 2392757933281.0503, 20, 10, + -0.80000000000000004 }, + { -1548364524949.5808, 20, 10, + -0.69999999999999996 }, + { -424471915195.05609, 20, 10, + -0.59999999999999998 }, + { 1744502295946.2065, 20, 10, + -0.50000000000000000 }, + { -899973487310.55212, 20, 10, + -0.40000000000000002 }, + { -1092420454297.7164, 20, 10, + -0.30000000000000004 }, + { 1466609267659.8816, 20, 10, + -0.19999999999999996 }, + { 356041756390.71661, 20, 10, + -0.099999999999999978 }, + { -1612052956674.3164, 20, 10, + 0.0000000000000000 }, + { 356041756390.71985, 20, 10, + 0.10000000000000009 }, + { 1466609267659.8816, 20, 10, + 0.19999999999999996 }, + { -1092420454297.7164, 20, 10, + 0.30000000000000004 }, + { -899973487310.55469, 20, 10, + 0.39999999999999991 }, + { 1744502295946.2065, 20, 10, + 0.50000000000000000 }, + { -424471915195.05914, 20, 10, + 0.60000000000000009 }, + { -1548364524949.5808, 20, 10, + 0.69999999999999996 }, + { 2392757933281.0503, 20, 10, + 0.80000000000000004 }, + { 990017476694.99353, 20, 10, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 10, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=10. +template <typename Tp> +void test020() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data020) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data020[i].l), Tp(data020[i].m), + Tp(data020[i].x)); + const Tp f0 = data020[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20, m=20. +testcase_assoc_legendre<double> data021[] = { + { 0.0000000000000000, 20, 20, + -1.0000000000000000 }, + { 19609049712023808., 20, 20, + -0.90000000000000002 }, + { 1.1693527616833221e+19, 20, 20, + -0.80000000000000004 }, + { 3.8073455880620691e+20, 20, 20, + -0.69999999999999996 }, + { 3.6874002249007927e+21, 20, 20, + -0.59999999999999998 }, + { 1.8010806978179592e+22, 20, 20, + -0.50000000000000000 }, + { 5.5938832584012466e+22, 20, 20, + -0.40000000000000002 }, + { 1.2454734132297811e+23, 20, 20, + -0.30000000000000004 }, + { 2.1263407800797497e+23, 20, 20, + -0.19999999999999996 }, + { 2.8924941146976873e+23, 20, 20, + -0.099999999999999978 }, + { 3.1983098677287775e+23, 20, 20, + 0.0000000000000000 }, + { 2.8924941146976873e+23, 20, 20, + 0.10000000000000009 }, + { 2.1263407800797497e+23, 20, 20, + 0.19999999999999996 }, + { 1.2454734132297811e+23, 20, 20, + 0.30000000000000004 }, + { 5.5938832584012466e+22, 20, 20, + 0.39999999999999991 }, + { 1.8010806978179592e+22, 20, 20, + 0.50000000000000000 }, + { 3.6874002249007807e+21, 20, 20, + 0.60000000000000009 }, + { 3.8073455880620691e+20, 20, 20, + 0.69999999999999996 }, + { 1.1693527616833221e+19, 20, 20, + 0.80000000000000004 }, + { 19609049712024020., 20, 20, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 20, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=20. +template <typename Tp> +void test021() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data021) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data021[i].l), Tp(data021[i].m), + Tp(data021[i].x)); + const Tp f0 = data021[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=50, m=0. +testcase_assoc_legendre<double> data022[] = { + { 1.0000000000000000, 50, 0, + -1.0000000000000000 }, + { -0.17003765994383685, 50, 0, + -0.90000000000000002 }, + { 0.13879737345093118, 50, 0, + -0.80000000000000004 }, + { -0.014572731645892805, 50, 0, + -0.69999999999999996 }, + { -0.058860798844002173, 50, 0, + -0.59999999999999998 }, + { -0.031059099239609828, 50, 0, + -0.50000000000000000 }, + { 0.041569033381825368, 50, 0, + -0.40000000000000002 }, + { 0.10911051574714808, 50, 0, + -0.30000000000000004 }, + { 0.083432272204197466, 50, 0, + -0.19999999999999996 }, + { -0.038205812661313579, 50, 0, + -0.099999999999999978 }, + { -0.11227517265921705, 50, 0, + 0.0000000000000000 }, + { -0.038205812661314169, 50, 0, + 0.10000000000000009 }, + { 0.083432272204197466, 50, 0, + 0.19999999999999996 }, + { 0.10911051574714808, 50, 0, + 0.30000000000000004 }, + { 0.041569033381824647, 50, 0, + 0.39999999999999991 }, + { -0.031059099239609828, 50, 0, + 0.50000000000000000 }, + { -0.058860798844001430, 50, 0, + 0.60000000000000009 }, + { -0.014572731645892805, 50, 0, + 0.69999999999999996 }, + { 0.13879737345093118, 50, 0, + 0.80000000000000004 }, + { -0.17003765994383663, 50, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 50, 0, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=0. +template <typename Tp> +void test022() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data022) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data022[i].l), Tp(data022[i].m), + Tp(data022[i].x)); + const Tp f0 = data022[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=50, m=1. +testcase_assoc_legendre<double> data023[] = { + { 0.0000000000000000, 50, 1, + -1.0000000000000000 }, + { -0.13424149984450387, 50, 1, + -0.90000000000000002 }, + { 2.2011219672413085, 50, 1, + -0.80000000000000004 }, + { 6.6622414993232013, 50, 1, + -0.69999999999999996 }, + { 5.5772846936919231, 50, 1, + -0.59999999999999998 }, + { 5.8787148815607617, 50, 1, + -0.50000000000000000 }, + { 5.5473459458634000, 50, 1, + -0.40000000000000002 }, + { 1.8444956647619912, 50, 1, + -0.30000000000000004 }, + { -3.8722014306642150, 50, 1, + -0.19999999999999996 }, + { -5.3488751322285593, 50, 1, + -0.099999999999999978 }, + { -0.0000000000000000, 50, 1, + 0.0000000000000000 }, + { 5.3488751322285459, 50, 1, + 0.10000000000000009 }, + { 3.8722014306642150, 50, 1, + 0.19999999999999996 }, + { -1.8444956647619912, 50, 1, + 0.30000000000000004 }, + { -5.5473459458634098, 50, 1, + 0.39999999999999991 }, + { -5.8787148815607617, 50, 1, + 0.50000000000000000 }, + { -5.5772846936919489, 50, 1, + 0.60000000000000009 }, + { -6.6622414993232013, 50, 1, + 0.69999999999999996 }, + { -2.2011219672413085, 50, 1, + 0.80000000000000004 }, + { 0.13424149984460862, 50, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 1, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=1. +template <typename Tp> +void test023() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data023) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data023[i].l), Tp(data023[i].m), + Tp(data023[i].x)); + const Tp f0 = data023[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for l=50, m=2. +testcase_assoc_legendre<double> data024[] = { + { 0.0000000000000000, 50, 2, + -1.0000000000000000 }, + { 433.04168483713448, 50, 2, + -0.90000000000000002 }, + { -348.06364372056390, 50, 2, + -0.80000000000000004 }, + { 50.221071418108465, 50, 2, + -0.69999999999999996 }, + { 158.46096409274341, 50, 2, + -0.59999999999999998 }, + { 85.988858299721414, 50, 2, + -0.50000000000000000 }, + { -101.15891460879277, 50, 2, + -0.40000000000000002 }, + { -277.07168105316612, 50, 2, + -0.30000000000000004 }, + { -214.33311373510401, 50, 2, + -0.19999999999999996 }, + { 96.349657930951722, 50, 2, + -0.099999999999999978 }, + { 286.30169028100346, 50, 2, + 0.0000000000000000 }, + { 96.349657930953285, 50, 2, + 0.10000000000000009 }, + { -214.33311373510401, 50, 2, + 0.19999999999999996 }, + { -277.07168105316612, 50, 2, + 0.30000000000000004 }, + { -101.15891460879106, 50, 2, + 0.39999999999999991 }, + { 85.988858299721414, 50, 2, + 0.50000000000000000 }, + { 158.46096409274131, 50, 2, + 0.60000000000000009 }, + { 50.221071418108465, 50, 2, + 0.69999999999999996 }, + { -348.06364372056390, 50, 2, + 0.80000000000000004 }, + { 433.04168483713414, 50, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 2, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=2. +template <typename Tp> +void test024() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data024) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data024[i].l), Tp(data024[i].m), + Tp(data024[i].x)); + const Tp f0 = data024[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=50, m=5. +testcase_assoc_legendre<double> data025[] = { + { -0.0000000000000000, 50, 5, + -1.0000000000000000 }, + { -27340473.952132788, 50, 5, + -0.90000000000000002 }, + { 27753716.768532373, 50, 5, + -0.80000000000000004 }, + { 40808153.913493626, 50, 5, + -0.69999999999999996 }, + { 32071189.035790101, 50, 5, + -0.59999999999999998 }, + { 36265736.218529105, 50, 5, + -0.50000000000000000 }, + { 37089596.700204894, 50, 5, + -0.40000000000000002 }, + { 14562029.629244510, 50, 5, + -0.30000000000000004 }, + { -23686895.217517227, 50, 5, + -0.19999999999999996 }, + { -34878992.965676002, 50, 5, + -0.099999999999999978 }, + { -0.0000000000000000, 50, 5, + 0.0000000000000000 }, + { 34878992.965675950, 50, 5, + 0.10000000000000009 }, + { 23686895.217517227, 50, 5, + 0.19999999999999996 }, + { -14562029.629244510, 50, 5, + 0.30000000000000004 }, + { -37089596.700204931, 50, 5, + 0.39999999999999991 }, + { -36265736.218529105, 50, 5, + 0.50000000000000000 }, + { -32071189.035790265, 50, 5, + 0.60000000000000009 }, + { -40808153.913493626, 50, 5, + 0.69999999999999996 }, + { -27753716.768532373, 50, 5, + 0.80000000000000004 }, + { 27340473.952133406, 50, 5, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 5, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=5. +template <typename Tp> +void test025() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data025) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data025[i].l), Tp(data025[i].m), + Tp(data025[i].x)); + const Tp f0 = data025[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=50, m=10. +testcase_assoc_legendre<double> data026[] = { + { -0.0000000000000000, 50, 10, + -1.0000000000000000 }, + { -8994661710093158.0, 50, 10, + -0.90000000000000002 }, + { 932311375306557.00, 50, 10, + -0.80000000000000004 }, + { 12153535011507012., 50, 10, + -0.69999999999999996 }, + { 12176690755542244., 50, 10, + -0.59999999999999998 }, + { 9180035388465752.0, 50, 10, + -0.50000000000000000 }, + { 889201701866911.12, 50, 10, + -0.40000000000000002 }, + { -9451384032851600.0, 50, 10, + -0.30000000000000004 }, + { -9926439446673564.0, 50, 10, + -0.19999999999999996 }, + { 2794368162749970.5, 50, 10, + -0.099999999999999978 }, + { 11452238249246346., 50, 10, + 0.0000000000000000 }, + { 2794368162750031.0, 50, 10, + 0.10000000000000009 }, + { -9926439446673564.0, 50, 10, + 0.19999999999999996 }, + { -9451384032851600.0, 50, 10, + 0.30000000000000004 }, + { 889201701866976.25, 50, 10, + 0.39999999999999991 }, + { 9180035388465752.0, 50, 10, + 0.50000000000000000 }, + { 12176690755542216., 50, 10, + 0.60000000000000009 }, + { 12153535011507012., 50, 10, + 0.69999999999999996 }, + { 932311375306557.00, 50, 10, + 0.80000000000000004 }, + { -8994661710093322.0, 50, 10, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 10, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=10. +template <typename Tp> +void test026() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data026) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data026[i].l), Tp(data026[i].m), + Tp(data026[i].x)); + const Tp f0 = data026[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for l=50, m=20. +testcase_assoc_legendre<double> data027[] = { + { 0.0000000000000000, 50, 20, + -1.0000000000000000 }, + { 1.6630925158645460e+33, 50, 20, + -0.90000000000000002 }, + { 1.0622676657892043e+33, 50, 20, + -0.80000000000000004 }, + { 8.6022521164717170e+32, 50, 20, + -0.69999999999999996 }, + { 4.0860128756808430e+32, 50, 20, + -0.59999999999999998 }, + { -4.0169860814274409e+32, 50, 20, + -0.50000000000000000 }, + { -8.2324325279774008e+32, 50, 20, + -0.40000000000000002 }, + { -4.0054067236243299e+31, 50, 20, + -0.30000000000000004 }, + { 7.9309266056434309e+32, 50, 20, + -0.19999999999999996 }, + { 5.4151358290899148e+31, 50, 20, + -0.099999999999999978 }, + { -7.8735935697332210e+32, 50, 20, + 0.0000000000000000 }, + { 5.4151358290895032e+31, 50, 20, + 0.10000000000000009 }, + { 7.9309266056434309e+32, 50, 20, + 0.19999999999999996 }, + { -4.0054067236243299e+31, 50, 20, + 0.30000000000000004 }, + { -8.2324325279773965e+32, 50, 20, + 0.39999999999999991 }, + { -4.0169860814274409e+32, 50, 20, + 0.50000000000000000 }, + { 4.0860128756807882e+32, 50, 20, + 0.60000000000000009 }, + { 8.6022521164717170e+32, 50, 20, + 0.69999999999999996 }, + { 1.0622676657892043e+33, 50, 20, + 0.80000000000000004 }, + { 1.6630925158645483e+33, 50, 20, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 20, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=20. +template <typename Tp> +void test027() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data027) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data027[i].l), Tp(data027[i].m), + Tp(data027[i].x)); + const Tp f0 = data027[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for l=50, m=50. +testcase_assoc_legendre<double> data028[] = { + { 0.0000000000000000, 50, 50, + -1.0000000000000000 }, + { 2.5366994974431341e+60, 50, 50, + -0.90000000000000002 }, + { 2.2028834403101213e+67, 50, 50, + -0.80000000000000004 }, + { 1.3325496559566651e+71, 50, 50, + -0.69999999999999996 }, + { 3.8898096431781969e+73, 50, 50, + -0.59999999999999998 }, + { 2.0509760257037188e+75, 50, 50, + -0.50000000000000000 }, + { 3.4866724533443283e+76, 50, 50, + -0.40000000000000002 }, + { 2.5790740224150207e+77, 50, 50, + -0.30000000000000004 }, + { 9.8222237931680989e+77, 50, 50, + -0.19999999999999996 }, + { 2.1198682190366617e+78, 50, 50, + -0.099999999999999978 }, + { 2.7253921397507295e+78, 50, 50, + 0.0000000000000000 }, + { 2.1198682190366617e+78, 50, 50, + 0.10000000000000009 }, + { 9.8222237931680989e+77, 50, 50, + 0.19999999999999996 }, + { 2.5790740224150207e+77, 50, 50, + 0.30000000000000004 }, + { 3.4866724533443283e+76, 50, 50, + 0.39999999999999991 }, + { 2.0509760257037188e+75, 50, 50, + 0.50000000000000000 }, + { 3.8898096431781724e+73, 50, 50, + 0.60000000000000009 }, + { 1.3325496559566651e+71, 50, 50, + 0.69999999999999996 }, + { 2.2028834403101213e+67, 50, 50, + 0.80000000000000004 }, + { 2.5366994974431990e+60, 50, 50, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 50, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=50. +template <typename Tp> +void test028() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data028) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data028[i].l), Tp(data028[i].m), + Tp(data028[i].x)); + const Tp f0 = data028[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=100, m=0. +testcase_assoc_legendre<double> data029[] = { + { 1.0000000000000000, 100, 0, + -1.0000000000000000 }, + { 0.10226582055871908, 100, 0, + -0.90000000000000002 }, + { 0.050861167913584124, 100, 0, + -0.80000000000000004 }, + { -0.077132507199778780, 100, 0, + -0.69999999999999996 }, + { -0.023747023905133110, 100, 0, + -0.59999999999999998 }, + { -0.060518025961861198, 100, 0, + -0.50000000000000000 }, + { -0.072258202125684429, 100, 0, + -0.40000000000000002 }, + { 0.057127392202801719, 100, 0, + -0.30000000000000004 }, + { 0.014681835355659636, 100, 0, + -0.19999999999999996 }, + { -0.063895098434750303, 100, 0, + -0.099999999999999978 }, + { 0.079589237387178727, 100, 0, + 0.0000000000000000 }, + { -0.063895098434749775, 100, 0, + 0.10000000000000009 }, + { 0.014681835355659636, 100, 0, + 0.19999999999999996 }, + { 0.057127392202801719, 100, 0, + 0.30000000000000004 }, + { -0.072258202125685012, 100, 0, + 0.39999999999999991 }, + { -0.060518025961861198, 100, 0, + 0.50000000000000000 }, + { -0.023747023905134217, 100, 0, + 0.60000000000000009 }, + { -0.077132507199778780, 100, 0, + 0.69999999999999996 }, + { 0.050861167913584124, 100, 0, + 0.80000000000000004 }, + { 0.10226582055871723, 100, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 100, 0, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=0. +template <typename Tp> +void test029() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data029) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data029[i].l), Tp(data029[i].m), + Tp(data029[i].x)); + const Tp f0 = data029[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=100, m=1. +testcase_assoc_legendre<double> data030[] = { + { -0.0000000000000000, 100, 1, + -1.0000000000000000 }, + { 6.5200167187780309, 100, 1, + -0.90000000000000002 }, + { 9.0065170007027540, 100, 1, + -0.80000000000000004 }, + { -5.4690908541181056, 100, 1, + -0.69999999999999996 }, + { -8.6275439170430861, 100, 1, + -0.59999999999999998 }, + { -6.0909031663448499, 100, 1, + -0.50000000000000000 }, + { 4.1160338699561265, 100, 1, + -0.40000000000000002 }, + { 5.8491043010758004, 100, 1, + -0.30000000000000004 }, + { -7.9435138723089826, 100, 1, + -0.19999999999999996 }, + { 4.7996285823989346, 100, 1, + -0.099999999999999978 }, + { 0.0000000000000000, 100, 1, + 0.0000000000000000 }, + { -4.7996285823990057, 100, 1, + 0.10000000000000009 }, + { 7.9435138723089826, 100, 1, + 0.19999999999999996 }, + { -5.8491043010758004, 100, 1, + 0.30000000000000004 }, + { -4.1160338699560359, 100, 1, + 0.39999999999999991 }, + { 6.0909031663448499, 100, 1, + 0.50000000000000000 }, + { 8.6275439170430559, 100, 1, + 0.60000000000000009 }, + { 5.4690908541181056, 100, 1, + 0.69999999999999996 }, + { -9.0065170007027540, 100, 1, + 0.80000000000000004 }, + { -6.5200167187783133, 100, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 1, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=1. +template <typename Tp> +void test030() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data030) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data030[i].l), Tp(data030[i].m), + Tp(data030[i].x)); + const Tp f0 = data030[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=100, m=2. +testcase_assoc_legendre<double> data031[] = { + { 0.0000000000000000, 100, 2, + -1.0000000000000000 }, + { -1005.9604880761007, 100, 2, + -0.90000000000000002 }, + { -489.68041725865896, 100, 2, + -0.80000000000000004 }, + { 768.31676011669970, 100, 2, + -0.69999999999999996 }, + { 226.90362556628003, 100, 2, + -0.59999999999999998 }, + { 604.19889304940330, 100, 2, + -0.50000000000000000 }, + { 733.40061037838029, 100, 2, + -0.40000000000000002 }, + { -573.30774483996402, 100, 2, + -0.30000000000000004 }, + { -151.52946305080897, 100, 2, + -0.19999999999999996 }, + { 646.30525583588019, 100, 2, + -0.099999999999999978 }, + { -803.85129761050518, 100, 2, + 0.0000000000000000 }, + { 646.30525583587439, 100, 2, + 0.10000000000000009 }, + { -151.52946305080897, 100, 2, + 0.19999999999999996 }, + { -573.30774483996402, 100, 2, + 0.30000000000000004 }, + { 733.40061037838507, 100, 2, + 0.39999999999999991 }, + { 604.19889304940330, 100, 2, + 0.50000000000000000 }, + { 226.90362556629168, 100, 2, + 0.60000000000000009 }, + { 768.31676011669970, 100, 2, + 0.69999999999999996 }, + { -489.68041725865896, 100, 2, + 0.80000000000000004 }, + { -1005.9604880760811, 100, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 2, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=2. +template <typename Tp> +void test031() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data031) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data031[i].l), Tp(data031[i].m), + Tp(data031[i].x)); + const Tp f0 = data031[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=100, m=5. +testcase_assoc_legendre<double> data032[] = { + { 0.0000000000000000, 100, 5, + -1.0000000000000000 }, + { 900551126.09653592, 100, 5, + -0.90000000000000002 }, + { 988567431.55756044, 100, 5, + -0.80000000000000004 }, + { -645646451.90344620, 100, 5, + -0.69999999999999996 }, + { -897114585.29920745, 100, 5, + -0.59999999999999998 }, + { -661710744.42483830, 100, 5, + -0.50000000000000000 }, + { 380163158.51425594, 100, 5, + -0.40000000000000002 }, + { 617391071.36632609, 100, 5, + -0.30000000000000004 }, + { -805288801.85509181, 100, 5, + -0.19999999999999996 }, + { 481041740.16728652, 100, 5, + -0.099999999999999978 }, + { 0.0000000000000000, 100, 5, + 0.0000000000000000 }, + { -481041740.16729414, 100, 5, + 0.10000000000000009 }, + { 805288801.85509181, 100, 5, + 0.19999999999999996 }, + { -617391071.36632609, 100, 5, + 0.30000000000000004 }, + { -380163158.51424748, 100, 5, + 0.39999999999999991 }, + { 661710744.42483830, 100, 5, + 0.50000000000000000 }, + { 897114585.29920506, 100, 5, + 0.60000000000000009 }, + { 645646451.90344620, 100, 5, + 0.69999999999999996 }, + { -988567431.55756044, 100, 5, + 0.80000000000000004 }, + { -900551126.09655809, 100, 5, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 5, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=5. +template <typename Tp> +void test032() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data032) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data032[i].l), Tp(data032[i].m), + Tp(data032[i].x)); + const Tp f0 = data032[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=100, m=10. +testcase_assoc_legendre<double> data033[] = { + { 0.0000000000000000, 100, 10, + -1.0000000000000000 }, + { 2.5643395957658915e+17, 100, 10, + -0.90000000000000002 }, + { 1.5778673545673316e+18, 100, 10, + -0.80000000000000004 }, + { 4.4355048487496776e+18, 100, 10, + -0.69999999999999996 }, + { -9.5936111659124493e+17, 100, 10, + -0.59999999999999998 }, + { 4.2387123021963372e+18, 100, 10, + -0.50000000000000000 }, + { 8.2370834618426563e+18, 100, 10, + -0.40000000000000002 }, + { -4.9089358388052890e+18, 100, 10, + -0.30000000000000004 }, + { -2.3468810358091279e+18, 100, 10, + -0.19999999999999996 }, + { 6.8627855225034568e+18, 100, 10, + -0.099999999999999978 }, + { -8.2494597181670380e+18, 100, 10, + 0.0000000000000000 }, + { 6.8627855225034056e+18, 100, 10, + 0.10000000000000009 }, + { -2.3468810358091279e+18, 100, 10, + 0.19999999999999996 }, + { -4.9089358388052890e+18, 100, 10, + 0.30000000000000004 }, + { 8.2370834618426747e+18, 100, 10, + 0.39999999999999991 }, + { 4.2387123021963372e+18, 100, 10, + 0.50000000000000000 }, + { -9.5936111659112115e+17, 100, 10, + 0.60000000000000009 }, + { 4.4355048487496776e+18, 100, 10, + 0.69999999999999996 }, + { 1.5778673545673316e+18, 100, 10, + 0.80000000000000004 }, + { 2.5643395957690282e+17, 100, 10, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 10, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=10. +template <typename Tp> +void test033() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data033) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data033[i].l), Tp(data033[i].m), + Tp(data033[i].x)); + const Tp f0 = data033[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for l=100, m=20. +testcase_assoc_legendre<double> data034[] = { + { 0.0000000000000000, 100, 20, + -1.0000000000000000 }, + { 7.1604344878778576e+37, 100, 20, + -0.90000000000000002 }, + { -8.3963895116962035e+38, 100, 20, + -0.80000000000000004 }, + { 7.9022236853110024e+38, 100, 20, + -0.69999999999999996 }, + { 8.2680005574120908e+38, 100, 20, + -0.59999999999999998 }, + { 3.0750497039999469e+38, 100, 20, + -0.50000000000000000 }, + { -7.6120586043843874e+38, 100, 20, + -0.40000000000000002 }, + { 1.1474496891901873e+38, 100, 20, + -0.30000000000000004 }, + { 4.3966251307444218e+38, 100, 20, + -0.19999999999999996 }, + { -7.0503266451702621e+38, 100, 20, + -0.099999999999999978 }, + { 7.7727439836159581e+38, 100, 20, + 0.0000000000000000 }, + { -7.0503266451702213e+38, 100, 20, + 0.10000000000000009 }, + { 4.3966251307444218e+38, 100, 20, + 0.19999999999999996 }, + { 1.1474496891901873e+38, 100, 20, + 0.30000000000000004 }, + { -7.6120586043843511e+38, 100, 20, + 0.39999999999999991 }, + { 3.0750497039999469e+38, 100, 20, + 0.50000000000000000 }, + { 8.2680005574120424e+38, 100, 20, + 0.60000000000000009 }, + { 7.9022236853110024e+38, 100, 20, + 0.69999999999999996 }, + { -8.3963895116962035e+38, 100, 20, + 0.80000000000000004 }, + { 7.1604344878809460e+37, 100, 20, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 20, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=20. +template <typename Tp> +void test034() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data034) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data034[i].l), Tp(data034[i].m), + Tp(data034[i].x)); + const Tp f0 = data034[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for l=100, m=50. +testcase_assoc_legendre<double> data035[] = { + { 0.0000000000000000, 100, 50, + -1.0000000000000000 }, + { 9.3231278516893773e+96, 100, 50, + -0.90000000000000002 }, + { -1.1029797977454331e+98, 100, 50, + -0.80000000000000004 }, + { 1.8089333903465883e+97, 100, 50, + -0.69999999999999996 }, + { 5.9364045925669389e+97, 100, 50, + -0.59999999999999998 }, + { -8.2252620339727163e+97, 100, 50, + -0.50000000000000000 }, + { 7.1431385093739848e+97, 100, 50, + -0.40000000000000002 }, + { -3.3520602067479374e+97, 100, 50, + -0.30000000000000004 }, + { -2.7791149588121386e+97, 100, 50, + -0.19999999999999996 }, + { 9.0119338550180433e+97, 100, 50, + -0.099999999999999978 }, + { -1.1712145031578381e+98, 100, 50, + 0.0000000000000000 }, + { 9.0119338550181176e+97, 100, 50, + 0.10000000000000009 }, + { -2.7791149588121386e+97, 100, 50, + 0.19999999999999996 }, + { -3.3520602067479374e+97, 100, 50, + 0.30000000000000004 }, + { 7.1431385093740728e+97, 100, 50, + 0.39999999999999991 }, + { -8.2252620339727163e+97, 100, 50, + 0.50000000000000000 }, + { 5.9364045925668061e+97, 100, 50, + 0.60000000000000009 }, + { 1.8089333903465883e+97, 100, 50, + 0.69999999999999996 }, + { -1.1029797977454331e+98, 100, 50, + 0.80000000000000004 }, + { 9.3231278516894892e+96, 100, 50, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 50, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=50. +template <typename Tp> +void test035() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data035) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data035[i].l), Tp(data035[i].m), + Tp(data035[i].x)); + const Tp f0 = data035[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for l=100, m=100. +testcase_assoc_legendre<double> data036[] = { + { 0.0000000000000000, 100, 100, + -1.0000000000000000 }, + { 5.7751792255758316e+150, 100, 100, + -0.90000000000000002 }, + { 4.3552236041585515e+164, 100, 100, + -0.80000000000000004 }, + { 1.5936546850595123e+172, 100, 100, + -0.69999999999999996 }, + { 1.3579510590289176e+177, 100, 100, + -0.59999999999999998 }, + { 3.7752749682889513e+180, 100, 100, + -0.50000000000000000 }, + { 1.0910627330458913e+183, 100, 100, + -0.40000000000000002 }, + { 5.9697347526822483e+184, 100, 100, + -0.30000000000000004 }, + { 8.6585879147526714e+185, 100, 100, + -0.19999999999999996 }, + { 4.0331571908057011e+186, 100, 100, + -0.099999999999999978 }, + { 6.6663086700729543e+186, 100, 100, + 0.0000000000000000 }, + { 4.0331571908057011e+186, 100, 100, + 0.10000000000000009 }, + { 8.6585879147526714e+185, 100, 100, + 0.19999999999999996 }, + { 5.9697347526822483e+184, 100, 100, + 0.30000000000000004 }, + { 1.0910627330458913e+183, 100, 100, + 0.39999999999999991 }, + { 3.7752749682889513e+180, 100, 100, + 0.50000000000000000 }, + { 1.3579510590289000e+177, 100, 100, + 0.60000000000000009 }, + { 1.5936546850595123e+172, 100, 100, + 0.69999999999999996 }, + { 4.3552236041585515e+164, 100, 100, + 0.80000000000000004 }, + { 5.7751792255761289e+150, 100, 100, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 100, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=100. +template <typename Tp> +void test036() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data036) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data036[i].l), Tp(data036[i].m), + Tp(data036[i].x)); + const Tp f0 = data036[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile.cc new file mode 100644 index 000000000..6cf43f6fe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.2 assoc_legendre + +#include <tr1/cmath> + +void +test01() +{ + + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int l = 2, m = 1; + + std::tr1::assoc_legendre(l, m, xf); + std::tr1::assoc_legendref(l, m, xf); + std::tr1::assoc_legendre(l, m, xd); + std::tr1::assoc_legendre(l, m, xl); + std::tr1::assoc_legendrel(l, m, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile_2.cc new file mode 100644 index 000000000..a343c892c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile_2.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.2 assoc_legendre + +#include <tr1/math.h> + +void +test01() +{ + + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int l = 2, m = 1; + + assoc_legendre(l, m, xf); + assoc_legendref(l, m, xf); + assoc_legendre(l, m, xd); + assoc_legendre(l, m, xl); + assoc_legendrel(l, m, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_nan.cc new file mode 100644 index 000000000..3585e6a37 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_nan.cc @@ -0,0 +1,87 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.3 beta + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float yf = 0.0F; + double yd = 0.0; + long double yl = 0.0L; + + float a = std::tr1::beta(xf, yf); + float b = std::tr1::betaf(xf, yf); + double c = std::tr1::beta(xd, yd); + long double d = std::tr1::beta(xl, yl); + long double e = std::tr1::betal(xl, yl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float xf = 1.0F; + double xd = 1.0; + long double xl = 1.0L; + + float yf = std::numeric_limits<float>::quiet_NaN(); + double yd = std::numeric_limits<double>::quiet_NaN(); + long double yl = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::beta(xf, yf); + float b = std::tr1::betaf(xf, yf); + double c = std::tr1::beta(xd, yd); + long double d = std::tr1::beta(xl, yl); + long double e = std::tr1::betal(xl, yl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_value.cc new file mode 100644 index 000000000..dfadaa67c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_value.cc @@ -0,0 +1,465 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// beta + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for x=10.000000000000000. +testcase_beta<double> data001[] = { + { 1.0825088224469029e-06, 10.000000000000000, 10.000000000000000 }, + { 4.9925087406346778e-09, 10.000000000000000, 20.000000000000000 }, + { 1.5729567312509485e-10, 10.000000000000000, 30.000000000000000 }, + { 1.2168673582561288e-11, 10.000000000000000, 40.000000000000000 }, + { 1.5916380099863291e-12, 10.000000000000000, 50.000000000000000 }, + { 2.9408957938463963e-13, 10.000000000000000, 60.000000000000000 }, + { 6.9411637980691676e-14, 10.000000000000000, 70.000000000000000 }, + { 1.9665612972502651e-14, 10.000000000000000, 80.000000000000000 }, + { 6.4187824828154399e-15, 10.000000000000000, 90.000000000000000 }, + { 2.3455339739604842e-15, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=10.000000000000000. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data001[i].x), Tp(data001[i].y)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for x=20.000000000000000. +testcase_beta<double> data002[] = { + { 4.9925087406346778e-09, 20.000000000000000, 10.000000000000000 }, + { 7.2544445519248436e-13, 20.000000000000000, 20.000000000000000 }, + { 1.7681885473062028e-15, 20.000000000000000, 30.000000000000000 }, + { 1.7891885039182335e-17, 20.000000000000000, 40.000000000000000 }, + { 4.3240677875623635e-19, 20.000000000000000, 50.000000000000000 }, + { 1.8857342309689050e-20, 20.000000000000000, 60.000000000000000 }, + { 1.2609804003539998e-21, 20.000000000000000, 70.000000000000000 }, + { 1.1660809542079041e-22, 20.000000000000000, 80.000000000000000 }, + { 1.3907944279729071e-23, 20.000000000000000, 90.000000000000000 }, + { 2.0365059099917614e-24, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=20.000000000000000. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data002[i].x), Tp(data002[i].y)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for x=30.000000000000000. +testcase_beta<double> data003[] = { + { 1.5729567312509485e-10, 30.000000000000000, 10.000000000000000 }, + { 1.7681885473062028e-15, 30.000000000000000, 20.000000000000000 }, + { 5.6370779640482451e-19, 30.000000000000000, 30.000000000000000 }, + { 1.0539424603796547e-21, 30.000000000000000, 40.000000000000000 }, + { 6.0118197777273836e-24, 30.000000000000000, 50.000000000000000 }, + { 7.4279528553260165e-26, 30.000000000000000, 60.000000000000000 }, + { 1.6212207780604767e-27, 30.000000000000000, 70.000000000000000 }, + { 5.4783729715317616e-29, 30.000000000000000, 80.000000000000000 }, + { 2.6183005659681346e-30, 30.000000000000000, 90.000000000000000 }, + { 1.6587948222122229e-31, 30.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=30.000000000000000. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data003[i].x), Tp(data003[i].y)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for x=40.000000000000000. +testcase_beta<double> data004[] = { + { 1.2168673582561288e-11, 40.000000000000000, 10.000000000000000 }, + { 1.7891885039182335e-17, 40.000000000000000, 20.000000000000000 }, + { 1.0539424603796547e-21, 40.000000000000000, 30.000000000000000 }, + { 4.6508509140090659e-25, 40.000000000000000, 40.000000000000000 }, + { 7.5161712118557719e-28, 40.000000000000000, 50.000000000000000 }, + { 3.0311331979886071e-30, 40.000000000000000, 60.000000000000000 }, + { 2.4175035070466313e-32, 40.000000000000000, 70.000000000000000 }, + { 3.2734839142758369e-34, 40.000000000000000, 80.000000000000000 }, + { 6.7690629601315579e-36, 40.000000000000000, 90.000000000000000 }, + { 1.9797337118812366e-37, 40.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=40.000000000000000. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data004[i].x), Tp(data004[i].y)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for x=50.000000000000000. +testcase_beta<double> data005[] = { + { 1.5916380099863291e-12, 50.000000000000000, 10.000000000000000 }, + { 4.3240677875623635e-19, 50.000000000000000, 20.000000000000000 }, + { 6.0118197777273836e-24, 50.000000000000000, 30.000000000000000 }, + { 7.5161712118557719e-28, 50.000000000000000, 40.000000000000000 }, + { 3.9646612085674138e-31, 50.000000000000000, 50.000000000000000 }, + { 5.8425643906418403e-34, 50.000000000000000, 60.000000000000000 }, + { 1.8672362180783552e-36, 50.000000000000000, 70.000000000000000 }, + { 1.0939382296458962e-38, 50.000000000000000, 80.000000000000000 }, + { 1.0442781609881063e-40, 50.000000000000000, 90.000000000000000 }, + { 1.4904121110954370e-42, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=50.000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data005[i].x), Tp(data005[i].y)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for x=60.000000000000000. +testcase_beta<double> data006[] = { + { 2.9408957938463963e-13, 60.000000000000000, 10.000000000000000 }, + { 1.8857342309689050e-20, 60.000000000000000, 20.000000000000000 }, + { 7.4279528553260165e-26, 60.000000000000000, 30.000000000000000 }, + { 3.0311331979886071e-30, 60.000000000000000, 40.000000000000000 }, + { 5.8425643906418403e-34, 60.000000000000000, 50.000000000000000 }, + { 3.4501231469782229e-37, 60.000000000000000, 60.000000000000000 }, + { 4.7706855386086599e-40, 60.000000000000000, 70.000000000000000 }, + { 1.2902663809722593e-42, 60.000000000000000, 80.000000000000000 }, + { 6.0105571058570508e-45, 60.000000000000000, 90.000000000000000 }, + { 4.3922898898347209e-47, 60.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=60.000000000000000. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data006[i].x), Tp(data006[i].y)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for x=70.000000000000000. +testcase_beta<double> data007[] = { + { 6.9411637980691676e-14, 70.000000000000000, 10.000000000000000 }, + { 1.2609804003539998e-21, 70.000000000000000, 20.000000000000000 }, + { 1.6212207780604767e-27, 70.000000000000000, 30.000000000000000 }, + { 2.4175035070466313e-32, 70.000000000000000, 40.000000000000000 }, + { 1.8672362180783552e-36, 70.000000000000000, 50.000000000000000 }, + { 4.7706855386086599e-40, 70.000000000000000, 60.000000000000000 }, + { 3.0453137143486369e-43, 70.000000000000000, 70.000000000000000 }, + { 4.0192274082013779e-46, 70.000000000000000, 80.000000000000000 }, + { 9.5865870063501807e-49, 70.000000000000000, 90.000000000000000 }, + { 3.7409127305819802e-51, 70.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=70.000000000000000. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data007[i].x), Tp(data007[i].y)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for x=80.000000000000000. +testcase_beta<double> data008[] = { + { 1.9665612972502651e-14, 80.000000000000000, 10.000000000000000 }, + { 1.1660809542079041e-22, 80.000000000000000, 20.000000000000000 }, + { 5.4783729715317616e-29, 80.000000000000000, 30.000000000000000 }, + { 3.2734839142758369e-34, 80.000000000000000, 40.000000000000000 }, + { 1.0939382296458962e-38, 80.000000000000000, 50.000000000000000 }, + { 1.2902663809722593e-42, 80.000000000000000, 60.000000000000000 }, + { 4.0192274082013779e-46, 80.000000000000000, 70.000000000000000 }, + { 2.7160590828669411e-49, 80.000000000000000, 80.000000000000000 }, + { 3.4593773902125368e-52, 80.000000000000000, 90.000000000000000 }, + { 7.4807039968503468e-55, 80.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=80.000000000000000. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data008[i].x), Tp(data008[i].y)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for x=90.000000000000000. +testcase_beta<double> data009[] = { + { 6.4187824828154399e-15, 90.000000000000000, 10.000000000000000 }, + { 1.3907944279729071e-23, 90.000000000000000, 20.000000000000000 }, + { 2.6183005659681346e-30, 90.000000000000000, 30.000000000000000 }, + { 6.7690629601315579e-36, 90.000000000000000, 40.000000000000000 }, + { 1.0442781609881063e-40, 90.000000000000000, 50.000000000000000 }, + { 6.0105571058570508e-45, 90.000000000000000, 60.000000000000000 }, + { 9.5865870063501807e-49, 90.000000000000000, 70.000000000000000 }, + { 3.4593773902125368e-52, 90.000000000000000, 80.000000000000000 }, + { 2.4416737907558032e-55, 90.000000000000000, 90.000000000000000 }, + { 3.0238531916564246e-58, 90.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=90.000000000000000. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data009[i].x), Tp(data009[i].y)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for x=100.00000000000000. +testcase_beta<double> data010[] = { + { 2.3455339739604842e-15, 100.00000000000000, 10.000000000000000 }, + { 2.0365059099917614e-24, 100.00000000000000, 20.000000000000000 }, + { 1.6587948222122229e-31, 100.00000000000000, 30.000000000000000 }, + { 1.9797337118812366e-37, 100.00000000000000, 40.000000000000000 }, + { 1.4904121110954370e-42, 100.00000000000000, 50.000000000000000 }, + { 4.3922898898347209e-47, 100.00000000000000, 60.000000000000000 }, + { 3.7409127305819802e-51, 100.00000000000000, 70.000000000000000 }, + { 7.4807039968503468e-55, 100.00000000000000, 80.000000000000000 }, + { 3.0238531916564246e-58, 100.00000000000000, 90.000000000000000 }, + { 2.2087606931991853e-61, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for x=100.00000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data010[i].x), Tp(data010[i].y)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile.cc new file mode 100644 index 000000000..d79270c34 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.3 beta + +#include <tr1/cmath> + +void +test01() +{ + + float xf = 0.5F, yf = 0.5F; + double xd = 0.5, yd = 0.5; + long double xl = 0.5L, yl = 0.5L; + + std::tr1::beta(xf, yf); + std::tr1::betaf(xf, yf); + std::tr1::beta(xd, yd); + std::tr1::beta(xl, yl); + std::tr1::betal(xl, yl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile_2.cc new file mode 100644 index 000000000..9bd3d7044 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.3 beta + +#include <tr1/math.h> + +void +test01() +{ + + float xf = 0.5F, yf = 0.5F; + double xd = 0.5, yd = 0.5; + long double xl = 0.5L, yl = 0.5L; + + beta(xf, yf); + betaf(xf, yf); + beta(xd, yd); + beta(xl, yl); + betal(xl, yl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_nan.cc new file mode 100644 index 000000000..9d899d0d6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_nan.cc @@ -0,0 +1,57 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.4 comp_ellint_1 + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float kf = std::numeric_limits<float>::quiet_NaN(); + double kd = std::numeric_limits<double>::quiet_NaN(); + long double kl = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::comp_ellint_1(kf); + float b = std::tr1::comp_ellint_1f(kf); + double c = std::tr1::comp_ellint_1(kd); + long double d = std::tr1::comp_ellint_1(kl); + long double e = std::tr1::comp_ellint_1l(kl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_value.cc new file mode 100644 index 000000000..8a30a7774 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_value.cc @@ -0,0 +1,96 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// comp_ellint_1 + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data. +testcase_comp_ellint_1<double> data001[] = { + { 2.2805491384227703, -0.90000000000000002 }, + { 1.9953027776647296, -0.80000000000000004 }, + { 1.8456939983747236, -0.69999999999999996 }, + { 1.7507538029157526, -0.59999999999999998 }, + { 1.6857503548125963, -0.50000000000000000 }, + { 1.6399998658645112, -0.40000000000000002 }, + { 1.6080486199305126, -0.30000000000000004 }, + { 1.5868678474541664, -0.19999999999999996 }, + { 1.5747455615173562, -0.099999999999999978 }, + { 1.5707963267948966, 0.0000000000000000 }, + { 1.5747455615173562, 0.10000000000000009 }, + { 1.5868678474541664, 0.19999999999999996 }, + { 1.6080486199305126, 0.30000000000000004 }, + { 1.6399998658645112, 0.39999999999999991 }, + { 1.6857503548125963, 0.50000000000000000 }, + { 1.7507538029157526, 0.60000000000000009 }, + { 1.8456939983747236, 0.69999999999999996 }, + { 1.9953027776647296, 0.80000000000000004 }, + { 2.2805491384227699, 0.89999999999999991 }, +}; + +// Test function. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_comp_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_1(Tp(data001[i].k)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile.cc new file mode 100644 index 000000000..83dd4816c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.4 comp_ellint_1 + +#include <tr1/cmath> + +void +test01() +{ + + float kf = 0.5F; + double kd = 0.5; + long double kl = 0.5L; + + std::tr1::comp_ellint_1(kf); + std::tr1::comp_ellint_1f(kf); + std::tr1::comp_ellint_1(kd); + std::tr1::comp_ellint_1(kl); + std::tr1::comp_ellint_1l(kl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile_2.cc new file mode 100644 index 000000000..7103eb1bd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.4 comp_ellint_1 + +#include <tr1/math.h> + +void +test01() +{ + + float kf = 0.5F; + double kd = 0.5; + long double kl = 0.5L; + + comp_ellint_1(kf); + comp_ellint_1f(kf); + comp_ellint_1(kd); + comp_ellint_1(kl); + comp_ellint_1l(kl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_nan.cc new file mode 100644 index 000000000..3862d0c9c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_nan.cc @@ -0,0 +1,57 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.5 comp_ellint_2 + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float kf = std::numeric_limits<float>::quiet_NaN(); + double kd = std::numeric_limits<double>::quiet_NaN(); + long double kl = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::comp_ellint_2(kf); + float b = std::tr1::comp_ellint_2f(kf); + double c = std::tr1::comp_ellint_2(kd); + long double d = std::tr1::comp_ellint_2(kl); + long double e = std::tr1::comp_ellint_2l(kl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_value.cc new file mode 100644 index 000000000..8cd04228c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_value.cc @@ -0,0 +1,96 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// comp_ellint_2 + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data. +testcase_comp_ellint_2<double> data001[] = { + { 1.1716970527816140, -0.90000000000000002 }, + { 1.2763499431699066, -0.80000000000000004 }, + { 1.3556611355719557, -0.69999999999999996 }, + { 1.4180833944487243, -0.59999999999999998 }, + { 1.4674622093394274, -0.50000000000000000 }, + { 1.5059416123600402, -0.40000000000000002 }, + { 1.5348334649232489, -0.30000000000000004 }, + { 1.5549685462425296, -0.19999999999999996 }, + { 1.5668619420216685, -0.099999999999999978 }, + { 1.5707963267948966, 0.0000000000000000 }, + { 1.5668619420216685, 0.10000000000000009 }, + { 1.5549685462425296, 0.19999999999999996 }, + { 1.5348334649232489, 0.30000000000000004 }, + { 1.5059416123600404, 0.39999999999999991 }, + { 1.4674622093394274, 0.50000000000000000 }, + { 1.4180833944487241, 0.60000000000000009 }, + { 1.3556611355719557, 0.69999999999999996 }, + { 1.2763499431699066, 0.80000000000000004 }, + { 1.1716970527816142, 0.89999999999999991 }, +}; + +// Test function. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_comp_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_2(Tp(data001[i].k)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +int main(int, char**) +{ + test001<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile.cc new file mode 100644 index 000000000..86205bd9a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.5 comp_ellint_2 + +#include <tr1/cmath> + +void +test01() +{ + + float kf = 0.5F; + double kd = 0.5; + long double kl = 0.5L; + + std::tr1::comp_ellint_2(kf); + std::tr1::comp_ellint_2f(kf); + std::tr1::comp_ellint_2(kd); + std::tr1::comp_ellint_2(kl); + std::tr1::comp_ellint_2l(kl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile_2.cc new file mode 100644 index 000000000..3c690665f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.4 comp_ellint_2 + +#include <tr1/math.h> + +void +test01() +{ + + float kf = 0.5F; + double kd = 0.5; + long double kl = 0.5L; + + comp_ellint_2(kf); + comp_ellint_2f(kf); + comp_ellint_2(kd); + comp_ellint_2(kl); + comp_ellint_2l(kl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_nan.cc new file mode 100644 index 000000000..af84c5a34 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_nan.cc @@ -0,0 +1,87 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.6 comp_ellint_3 + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float kf = std::numeric_limits<float>::quiet_NaN(); + double kd = std::numeric_limits<double>::quiet_NaN(); + long double kl = std::numeric_limits<long double>::quiet_NaN(); + + float nuf = 0.0F; + double nud = 0.0; + long double nul = 0.0L; + + float a = std::tr1::comp_ellint_3(kf, nuf); + float b = std::tr1::comp_ellint_3f(kf, nuf); + double c = std::tr1::comp_ellint_3(kd, nud); + long double d = std::tr1::comp_ellint_3(kl, nul); + long double e = std::tr1::comp_ellint_3l(kl, nul); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float kf = 1.0F; + double kd = 1.0; + long double kl = 1.0L; + + float nuf = std::numeric_limits<float>::quiet_NaN(); + double nud = std::numeric_limits<double>::quiet_NaN(); + long double nul = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::comp_ellint_3(kf, nuf); + float b = std::tr1::comp_ellint_3f(kf, nuf); + double c = std::tr1::comp_ellint_3(kd, nud); + long double d = std::tr1::comp_ellint_3(kl, nul); + long double e = std::tr1::comp_ellint_3l(kl, nul); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc new file mode 100644 index 000000000..0dd3f3bb6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc @@ -0,0 +1,843 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// comp_ellint_3 + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for k=-0.90000000000000002. +testcase_comp_ellint_3<double> data001[] = { + { 2.2805491384227703, -0.90000000000000002, 0.0000000000000000 }, + { 2.1537868513875287, -0.90000000000000002, 0.10000000000000001 }, + { 2.0443194576468890, -0.90000000000000002, 0.20000000000000001 }, + { 1.9486280260314426, -0.90000000000000002, 0.29999999999999999 }, + { 1.8641114227238349, -0.90000000000000002, 0.40000000000000002 }, + { 1.7888013241937861, -0.90000000000000002, 0.50000000000000000 }, + { 1.7211781128919523, -0.90000000000000002, 0.59999999999999998 }, + { 1.6600480747670938, -0.90000000000000002, 0.69999999999999996 }, + { 1.6044591960982204, -0.90000000000000002, 0.80000000000000004 }, + { 1.5536420236310946, -0.90000000000000002, 0.90000000000000002 }, +}; + +// Test function for k=-0.90000000000000002. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data001[i].k), Tp(data001[i].nu)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004. +testcase_comp_ellint_3<double> data002[] = { + { 1.9953027776647296, -0.80000000000000004, 0.0000000000000000 }, + { 1.8910755418379521, -0.80000000000000004, 0.10000000000000001 }, + { 1.8007226661734588, -0.80000000000000004, 0.20000000000000001 }, + { 1.7214611048717301, -0.80000000000000004, 0.29999999999999999 }, + { 1.6512267838651289, -0.80000000000000004, 0.40000000000000002 }, + { 1.5884528947755532, -0.80000000000000004, 0.50000000000000000 }, + { 1.5319262547427865, -0.80000000000000004, 0.59999999999999998 }, + { 1.4806912324625332, -0.80000000000000004, 0.69999999999999996 }, + { 1.4339837018309474, -0.80000000000000004, 0.80000000000000004 }, + { 1.3911845406776222, -0.80000000000000004, 0.90000000000000002 }, +}; + +// Test function for k=-0.80000000000000004. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data002[i].k), Tp(data002[i].nu)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996. +testcase_comp_ellint_3<double> data003[] = { + { 1.8456939983747236, -0.69999999999999996, 0.0000000000000000 }, + { 1.7528050171757608, -0.69999999999999996, 0.10000000000000001 }, + { 1.6721098780092147, -0.69999999999999996, 0.20000000000000001 }, + { 1.6011813647733213, -0.69999999999999996, 0.29999999999999999 }, + { 1.5382162002954762, -0.69999999999999996, 0.40000000000000002 }, + { 1.4818433192178544, -0.69999999999999996, 0.50000000000000000 }, + { 1.4309994736080540, -0.69999999999999996, 0.59999999999999998 }, + { 1.3848459188329196, -0.69999999999999996, 0.69999999999999996 }, + { 1.3427110650397533, -0.69999999999999996, 0.80000000000000004 }, + { 1.3040500499695911, -0.69999999999999996, 0.90000000000000002 }, +}; + +// Test function for k=-0.69999999999999996. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data003[i].k), Tp(data003[i].nu)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998. +testcase_comp_ellint_3<double> data004[] = { + { 1.7507538029157526, -0.59999999999999998, 0.0000000000000000 }, + { 1.6648615773343014, -0.59999999999999998, 0.10000000000000001 }, + { 1.5901418016279374, -0.59999999999999998, 0.20000000000000001 }, + { 1.5243814243493585, -0.59999999999999998, 0.29999999999999999 }, + { 1.4659345278069984, -0.59999999999999998, 0.40000000000000002 }, + { 1.4135484285693078, -0.59999999999999998, 0.50000000000000000 }, + { 1.3662507535812816, -0.59999999999999998, 0.59999999999999998 }, + { 1.3232737468822811, -0.59999999999999998, 0.69999999999999996 }, + { 1.2840021261752192, -0.59999999999999998, 0.80000000000000004 }, + { 1.2479362973851875, -0.59999999999999998, 0.90000000000000002 }, +}; + +// Test function for k=-0.59999999999999998. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data004[i].k), Tp(data004[i].nu)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000. +testcase_comp_ellint_3<double> data005[] = { + { 1.6857503548125963, -0.50000000000000000, 0.0000000000000000 }, + { 1.6045524936084892, -0.50000000000000000, 0.10000000000000001 }, + { 1.5338490483665983, -0.50000000000000000, 0.20000000000000001 }, + { 1.4715681939859637, -0.50000000000000000, 0.29999999999999999 }, + { 1.4161679518465340, -0.50000000000000000, 0.40000000000000002 }, + { 1.3664739530045971, -0.50000000000000000, 0.50000000000000000 }, + { 1.3215740290190876, -0.50000000000000000, 0.59999999999999998 }, + { 1.2807475181182502, -0.50000000000000000, 0.69999999999999996 }, + { 1.2434165408189539, -0.50000000000000000, 0.80000000000000004 }, + { 1.2091116095504744, -0.50000000000000000, 0.90000000000000002 }, +}; + +// Test function for k=-0.50000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data005[i].k), Tp(data005[i].nu)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002. +testcase_comp_ellint_3<double> data006[] = { + { 1.6399998658645112, -0.40000000000000002, 0.0000000000000000 }, + { 1.5620566886683604, -0.40000000000000002, 0.10000000000000001 }, + { 1.4941414344266770, -0.40000000000000002, 0.20000000000000001 }, + { 1.4342789859950078, -0.40000000000000002, 0.29999999999999999 }, + { 1.3809986210732901, -0.40000000000000002, 0.40000000000000002 }, + { 1.3331797176377398, -0.40000000000000002, 0.50000000000000000 }, + { 1.2899514672527024, -0.40000000000000002, 0.59999999999999998 }, + { 1.2506255923253344, -0.40000000000000002, 0.69999999999999996 }, + { 1.2146499565727209, -0.40000000000000002, 0.80000000000000004 }, + { 1.1815758115929846, -0.40000000000000002, 0.90000000000000002 }, +}; + +// Test function for k=-0.40000000000000002. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data006[i].k), Tp(data006[i].nu)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004. +testcase_comp_ellint_3<double> data007[] = { + { 1.6080486199305126, -0.30000000000000004, 0.0000000000000000 }, + { 1.5323534693557526, -0.30000000000000004, 0.10000000000000001 }, + { 1.4663658145259875, -0.30000000000000004, 0.20000000000000001 }, + { 1.4081767433479089, -0.30000000000000004, 0.29999999999999999 }, + { 1.3563643538969761, -0.30000000000000004, 0.40000000000000002 }, + { 1.3098448759814960, -0.30000000000000004, 0.50000000000000000 }, + { 1.2677758800420666, -0.30000000000000004, 0.59999999999999998 }, + { 1.2294913236274980, -0.30000000000000004, 0.69999999999999996 }, + { 1.1944567571590046, -0.30000000000000004, 0.80000000000000004 }, + { 1.1622376896064912, -0.30000000000000004, 0.90000000000000002 }, +}; + +// Test function for k=-0.30000000000000004. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data007[i].k), Tp(data007[i].nu)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996. +testcase_comp_ellint_3<double> data008[] = { + { 1.5868678474541664, -0.19999999999999996, 0.0000000000000000 }, + { 1.5126513474261092, -0.19999999999999996, 0.10000000000000001 }, + { 1.4479323932249568, -0.19999999999999996, 0.20000000000000001 }, + { 1.3908453514752481, -0.19999999999999996, 0.29999999999999999 }, + { 1.3400002519661010, -0.19999999999999996, 0.40000000000000002 }, + { 1.2943374404397376, -0.19999999999999996, 0.50000000000000000 }, + { 1.2530330675914561, -0.19999999999999996, 0.59999999999999998 }, + { 1.2154356555075867, -0.19999999999999996, 0.69999999999999996 }, + { 1.1810223448909913, -0.19999999999999996, 0.80000000000000004 }, + { 1.1493679916141863, -0.19999999999999996, 0.90000000000000002 }, +}; + +// Test function for k=-0.19999999999999996. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data008[i].k), Tp(data008[i].nu)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978. +testcase_comp_ellint_3<double> data009[] = { + { 1.5747455615173562, -0.099999999999999978, 0.0000000000000000 }, + { 1.5013711111199950, -0.099999999999999978, 0.10000000000000001 }, + { 1.4373749386463430, -0.099999999999999978, 0.20000000000000001 }, + { 1.3809159606704959, -0.099999999999999978, 0.29999999999999999 }, + { 1.3306223265207477, -0.099999999999999978, 0.40000000000000002 }, + { 1.2854480708580160, -0.099999999999999978, 0.50000000000000000 }, + { 1.2445798942989255, -0.099999999999999978, 0.59999999999999998 }, + { 1.2073745911083187, -0.099999999999999978, 0.69999999999999996 }, + { 1.1733158866987732, -0.099999999999999978, 0.80000000000000004 }, + { 1.1419839485283374, -0.099999999999999978, 0.90000000000000002 }, +}; + +// Test function for k=-0.099999999999999978. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data009[i].k), Tp(data009[i].nu)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000. +testcase_comp_ellint_3<double> data010[] = { + { 1.5707963267948966, 0.0000000000000000, 0.0000000000000000 }, + { 1.4976955329233277, 0.0000000000000000, 0.10000000000000001 }, + { 1.4339343023863691, 0.0000000000000000, 0.20000000000000001 }, + { 1.3776795151134889, 0.0000000000000000, 0.29999999999999999 }, + { 1.3275651989026322, 0.0000000000000000, 0.40000000000000002 }, + { 1.2825498301618641, 0.0000000000000000, 0.50000000000000000 }, + { 1.2418235332245127, 0.0000000000000000, 0.59999999999999998 }, + { 1.2047457872617382, 0.0000000000000000, 0.69999999999999996 }, + { 1.1708024551734544, 0.0000000000000000, 0.80000000000000004 }, + { 1.1395754288497419, 0.0000000000000000, 0.90000000000000002 }, +}; + +// Test function for k=0.0000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data010[i].k), Tp(data010[i].nu)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009. +testcase_comp_ellint_3<double> data011[] = { + { 1.5747455615173562, 0.10000000000000009, 0.0000000000000000 }, + { 1.5013711111199950, 0.10000000000000009, 0.10000000000000001 }, + { 1.4373749386463430, 0.10000000000000009, 0.20000000000000001 }, + { 1.3809159606704959, 0.10000000000000009, 0.29999999999999999 }, + { 1.3306223265207477, 0.10000000000000009, 0.40000000000000002 }, + { 1.2854480708580160, 0.10000000000000009, 0.50000000000000000 }, + { 1.2445798942989255, 0.10000000000000009, 0.59999999999999998 }, + { 1.2073745911083187, 0.10000000000000009, 0.69999999999999996 }, + { 1.1733158866987732, 0.10000000000000009, 0.80000000000000004 }, + { 1.1419839485283374, 0.10000000000000009, 0.90000000000000002 }, +}; + +// Test function for k=0.10000000000000009. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data011[i].k), Tp(data011[i].nu)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996. +testcase_comp_ellint_3<double> data012[] = { + { 1.5868678474541664, 0.19999999999999996, 0.0000000000000000 }, + { 1.5126513474261092, 0.19999999999999996, 0.10000000000000001 }, + { 1.4479323932249568, 0.19999999999999996, 0.20000000000000001 }, + { 1.3908453514752481, 0.19999999999999996, 0.29999999999999999 }, + { 1.3400002519661010, 0.19999999999999996, 0.40000000000000002 }, + { 1.2943374404397376, 0.19999999999999996, 0.50000000000000000 }, + { 1.2530330675914561, 0.19999999999999996, 0.59999999999999998 }, + { 1.2154356555075867, 0.19999999999999996, 0.69999999999999996 }, + { 1.1810223448909913, 0.19999999999999996, 0.80000000000000004 }, + { 1.1493679916141863, 0.19999999999999996, 0.90000000000000002 }, +}; + +// Test function for k=0.19999999999999996. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data012[i].k), Tp(data012[i].nu)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004. +testcase_comp_ellint_3<double> data013[] = { + { 1.6080486199305126, 0.30000000000000004, 0.0000000000000000 }, + { 1.5323534693557526, 0.30000000000000004, 0.10000000000000001 }, + { 1.4663658145259875, 0.30000000000000004, 0.20000000000000001 }, + { 1.4081767433479089, 0.30000000000000004, 0.29999999999999999 }, + { 1.3563643538969761, 0.30000000000000004, 0.40000000000000002 }, + { 1.3098448759814960, 0.30000000000000004, 0.50000000000000000 }, + { 1.2677758800420666, 0.30000000000000004, 0.59999999999999998 }, + { 1.2294913236274980, 0.30000000000000004, 0.69999999999999996 }, + { 1.1944567571590046, 0.30000000000000004, 0.80000000000000004 }, + { 1.1622376896064912, 0.30000000000000004, 0.90000000000000002 }, +}; + +// Test function for k=0.30000000000000004. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data013[i].k), Tp(data013[i].nu)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991. +testcase_comp_ellint_3<double> data014[] = { + { 1.6399998658645112, 0.39999999999999991, 0.0000000000000000 }, + { 1.5620566886683604, 0.39999999999999991, 0.10000000000000001 }, + { 1.4941414344266770, 0.39999999999999991, 0.20000000000000001 }, + { 1.4342789859950078, 0.39999999999999991, 0.29999999999999999 }, + { 1.3809986210732901, 0.39999999999999991, 0.40000000000000002 }, + { 1.3331797176377398, 0.39999999999999991, 0.50000000000000000 }, + { 1.2899514672527024, 0.39999999999999991, 0.59999999999999998 }, + { 1.2506255923253344, 0.39999999999999991, 0.69999999999999996 }, + { 1.2146499565727209, 0.39999999999999991, 0.80000000000000004 }, + { 1.1815758115929846, 0.39999999999999991, 0.90000000000000002 }, +}; + +// Test function for k=0.39999999999999991. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data014[i].k), Tp(data014[i].nu)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000. +testcase_comp_ellint_3<double> data015[] = { + { 1.6857503548125963, 0.50000000000000000, 0.0000000000000000 }, + { 1.6045524936084892, 0.50000000000000000, 0.10000000000000001 }, + { 1.5338490483665983, 0.50000000000000000, 0.20000000000000001 }, + { 1.4715681939859637, 0.50000000000000000, 0.29999999999999999 }, + { 1.4161679518465340, 0.50000000000000000, 0.40000000000000002 }, + { 1.3664739530045971, 0.50000000000000000, 0.50000000000000000 }, + { 1.3215740290190876, 0.50000000000000000, 0.59999999999999998 }, + { 1.2807475181182502, 0.50000000000000000, 0.69999999999999996 }, + { 1.2434165408189539, 0.50000000000000000, 0.80000000000000004 }, + { 1.2091116095504744, 0.50000000000000000, 0.90000000000000002 }, +}; + +// Test function for k=0.50000000000000000. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data015[i].k), Tp(data015[i].nu)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009. +testcase_comp_ellint_3<double> data016[] = { + { 1.7507538029157526, 0.60000000000000009, 0.0000000000000000 }, + { 1.6648615773343014, 0.60000000000000009, 0.10000000000000001 }, + { 1.5901418016279374, 0.60000000000000009, 0.20000000000000001 }, + { 1.5243814243493585, 0.60000000000000009, 0.29999999999999999 }, + { 1.4659345278069984, 0.60000000000000009, 0.40000000000000002 }, + { 1.4135484285693078, 0.60000000000000009, 0.50000000000000000 }, + { 1.3662507535812816, 0.60000000000000009, 0.59999999999999998 }, + { 1.3232737468822811, 0.60000000000000009, 0.69999999999999996 }, + { 1.2840021261752192, 0.60000000000000009, 0.80000000000000004 }, + { 1.2479362973851875, 0.60000000000000009, 0.90000000000000002 }, +}; + +// Test function for k=0.60000000000000009. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data016[i].k), Tp(data016[i].nu)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996. +testcase_comp_ellint_3<double> data017[] = { + { 1.8456939983747236, 0.69999999999999996, 0.0000000000000000 }, + { 1.7528050171757608, 0.69999999999999996, 0.10000000000000001 }, + { 1.6721098780092147, 0.69999999999999996, 0.20000000000000001 }, + { 1.6011813647733213, 0.69999999999999996, 0.29999999999999999 }, + { 1.5382162002954762, 0.69999999999999996, 0.40000000000000002 }, + { 1.4818433192178544, 0.69999999999999996, 0.50000000000000000 }, + { 1.4309994736080540, 0.69999999999999996, 0.59999999999999998 }, + { 1.3848459188329196, 0.69999999999999996, 0.69999999999999996 }, + { 1.3427110650397533, 0.69999999999999996, 0.80000000000000004 }, + { 1.3040500499695911, 0.69999999999999996, 0.90000000000000002 }, +}; + +// Test function for k=0.69999999999999996. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data017[i].k), Tp(data017[i].nu)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004. +testcase_comp_ellint_3<double> data018[] = { + { 1.9953027776647296, 0.80000000000000004, 0.0000000000000000 }, + { 1.8910755418379521, 0.80000000000000004, 0.10000000000000001 }, + { 1.8007226661734588, 0.80000000000000004, 0.20000000000000001 }, + { 1.7214611048717301, 0.80000000000000004, 0.29999999999999999 }, + { 1.6512267838651289, 0.80000000000000004, 0.40000000000000002 }, + { 1.5884528947755532, 0.80000000000000004, 0.50000000000000000 }, + { 1.5319262547427865, 0.80000000000000004, 0.59999999999999998 }, + { 1.4806912324625332, 0.80000000000000004, 0.69999999999999996 }, + { 1.4339837018309474, 0.80000000000000004, 0.80000000000000004 }, + { 1.3911845406776222, 0.80000000000000004, 0.90000000000000002 }, +}; + +// Test function for k=0.80000000000000004. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data018[i].k), Tp(data018[i].nu)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991. +testcase_comp_ellint_3<double> data019[] = { + { 2.2805491384227699, 0.89999999999999991, 0.0000000000000000 }, + { 2.1537868513875282, 0.89999999999999991, 0.10000000000000001 }, + { 2.0443194576468890, 0.89999999999999991, 0.20000000000000001 }, + { 1.9486280260314424, 0.89999999999999991, 0.29999999999999999 }, + { 1.8641114227238347, 0.89999999999999991, 0.40000000000000002 }, + { 1.7888013241937859, 0.89999999999999991, 0.50000000000000000 }, + { 1.7211781128919521, 0.89999999999999991, 0.59999999999999998 }, + { 1.6600480747670936, 0.89999999999999991, 0.69999999999999996 }, + { 1.6044591960982200, 0.89999999999999991, 0.80000000000000004 }, + { 1.5536420236310944, 0.89999999999999991, 0.90000000000000002 }, +}; + +// Test function for k=0.89999999999999991. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data019[i].k), Tp(data019[i].nu)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile.cc new file mode 100644 index 000000000..c6fdb6da7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.6 comp_ellint_3 + +#include <tr1/cmath> + +void +test01() +{ + + float kf = 0.5F, nuf = 0.5F; + double kd = 0.5, nud = 0.5; + long double kl = 0.5L, nul = 0.5L; + + std::tr1::comp_ellint_3(kf, nuf); + std::tr1::comp_ellint_3f(kf, nuf); + std::tr1::comp_ellint_3(kd, nud); + std::tr1::comp_ellint_3(kl, nul); + std::tr1::comp_ellint_3l(kl, nul); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile_2.cc new file mode 100644 index 000000000..35a141cc7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.6 comp_ellint_3 + +#include <tr1/math.h> + +void +test01() +{ + + float kf = 0.5F, nuf = 0.5F; + double kd = 0.5, nud = 0.5; + long double kl = 0.5L, nul = 0.5L; + + comp_ellint_3(kf, nuf); + comp_ellint_3f(kf, nuf); + comp_ellint_3(kd, nud); + comp_ellint_3(kl, nul); + comp_ellint_3l(kl, nul); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_nan.cc new file mode 100644 index 000000000..12d5fe850 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_nan.cc @@ -0,0 +1,126 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.7 conf_hyperg + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float af = std::numeric_limits<float>::quiet_NaN(); + double ad = std::numeric_limits<double>::quiet_NaN(); + long double al = std::numeric_limits<long double>::quiet_NaN(); + + float cf = 3.0F; + double cd = 3.0; + long double cl = 3.0L; + + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + float a = std::tr1::conf_hyperg(af, cf, xf); + float b = std::tr1::conf_hypergf(af, cf, xf); + double c = std::tr1::conf_hyperg(ad, cd, xd); + long double d = std::tr1::conf_hyperg(al, cl, xl); + long double e = std::tr1::conf_hypergl(al, cl, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float af = 2.0F; + double ad = 2.0; + long double al = 2.0L; + + float cf = std::numeric_limits<float>::quiet_NaN(); + double cd = std::numeric_limits<double>::quiet_NaN(); + long double cl = std::numeric_limits<long double>::quiet_NaN(); + + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + float a = std::tr1::conf_hyperg(af, cf, xf); + float b = std::tr1::conf_hypergf(af, cf, xf); + double c = std::tr1::conf_hyperg(ad, cd, xd); + long double d = std::tr1::conf_hyperg(al, cl, xl); + long double e = std::tr1::conf_hypergl(al, cl, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test03() +{ + float af = 2.0F; + double ad = 2.0; + long double al = 2.0L; + + float cf = 3.0F; + double cd = 3.0; + long double cl = 3.0L; + + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::conf_hyperg(af, cf, xf); + float b = std::tr1::conf_hypergf(af, cf, xf); + double c = std::tr1::conf_hyperg(ad, cd, xd); + long double d = std::tr1::conf_hyperg(al, cl, xl); + long double e = std::tr1::conf_hypergl(al, cl, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_value.cc new file mode 100644 index 000000000..79e8527b6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_value.cc @@ -0,0 +1,5293 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// conf_hyperg + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for a=0.0000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data001[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=1.0000000000000000. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data001[i].a), Tp(data001[i].c), + Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data002[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data002[i].a), Tp(data002[i].c), + Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data003[] = { + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=3.0000000000000000. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data003[i].a), Tp(data003[i].c), + Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data004[] = { + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data004[i].a), Tp(data004[i].c), + Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data005[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=5.0000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data005[i].a), Tp(data005[i].c), + Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data006[] = { + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data006[i].a), Tp(data006[i].c), + Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data007[] = { + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=7.0000000000000000. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data007[i].a), Tp(data007[i].c), + Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data008[] = { + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data008[i].a), Tp(data008[i].c), + Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data009[] = { + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=9.0000000000000000. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data009[i].a), Tp(data009[i].c), + Tp(data009[i].x)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data010[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data010[i].a), Tp(data010[i].c), + Tp(data010[i].x)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data011[] = { + { 0.18354081260932853, 0.50000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { 0.19419827762834704, 0.50000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { 0.20700192122398287, 0.50000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { 0.22280243801078498, 0.50000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { 0.24300035416182644, 0.50000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 0.27004644161220326, 0.50000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 0.30850832255367100, 0.50000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { 0.36743360905415834, 0.50000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.46575960759364043, 0.50000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 0.64503527044915010, 0.50000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 1.7533876543770910, 0.50000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 3.4415238691253336, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 7.3801013214774045, 0.50000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 16.843983681258987, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 40.078445504076413, 0.50000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 98.033339697812551, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 244.33254130132133, 0.50000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 617.06403040562418, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 1573.6049422133683, 0.50000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 4042.7554308904046, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=1.0000000000000000. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data011[i].a), Tp(data011[i].c), + Tp(data011[i].x)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +// Test data for a=0.50000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data012[] = { + { 0.34751307955387079, 0.50000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { 0.36515709992587503, 0.50000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 0.38575276072642301, 0.50000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.41020241461382889, 0.50000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.43982706745912625, 0.50000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 0.47663109114346930, 0.50000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 0.52377761180260862, 0.50000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 0.58647299647508400, 0.50000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 0.67367002294334866, 0.50000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 0.80145607363402172, 0.50000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 1.3281918274866849, 0.50000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 1.9052621465543667, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 2.9805776178019903, 0.50000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 5.0906787293171654, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 9.4185650450425964, 0.50000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 18.627776225141986, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 38.823513069699615, 0.50000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 84.215287700426927, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 188.31125697734240, 0.50000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 431.02590173952245, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data012[i].a), Tp(data012[i].c), + Tp(data012[i].x)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data013[] = { + { 0.44148780381255515, 0.50000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 0.46154890030153722, 0.50000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 0.48454520771815751, 0.50000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 0.51124131917976301, 0.50000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 0.54269682032387934, 0.50000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { 0.58041888164962119, 0.50000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.62661371932049892, 0.50000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 0.68461315644636744, 0.50000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 0.75961975369132639, 0.50000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.86004702726553350, 0.50000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 1.2039946674617061, 0.50000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 1.5161750470251780, 0.50000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 2.0187596221024697, 0.50000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 2.8698033217756134, 0.50000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 4.3821186043144440, 0.50000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 7.1913541951514128, 0.50000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 12.620107286909638, 0.50000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 23.478926483036350, 0.50000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 45.852981860749004, 0.50000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 93.137265099245667, 0.50000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=3.0000000000000000. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data013[i].a), Tp(data013[i].c), + Tp(data013[i].x)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data014[] = { + { 0.50723143075298227, 0.50000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 0.52815420026166782, 0.50000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 0.55181651516426766, 0.50000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { 0.57884767287882366, 0.50000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { 0.61008828324275399, 0.50000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 0.64668451853659259, 0.50000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.69023479867386495, 0.50000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 0.74302365975861406, 0.50000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.80840402753201868, 0.50000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.89143814400301236, 0.50000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 1.1467204168940972, 0.50000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 1.3525055369951857, 0.50000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 1.6530571499633475, 0.50000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 2.1112387416058045, 0.50000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 2.8410480336278194, 0.50000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 4.0550562221854669, 0.50000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 6.1601039044778592, 0.50000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 9.9538034144264458, 0.50000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 17.034704868473899, 0.50000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 30.671445325428369, 0.50000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data014[i].a), Tp(data014[i].c), + Tp(data014[i].x)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data015[] = { + { 0.55715239162383312, 0.50000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 0.57823135269518977, 0.50000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 0.60181688556797253, 0.50000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 0.62842688147829928, 0.50000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.65873434489521876, 0.50000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.69362872731932568, 0.50000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 0.73430741618153195, 0.50000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 0.78241503593870543, 0.50000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.84026013345254857, 0.50000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.91115976433208690, 0.50000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 1.1141687602185972, 0.50000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 1.2651443108002267, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 1.4712624889419719, 0.50000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 1.7626460645467978, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 2.1901779328181084, 0.50000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 2.8421796979457072, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 3.8760354586203549, 0.50000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 5.5792940156545505, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 8.4898429002463196, 0.50000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 13.636227878037923, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=5.0000000000000000. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data015[i].a), Tp(data015[i].c), + Tp(data015[i].x)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data016[] = { + { 0.59687111919499192, 0.50000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 0.61774982278057033, 0.50000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 0.64090744485124451, 0.50000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 0.66677322792860194, 0.50000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 0.69589293014100995, 0.50000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 0.72897040032571048, 0.50000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 0.76692755408207181, 0.50000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.81099244559101891, 0.50000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.86283102401276535, 0.50000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.92474809223976406, 0.50000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 1.0932912594628821, 0.50000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 1.2115798426781204, 0.50000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 1.3654106750890422, 0.50000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 1.5711704305419896, 0.50000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 1.8549798357448213, 0.50000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 2.2595503871694818, 0.50000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 2.8565038772876936, 0.50000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 3.7689325736317811, 0.50000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 5.2134738554699460, 0.50000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 7.5801565545352725, 0.50000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data016[i].a), Tp(data016[i].c), + Tp(data016[i].x)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data017[] = { + { 0.62946736953754090, 0.50000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 0.64995830964827050, 0.50000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 0.67251910396276349, 0.50000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 0.69750870596083636, 0.50000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 0.72537539174856436, 0.50000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 0.75668588434835504, 0.50000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.79216623458879654, 0.50000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.83276010491326891, 0.50000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.87971323375878940, 0.50000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.93469794840150233, 0.50000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 1.0788040971101556, 0.50000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 1.1756385516794761, 0.50000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 1.2970810749099917, 0.50000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 1.4529009687665237, 0.50000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 1.6579437149144023, 0.50000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 1.9353010489337750, 0.50000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 2.3217458547039813, 0.50000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 2.8772254607646004, 0.50000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 3.7017478151936545, 0.50000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 4.9659500648552148, 0.50000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=7.0000000000000000. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data017[i].a), Tp(data017[i].c), + Tp(data017[i].x)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data018[] = { + { 0.65682574389601245, 0.50000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 0.67683106084440448, 0.50000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 0.69871884883136481, 0.50000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 0.72279201131268422, 0.50000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 0.74942315553647221, 0.50000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.77907555763819503, 0.50000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.81233192258476394, 0.50000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.84993438521252052, 0.50000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.89284095871461888, 0.50000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.94230641231038748, 0.50000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.0681796709163929, 0.50000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 1.1499542693515108, 0.50000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 1.2496850956712680, 0.50000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 1.3736119127266571, 0.50000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 1.5308465522192733, 0.50000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 1.7349787653671500, 0.50000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 2.0067188996039378, 0.50000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 2.3783255204306930, 0.50000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 2.9011558746255721, 0.50000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 3.6587666457431167, 0.50000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data018[i].a), Tp(data018[i].c), + Tp(data018[i].x)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data019[] = { + { 0.68018654063475448, 0.50000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.69965870094538662, 0.50000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 0.72084701020942776, 0.50000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.74400928635822572, 0.50000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.76945859319172982, 0.50000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.79757868270124699, 0.50000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.82884476649794248, 0.50000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.86385180214855140, 0.50000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.90335351612716308, 0.50000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.94831697594473685, 0.50000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.0600626000640645, 0.50000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 1.1307298999505393, 0.50000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 1.2150341092774180, 0.50000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 1.3171798023006840, 0.50000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 1.4431045594091672, 0.50000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 1.6013540635087158, 0.50000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 1.8044714074708206, 0.50000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 2.0712406108144252, 0.50000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 2.4303714711293125, 0.50000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 2.9266541358556246, 0.50000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=9.0000000000000000. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data019[i].a), Tp(data019[i].c), + Tp(data019[i].x)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data020[] = { + { 0.70040954461104077, 0.50000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.71933025737654377, 0.50000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.73981995758615049, 0.50000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.76209985272755054, 0.50000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.78643553963087975, 0.50000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.81314860510626796, 0.50000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.84263196565226672, 0.50000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.87537037798496642, 0.50000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.91196818568151450, 0.50000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.95318731786229316, 0.50000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.0536628587304602, 0.50000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 1.1158225648376323, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 1.1886686247111011, 0.50000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 1.2751576744751334, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 1.3793478044961116, 0.50000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 1.5069047234443802, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 1.6658803233122232, 0.50000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 1.8679295659745196, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 2.1302432955522042, 0.50000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 2.4786679001777268, 0.50000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test020() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data020) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data020[i].a), Tp(data020[i].c), + Tp(data020[i].x)); + const Tp f0 = data020[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data021[] = { + { 4.5399929762484854e-05, 1.0000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { 0.00012340980408667956, 1.0000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 1.0000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { 0.00091188196555451624, 1.0000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 1.0000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 0.0067379469990854670, 1.0000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 0.018315638888734179, 1.0000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { 0.049787068367863944, 1.0000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.13533528323661270, 1.0000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 0.36787944117144233, 1.0000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 2.7182818284590451, 1.0000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 7.3890560989306504, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 20.085536923187668, 1.0000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 54.598150033144236, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 148.41315910257660, 1.0000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 403.42879349273511, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 1096.6331584284585, 1.0000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 2980.9579870417283, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 8103.0839275753842, 1.0000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 22026.465794806718, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=1.0000000000000000. +template <typename Tp> +void test021() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data021) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data021[i].a), Tp(data021[i].c), + Tp(data021[i].x)); + const Tp f0 = data021[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data022[] = { + { 0.099995460007023751, 1.0000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { 0.11109739891065704, 1.0000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 0.12495806717151219, 1.0000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.14272687400492079, 1.0000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.16625354130388895, 1.0000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 0.19865241060018290, 1.0000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 0.24542109027781644, 1.0000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 0.31673764387737868, 1.0000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 0.43233235838169365, 1.0000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 0.63212055882855767, 1.0000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 1.7182818284590451, 1.0000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 3.1945280494653252, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 6.3618456410625557, 1.0000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 13.399537508286059, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 29.482631820515319, 1.0000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 67.071465582122514, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 156.51902263263693, 1.0000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 372.49474838021604, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 900.23154750837602, 1.0000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 2202.5465794806719, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test022() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data022) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data022[i].a), Tp(data022[i].c), + Tp(data022[i].x)); + const Tp f0 = data022[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data023[] = { + { 0.18000090799859525, 1.0000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 0.19753391135318732, 1.0000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 0.21876048320712196, 1.0000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 0.24493517885573690, 1.0000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 0.27791548623203705, 1.0000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { 0.32053903575992687, 1.0000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.37728945486109178, 1.0000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 0.45550823741508090, 1.0000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 0.56766764161830641, 1.0000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.73575888234288467, 1.0000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 1.4365636569180902, 1.0000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 2.1945280494653252, 1.0000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 3.5745637607083705, 1.0000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 6.1997687541430295, 1.0000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 11.393052728206127, 1.0000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 22.023821860707507, 1.0000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 44.434006466467693, 1.0000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 92.873687095054009, 1.0000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 199.82923277963911, 1.0000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 440.30931589613436, 1.0000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=3.0000000000000000. +template <typename Tp> +void test023() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data023) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data023[i].a), Tp(data023[i].c), + Tp(data023[i].x)); + const Tp f0 = data023[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data024[] = { + { 0.24599972760042146, 1.0000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 0.26748869621560417, 1.0000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 0.29296481879732927, 1.0000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { 0.32359920906182704, 1.0000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { 0.36104225688398150, 1.0000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 0.40767657854404399, 1.0000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.46703290885418114, 1.0000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 0.54449176258491927, 1.0000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.64849853757254050, 1.0000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.79272335297134611, 1.0000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 1.3096909707542714, 1.0000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 1.7917920741979876, 1.0000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 2.5745637607083709, 1.0000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 3.8998265656072717, 1.0000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 6.2358316369236775, 1.0000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 10.511910930353745, 1.0000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 18.614574199914728, 1.0000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 34.452632660645271, 1.0000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 66.276410926546333, 1.0000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 131.79279476884014, 1.0000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test024() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data024) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data024[i].a), Tp(data024[i].c), + Tp(data024[i].x)); + const Tp f0 = data024[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data025[] = { + { 0.30160010895983153, 1.0000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 0.32556057945973144, 1.0000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 0.35351759060133547, 1.0000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 0.38651473767895589, 1.0000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.42597182874401224, 1.0000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.47385873716476495, 1.0000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 0.53296709114581886, 1.0000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 0.60734431655344123, 1.0000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.70300292485491900, 1.0000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.82910658811461568, 1.0000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 1.2387638830170857, 1.0000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 1.5835841483959754, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 2.0994183476111612, 1.0000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 2.8998265656072721, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 4.1886653095389432, 1.0000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 6.3412739535691678, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 10.065470971379844, 1.0000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 16.726316330322632, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 29.011738189576135, 1.0000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 52.317117907536058, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=5.0000000000000000. +template <typename Tp> +void test025() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data025) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data025[i].a), Tp(data025[i].c), + Tp(data025[i].x)); + const Tp f0 = data025[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data026[] = { + { 0.34919994552008432, 1.0000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 0.37468856696681579, 1.0000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 0.40405150587416544, 1.0000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 0.43820375880074558, 1.0000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 0.47835680937998976, 1.0000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 0.52614126283523510, 1.0000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 0.58379113606772637, 1.0000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.65442613907759817, 1.0000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.74249268786270239, 1.0000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.85446705942692136, 1.0000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 1.1938194150854282, 1.0000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 1.4589603709899384, 1.0000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 1.8323639126852680, 1.0000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 2.3747832070090902, 1.0000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 3.1886653095389415, 1.0000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 4.4510616279743056, 1.0000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 6.4753364081284595, 1.0000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 9.8289477064516344, 1.0000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 15.562076771986721, 1.0000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 25.658558953767979, 1.0000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test026() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data026) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data026[i].a), Tp(data026[i].c), + Tp(data026[i].x)); + const Tp f0 = data026[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data027[] = { + { 0.39048003268794951, 1.0000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 0.41687428868878945, 1.0000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 0.44696137059437596, 1.0000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 0.48153963531364646, 1.0000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 0.52164319062001030, 1.0000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 0.56863048459771781, 1.0000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.62431329589841034, 1.0000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.69114772184480400, 1.0000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.77252193641189282, 1.0000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.87319764343847150, 1.0000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 1.1629164905125695, 1.0000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 1.3768811129698151, 1.0000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 1.6647278253705360, 1.0000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 2.0621748105136359, 1.0000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 2.6263983714467298, 1.0000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 3.4510616279743078, 1.0000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 4.6931454926815448, 1.0000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 6.6217107798387476, 1.0000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 9.7080511813245050, 1.0000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 14.795135372260793, 1.0000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=7.0000000000000000. +template <typename Tp> +void test027() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data027) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data027[i].a), Tp(data027[i].c), + Tp(data027[i].x)); + const Tp f0 = data027[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data028[] = { + { 0.42666397711843540, 1.0000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 0.45354221990871918, 1.0000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 0.48390880072992104, 1.0000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 0.51846036468635348, 1.0000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 0.55808294427665472, 1.0000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.60391732156319489, 1.0000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.65745173217778197, 1.0000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.72065531569545760, 1.0000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.79617322255837530, 1.0000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.88761649593069913, 1.0000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.1404154335879861, 1.0000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 1.3190838953943527, 1.0000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 1.5510315925312508, 1.0000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 1.8588059183988628, 1.0000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 2.2769577200254218, 1.0000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 2.8595718993033583, 1.0000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 3.6931454926815368, 1.0000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 4.9189969323589020, 1.0000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 6.7729286965857218, 1.0000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 9.6565947605825802, 1.0000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test028() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data028) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data028[i].a), Tp(data028[i].c), + Tp(data028[i].x)); + const Tp f0 = data028[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data029[] = { + { 0.45866881830525175, 1.0000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.48574024897002721, 1.0000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 0.51609119927007907, 1.0000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.55033101178702437, 1.0000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.58922274096446048, 1.0000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.63373228549888783, 1.0000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.68509653564443607, 1.0000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.74491915814544640, 1.0000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.81530710976649901, 1.0000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.89906803255440670, 1.0000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.1233234687038898, 1.0000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 1.2763355815774109, 1.0000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 1.4694175800833353, 1.0000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 1.7176118367977251, 1.0000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 2.0431323520406752, 1.0000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 2.4794291990711450, 1.0000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 3.0778805630646140, 1.0000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 3.9189969323588896, 1.0000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 5.1314921747428537, 1.0000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 6.9252758084660462, 1.0000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=9.0000000000000000. +template <typename Tp> +void test029() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data029) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data029[i].a), Tp(data029[i].c), + Tp(data029[i].x)); + const Tp f0 = data029[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data030[] = { + { 0.48719806352527339, 1.0000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.51425975102997279, 1.0000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.54439740082116117, 1.0000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.57814584198811125, 1.0000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.61616588855330923, 1.0000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.65928188610200156, 1.0000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.70853279480001885, 1.0000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.76524252556366068, 1.0000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.83111800605075459, 1.0000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.90838770701033944, 1.0000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.1099112183350075, 1.0000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 1.2435101170983485, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 1.4082527402500060, 1.0000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 1.6146266327948817, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 1.8776382336732149, 1.0000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 2.2191437986067171, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 2.6715607239402184, 1.0000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 3.2838715489037504, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 4.1314921747428679, 1.0000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 5.3327482276194447, 1.0000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test030() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data030) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data030[i].a), Tp(data030[i].c), + Tp(data030[i].x)); + const Tp f0 = data030[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data031[] = { + { -0.00040859936786236367, 2.0000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { -0.00098727843269343649, 2.0000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { -0.0023482383953175828, 2.0000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { -0.0054712917933270972, 2.0000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { -0.012393760883331793, 2.0000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { -0.026951787996341868, 2.0000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { -0.054946916666202536, 2.0000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { -0.099574136735727889, 2.0000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { -0.13533528323661270, 2.0000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 5.4365636569180902, 2.0000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 22.167168296791949, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 80.342147692750672, 2.0000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 272.99075016572118, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 890.47895461545954, 2.0000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 2824.0015544491457, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 8773.0652674276680, 2.0000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 26828.621883375556, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 81030.839275753839, 2.0000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 242291.12374287390, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=1.0000000000000000. +template <typename Tp> +void test031() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data031) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data031[i].a), Tp(data031[i].c), + Tp(data031[i].x)); + const Tp f0 = data031[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for a=2.0000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data032[] = { + { 4.5399929762484854e-05, 2.0000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { 0.00012340980408667956, 2.0000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 2.0000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.00091188196555451624, 2.0000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 2.0000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 0.0067379469990854670, 2.0000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 0.018315638888734179, 2.0000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 0.049787068367863944, 2.0000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 0.13533528323661270, 2.0000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 0.36787944117144233, 2.0000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 2.7182818284590451, 2.0000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 7.3890560989306504, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 20.085536923187668, 2.0000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 54.598150033144236, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 148.41315910257660, 2.0000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 403.42879349273511, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 1096.6331584284585, 2.0000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 2980.9579870417283, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 8103.0839275753842, 2.0000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 22026.465794806718, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test032() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data032) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data032[i].a), Tp(data032[i].c), + Tp(data032[i].x)); + const Tp f0 = data032[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data033[] = { + { 0.019990012015452256, 2.0000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 0.024660886468126749, 2.0000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 0.031155651135902421, 2.0000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 0.040518569154104643, 2.0000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 0.054591596375740861, 2.0000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { 0.076765785440438966, 2.0000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.11355272569454113, 2.0000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 0.17796705033967650, 2.0000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 0.29699707514508100, 2.0000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.52848223531423066, 2.0000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 2.0000000000000000, 2.0000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 4.1945280494653261, 2.0000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 9.1491275214167409, 2.0000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 20.599306262429089, 2.0000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 47.572210912824517, 2.0000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 112.11910930353754, 2.0000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 268.60403879880613, 2.0000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 652.11580966537815, 2.0000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 1600.6338622371129, 2.0000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 3964.7838430652091, 2.0000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=3.0000000000000000. +template <typename Tp> +void test033() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data033) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data033[i].a), Tp(data033[i].c), + Tp(data033[i].x)); + const Tp f0 = data033[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data034[] = { + { 0.048003268794942940, 2.0000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 0.057624341628353531, 2.0000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 0.070351812026707330, 2.0000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { 0.087607118443556703, 2.0000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { 0.11166194492814813, 2.0000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 0.14626395019169278, 2.0000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.19780254687491294, 2.0000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 0.27754118707540443, 2.0000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.40600584970983811, 2.0000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.62182994108596168, 2.0000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 1.6903090292457283, 2.0000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 3.0000000000000000, 2.0000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 5.5745637607083705, 2.0000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 10.799653131214550, 2.0000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 21.707494910771043, 2.0000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 45.047643721415056, 2.0000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 96.072870999573695, 2.0000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 209.71579596387159, 2.0000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 466.93487648582493, 2.0000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 1057.3423581507243, 2.0000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test034() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data034) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data034[i].a), Tp(data034[i].c), + Tp(data034[i].x)); + const Tp f0 = data034[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data035[] = { + { 0.079198583522191404, 2.0000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 0.093273046483222530, 2.0000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 0.11130650338531098, 2.0000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 0.13485262321044020, 2.0000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.16625354130388895, 2.0000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.20913010268188095, 2.0000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 0.26923036197926808, 2.0000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 0.35593410067935288, 2.0000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.48498537572540468, 2.0000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.68357364754153715, 2.0000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 1.5224722339658285, 2.0000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 2.4164158516040235, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 4.0000000000000009, 2.0000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 6.8998265656072721, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 12.377330619077886, 2.0000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 23.023821860707503, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 44.261883885519374, 2.0000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 87.631581651613160, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 178.07042913745681, 2.0000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 370.21982535275242, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=5.0000000000000000. +template <typename Tp> +void test035() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data035) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data035[i].a), Tp(data035[i].c), + Tp(data035[i].x)); + const Tp f0 = data035[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data036[] = { + { 0.11120076271882003, 2.0000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 0.12904862943139384, 2.0000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 0.15138192951001525, 2.0000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 0.17975865319179699, 2.0000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 0.21643190620010283, 2.0000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 0.26472863448288397, 2.0000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 0.32967091145818839, 2.0000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.41901702645681349, 2.0000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.54504387282378575, 2.0000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.72766470286539298, 2.0000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 1.4185417547437151, 2.0000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 2.0820792580201224, 2.0000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 3.1676360873147318, 2.0000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 4.9999999999999982, 2.0000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 8.1886653095389406, 2.0000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 13.902123255948611, 2.0000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 24.426009224385378, 2.0000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 44.315790825806538, 2.0000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 82.810383859933609, 2.0000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 158.95135372260788, 2.0000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test036() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data036) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data036[i].a), Tp(data036[i].c), + Tp(data036[i].x)); + const Tp f0 = data036[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data037[] = { + { 0.14279950968075858, 2.0000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 0.16375995835694801, 2.0000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 0.18950218227311263, 2.0000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 0.22152437623624174, 2.0000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 0.26192490317988687, 2.0000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 0.31369515402282139, 2.0000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.38118033691430731, 2.0000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.47081822524156886, 2.0000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.59234644511675072, 2.0000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.76081413936917086, 2.0000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 1.3483340379497220, 2.0000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 1.8693566610905543, 2.0000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 2.6705443492589280, 2.0000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 3.9378251894863650, 2.0000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 6.0000000000000018, 2.0000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 9.4510616279743118, 2.0000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 15.386290985363090, 2.0000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 25.865132339516244, 2.0000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 44.832204725298020, 2.0000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 79.975676861303967, 2.0000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=7.0000000000000000. +template <typename Tp> +void test037() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data037) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data037[i].a), Tp(data037[i].c), + Tp(data037[i].x)); + const Tp f0 = data037[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data038[] = { + { 0.17337636610503362, 2.0000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 0.19686670136921000, 2.0000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 0.22527678978110538, 2.0000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 0.26001525907740475, 2.0000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 0.30300466868014397, 2.0000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.35690946280485503, 2.0000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.42548267822218039, 2.0000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.51410215874088183, 2.0000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.63061421953299790, 2.0000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.78668452848510595, 2.0000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.2979228320600693, 2.0000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 1.7236644184225898, 2.0000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 2.3469052224062485, 2.0000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 3.2823881632022749, 2.0000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 4.7230422799745782, 2.0000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 7.0000000000000009, 2.0000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 10.693145492681536, 2.0000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 16.837993864717802, 2.0000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 27.318786089757165, 2.0000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 45.626379042330321, 2.0000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test038() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data038) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data038[i].a), Tp(data038[i].c), + Tp(data038[i].x)); + const Tp f0 = data038[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data039[] = { + { 0.20263008881072142, 2.0000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.22815601647956382, 2.0000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 0.25863201094881560, 2.0000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.29536583498165569, 2.0000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.34010436746201422, 2.0000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.39521257401334392, 2.0000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.46393810791120338, 2.0000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.55080841854553553, 2.0000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.66223601210150940, 2.0000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.80745573956474603, 2.0000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.2600591877766618, 2.0000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 1.6183220921129462, 2.0000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 2.1223296796666578, 2.0000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 2.8471644896068233, 2.0000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 3.9137352959186495, 2.0000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 5.5205708009288541, 2.0000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 7.9999999999999982, 2.0000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 11.918996932358892, 2.0000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 18.262984349485706, 2.0000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 28.775827425398138, 2.0000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=9.0000000000000000. +template <typename Tp> +void test039() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data039) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data039[i].a), Tp(data039[i].c), + Tp(data039[i].x)); + const Tp f0 = data039[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data040[] = { + { 0.23043485654507717, 2.0000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.25758423249046342, 2.0000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.28964158686142122, 2.0000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.32781237017833142, 2.0000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.37367756025366927, 2.0000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.42933548067397925, 2.0000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.49760646239977369, 2.0000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.58233221879973318, 2.0000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.68881993949245379, 2.0000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.82451063690694526, 2.0000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.2306214716549471, 2.0000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 1.5389392974099088, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 1.9587362987499699, 2.0000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 2.5414934688204727, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 3.3670852989803555, 2.0000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 4.5617124027865650, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 6.3284392760597825, 2.0000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 9.0000000000000036, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 13.131492174742865, 2.0000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 19.665496455238888, 2.0000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test040() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data040) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data040[i].a), Tp(data040[i].c), + Tp(data040[i].x)); + const Tp f0 = data040[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data041[] = { + { 0.00049939922738733355, 5.0000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { -0.00057077034390089253, 5.0000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { -0.0032428054030576147, 5.0000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { -0.0078649819529077025, 5.0000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { -0.012393760883331793, 5.0000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { -0.0087031815404853934, 5.0000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 0.018315638888832021, 5.0000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { 0.068457219005814696, 5.0000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.045111761078875295, 5.0000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { -0.22992465073215118, 5.0000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 23.671704256164183, 5.0000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 199.50451467112745, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 1232.7498286606428, 5.0000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 6460.7810872554019, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 30480.352550691667, 5.0000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 133534.93064609534, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 553479.89366849652, 5.0000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 2196966.0364497532, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 8422142.8572236635, 5.0000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 31373029.447069697, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=1.0000000000000000. +template <typename Tp> +void test041() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data041) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data041[i].a), Tp(data041[i].c), + Tp(data041[i].x)); + const Tp f0 = data041[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000034e-10)); +} + +// Test data for a=5.0000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data042[] = { + { -0.00025726626865408083, 5.0000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { -0.00029309828470586396, 5.0000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { -0.00011182087596750395, 5.0000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.00064591639226778245, 5.0000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 5.0000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 0.0053342080409426616, 5.0000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 0.0061052129629022966, 5.0000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { -0.0062233835459823200, 5.0000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { -0.045111761078871798, 5.0000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { -0.015328310048810216, 5.0000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 8.2681072282295975, 5.0000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 46.797355293227440, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 223.45159827046285, 5.0000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 964.56731725221459, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 3889.6615448133625, 5.0000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 14926.865359231202, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 55151.509259297891, 5.0000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 197736.87980710136, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 691800.79031674843, 5.0000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 2371516.1505741901, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test042() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data042) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data042[i].a), Tp(data042[i].c), + Tp(data042[i].x)); + const Tp f0 = data042[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for a=5.0000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data043[] = { + { 0.00012106647936662629, 5.0000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 0.00021596715715168925, 5.0000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 5.0000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 0.00037995081898104839, 5.0000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 0.0000000000000000, 5.0000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { -0.0016844867497713672, 5.0000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { -0.0061052129629113917, 5.0000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { -0.012446767091965986, 5.0000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 7.5126173746727200e-18, 5.0000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.15328310048810098, 5.0000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 4.7569931998033290, 5.0000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 19.704149597148401, 5.0000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 75.320763461953760, 5.0000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 272.99075016572118, 5.0000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 952.31777090819992, 5.0000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 3227.4303479418809, 5.0000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 10692.173294677470, 5.0000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 34777.843182153498, 5.0000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 111417.40400416154, 5.0000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 352423.45271690749, 5.0000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=3.0000000000000000. +template <typename Tp> +void test043() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data043) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data043[i].a), Tp(data043[i].c), + Tp(data043[i].x)); + const Tp f0 = data043[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for a=5.0000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data044[] = { + { -6.8099894643727278e-05, 5.0000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { -0.00015426225510834944, 5.0000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { -0.00033546262790251185, 5.0000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { -0.00068391147416588716, 5.0000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { -0.0012393760883331792, 5.0000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { -0.0016844867497713668, 5.0000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.0000000000000000, 5.0000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 0.012446767091965986, 5.0000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.067667641618306351, 5.0000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.27590958087858175, 5.0000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 3.3978522855738063, 5.0000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 11.083584148395975, 5.0000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 35.149689615578417, 5.0000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 109.19630006628847, 5.0000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 333.92960798079736, 5.0000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 1008.5719837318378, 5.0000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 3015.7411856782610, 5.0000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 8942.8739611251840, 5.0000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 26335.022764620000, 5.0000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 77092.630281823513, 5.0000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test044() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data044) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data044[i].a), Tp(data044[i].c), + Tp(data044[i].x)); + const Tp f0 = data044[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for a=5.0000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data045[] = { + { 4.5399929762484854e-05, 5.0000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 0.00012340980408667956, 5.0000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 5.0000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 0.00091188196555451624, 5.0000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 5.0000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.0067379469990854670, 5.0000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 0.018315638888734179, 5.0000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 0.049787068367863944, 5.0000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.13533528323661270, 5.0000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.36787944117144233, 5.0000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 2.7182818284590451, 5.0000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 7.3890560989306504, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 20.085536923187668, 5.0000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 54.598150033144236, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 148.41315910257660, 5.0000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 403.42879349273511, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 1096.6331584284585, 5.0000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 2980.9579870417283, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 8103.0839275753842, 5.0000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 22026.465794806718, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=5.0000000000000000. +template <typename Tp> +void test045() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data045) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data045[i].a), Tp(data045[i].c), + Tp(data045[i].x)); + const Tp f0 = data045[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data046[] = { + { 0.0011648967743076431, 5.0000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 0.0019205128456127479, 5.0000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 0.0032972446271226320, 5.0000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 0.0059047424914709006, 5.0000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 0.011033078698817415, 5.0000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 0.021485057853495842, 5.0000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 0.043495671658608563, 5.0000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.091228027395668113, 5.0000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.19744881503891684, 5.0000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.43918161928124549, 5.0000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 2.3226822806570353, 5.0000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 5.4863201236633126, 5.0000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 13.144500379942246, 5.0000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 31.873916035045447, 5.0000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 78.086286951596321, 5.0000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 192.98291046720354, 5.0000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 480.54877204888402, 5.0000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 1204.4605636118313, 5.0000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 3036.1329048350581, 5.0000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 7691.6406555465064, 5.0000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test046() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data046) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data046[i].a), Tp(data046[i].c), + Tp(data046[i].x)); + const Tp f0 = data046[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +// Test data for a=5.0000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data047[] = { + { 0.0036308901122103932, 5.0000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 0.0055327336019229401, 5.0000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 0.0086767852656603455, 5.0000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 0.014030481266326614, 5.0000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 0.023426839582149212, 5.0000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 0.040427681994512799, 5.0000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.072123784177593755, 5.0000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.13295857409596740, 5.0000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.25298991319893882, 5.0000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.49602437239337821, 5.0000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 2.0681072498819240, 5.0000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 4.3768811129698140, 5.0000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 9.4566368471992224, 5.0000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 20.811741224531826, 5.0000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 46.556488803696276, 5.0000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 105.66804767556316, 5.0000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 242.93097638084427, 5.0000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 564.89804380887358, 5.0000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 1326.9606865425994, 5.0000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 3145.3685154983909, 5.0000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=7.0000000000000000. +template <typename Tp> +void test047() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data047) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data047[i].a), Tp(data047[i].c), + Tp(data047[i].x)); + const Tp f0 = data047[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for a=5.0000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data048[] = { + { 0.0075295293831406122, 5.0000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 0.010936052508673187, 5.0000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 0.016247454253649721, 5.0000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 0.024729468107576008, 5.0000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 0.038615775445860964, 5.0000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.061937865588523586, 5.0000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.10213565389690644, 5.0000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.17324118243379236, 5.0000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.30228316551605494, 5.0000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.54238748802203829, 5.0000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.8922997283093959, 5.0000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 3.6699742831126270, 5.0000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 7.2831842359960941, 5.0000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 14.764676530664770, 5.0000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 30.522558591756702, 5.0000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 64.236147093730224, 5.0000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 137.40503032883328, 5.0000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 298.29153884828759, 5.0000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 656.29389355002741, 5.0000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 1461.6183101433730, 5.0000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test048() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data048) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data048[i].a), Tp(data048[i].c), + Tp(data048[i].x)); + const Tp f0 = data048[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for a=5.0000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data049[] = { + { 0.012801285049305222, 5.0000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.017955923031350202, 5.0000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 0.025661650371090718, 5.0000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.037414616710204310, 5.0000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.055720934057414885, 5.0000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.084862956151755986, 5.0000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.13230635170162319, 5.0000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.21132914572142125, 5.0000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.34601808641639625, 5.0000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.58092180965710882, 5.0000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.7643922061378634, 5.0000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 3.1888010096332451, 5.0000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 5.8981194929479273, 5.0000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 11.152835510393174, 5.0000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 21.533483453443495, 5.0000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 42.397145995355721, 5.0000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 85.010891404859976, 5.0000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 173.36225868739959, 5.0000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 359.10444177844266, 5.0000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 754.64844371961385, 5.0000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=9.0000000000000000. +template <typename Tp> +void test049() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data049) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data049[i].a), Tp(data049[i].c), + Tp(data049[i].x)); + const Tp f0 = data049[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for a=5.0000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data050[] = { + { 0.019313731161840469, 5.0000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.026361085775183927, 5.0000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.036556772070711910, 5.0000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.051563934048344140, 5.0000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.074056625794521824, 5.0000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.10841132531381445, 5.0000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.16192115120742598, 5.0000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.24696279814742436, 5.0000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.38492640633381947, 5.0000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.61345628229723270, 5.0000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.6675470647226096, 5.0000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 2.8442428103603667, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 4.9603804008438397, 5.0000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 8.8405953071624790, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 16.089667272320334, 5.0000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 29.876575194426895, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 56.546719856432318, 5.0000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 108.97420168465270, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 213.60609045832913, 5.0000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 425.41323880637168, 5.0000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test050() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data050) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data050[i].a), Tp(data050[i].c), + Tp(data050[i].x)); + const Tp f0 = data050[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=10.000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data051[] = { + { 0.00067155063653961283, 10.000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { -0.00071555648905258641, 10.000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { -0.0035372078786207375, 10.000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { -0.0047884005574714370, 10.000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 10.000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 0.018136827242522878, 10.000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 0.0099686175680129968, 10.000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { -0.052832081031434205, 10.000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.0010979582061524211, 10.000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 0.11394854824644544, 10.000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 131.63017574352625, 10.000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 2431.2913698755492, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 27127.328899791049, 10.000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 232066.49977835573, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 1674401.3794931532, 10.000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 10707495.820386337, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 62515499.242815509, 10.000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 339773485.00937450, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 1742442474.2135217, 10.000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 8514625476.5462780, 10.000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=1.0000000000000000. +template <typename Tp> +void test051() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data051) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data051[i].a), Tp(data051[i].c), + Tp(data051[i].x)); + const Tp f0 = data051[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for a=10.000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data052[] = { + { -0.00014116415550486912, 10.000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { -0.00016988130843806985, 10.000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 6.6619209703391391e-05, 10.000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.00072582919646365740, 10.000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.0012039653429522313, 10.000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { -0.00061450715370021350, 10.000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { -0.0053557899960354968, 10.000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { -0.00078903612815141419, 10.000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 0.023725444715554326, 10.000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { -0.057297669024384767, 10.000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 34.432116659636534, 10.000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 432.53475371634494, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 3789.1768909683515, 10.000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 27089.676185774806, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 169243.72183073507, 10.000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 959019.40135397331, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 5043073.3458297960, 10.000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 24989309.819281481, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 117948708.50540228, 10.000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 534524325.69810420, 10.000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test052() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data052) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data052[i].a), Tp(data052[i].c), + Tp(data052[i].x)); + const Tp f0 = data052[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for a=10.000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data053[] = { + { 1.4973169075105230e-05, 10.000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 5.7627971015476259e-05, 10.000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 9.5964794084281178e-05, 10.000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 1.5479477810339013e-05, 10.000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { -0.00035410745380947978, 10.000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { -0.00078393993138610115, 10.000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.00038117202625584341, 10.000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 0.0045341794406447526, 10.000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { -0.0031029253652133434, 10.000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { -0.028487137061611361, 10.000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 15.691485606063281, 10.000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 141.71088859081422, 10.000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 997.55177799313742, 10.000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 6038.6324280926056, 10.000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 32946.952425437157, 10.000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 166431.66712118863, 10.000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 791818.30272061308, 10.000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 3589678.0198700386, 10.000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 15637649.698874988, 10.000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 65871447.346678361, 10.000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=3.0000000000000000. +template <typename Tp> +void test053() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data053) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data053[i].a), Tp(data053[i].c), + Tp(data053[i].x)); + const Tp f0 = data053[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data054[] = { + { 6.9661267889527031e-06, 10.000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { -3.0301514396282926e-06, 10.000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { -3.7983599138168025e-05, 10.000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { -9.3615660121163871e-05, 10.000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { -7.0821490761895943e-05, 10.000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 0.00030692863727646260, 10.000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.0010659895649527829, 10.000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { -0.00042230102633456065, 10.000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { -0.010168047735237568, 10.000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.036903514708782073, 10.000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 9.3384756433214022, 10.000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 63.905561372021388, 10.000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 370.08498456728779, 10.000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 1922.9526217493540, 10.000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 9245.0380014351485, 10.000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 41898.961838459785, 10.000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 181211.14084739226, 10.000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 754384.25570692297, 10.000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 3042060.4915799876, 10.000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 11939626.424402930, 10.000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test054() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data054) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data054[i].a), Tp(data054[i].c), + Tp(data054[i].x)); + const Tp f0 = data054[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000026e-09)); +} + +// Test data for a=10.000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data055[] = { + { -6.2454929831989742e-06, 10.000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { -1.1459481808048817e-05, 10.000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { -8.1646988801669512e-06, 10.000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 3.1240400671775088e-05, 10.000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.00014164298152379191, 10.000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.00023172833594738379, 10.000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { -0.00036825094062005220, 10.000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { -0.0030227862937631683, 10.000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { -0.00028642387986584615, 10.000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.10617896040159881, 10.000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 6.4803694966028260, 10.000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 35.201619637445276, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 171.58787257237464, 10.000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 775.87148867205678, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 3317.4071019773678, 10.000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 13578.260535269774, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 53651.761875039716, 10.000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 205900.60390283042, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 770979.49612334219, 10.000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 2826613.2348531331, 10.000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=5.0000000000000000. +template <typename Tp> +void test055() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data055) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data055[i].a), Tp(data055[i].c), + Tp(data055[i].x)); + const Tp f0 = data055[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data056[] = { + { 9.6084507433830306e-07, 10.000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 7.7131127554174726e-06, 10.000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 2.3074149009167486e-05, 10.000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 4.0105919781332888e-05, 10.000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { -7.7443012320393170e-21, 10.000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { -0.00029188857701064686, 10.000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { -0.0010659895649527829, 10.000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { -0.00044452739614164190, 10.000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.020049671590609292, 10.000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.17092282236966813, 10.000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 4.9520550902714540, 10.000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 22.206263831706924, 10.000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 93.074943420842843, 10.000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 371.20964440523989, 10.000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 1424.6976175888544, 10.000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 5302.2070001902330, 10.000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 19239.311823447424, 10.000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 68341.221999215923, 10.000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 238389.83519072225, 10.000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 818592.04096678516, 10.000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test056() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data056) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data056[i].a), Tp(data056[i].c), + Tp(data056[i].x)); + const Tp f0 = data056[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000012e-08)); +} + +// Test data for a=10.000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data057[] = { + { 3.9634859316455036e-06, 10.000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 4.4074930030956985e-06, 10.000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { -5.3248036175001926e-06, 10.000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { -5.0660109197473119e-05, 10.000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { -0.00017705372690473989, 10.000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { -0.00034759250392107569, 10.000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.00029072442680530428, 10.000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.0071124383382662791, 10.000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.046185850628367831, 10.000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.22919473120601763, 10.000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 4.0342754120781059, 10.000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 15.423188523958421, 10.000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 56.669907747565212, 10.000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 201.92649139242229, 10.000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 702.01780019948944, 10.000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 2391.7564185640722, 10.000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 8011.5144629634615, 10.000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 26450.087535814702, 10.000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 86239.964657766584, 10.000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 278127.83396458323, 10.000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=7.0000000000000000. +template <typename Tp> +void test057() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data057) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data057[i].a), Tp(data057[i].c), + Tp(data057[i].x)); + const Tp f0 = data057[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000004e-06)); +} + +// Test data for a=10.000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data058[] = { + { -5.0444366402760924e-06, 10.000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { -1.5426225510834945e-05, 10.000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { -3.7273625322501334e-05, 10.000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { -6.3325136496841480e-05, 10.000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { -2.7519677388747149e-19, 10.000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.00065507818046664273, 10.000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.0040701419752742617, 10.000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.018670150637948978, 10.000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.075186268464784836, 10.000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.28101901756151842, 10.000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 3.4356061998579595, 10.000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 11.494087265003234, 10.000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 37.660381730976880, 10.000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 121.32922229587608, 10.000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 385.46195489141422, 10.000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 1210.2863804782053, 10.000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 3762.0609740531836, 10.000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 11592.614394051165, 10.000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 35450.992183142305, 10.000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 107684.94388572175, 10.000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test058() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data058) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data058[i].a), Tp(data058[i].c), + Tp(data058[i].x)); + const Tp f0 = data058[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data059[] = { + { -5.0444366402760974e-06, 10.000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.0000000000000000, 10.000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 3.7273625322501334e-05, 10.000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.00020264043678989247, 10.000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.00082625072555545290, 10.000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.0029946431107046520, 10.000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.010175354938185655, 10.000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.033191378911909299, 10.000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.10526077585069878, 10.000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.32700394770794872, 10.000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 3.0203131427322725, 10.000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 9.0310685653596838, 10.000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 26.780715897583555, 10.000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 78.863994492319449, 10.000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 230.86491415956360, 10.000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 672.38132248789179, 10.000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 1949.5700594283705, 10.000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 5630.6984199677090, 10.000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 16206.167855150768, 10.000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 46500.316677925293, 10.000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=9.0000000000000000. +template <typename Tp> +void test059() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data059) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data059[i].a), Tp(data059[i].c), + Tp(data059[i].x)); + const Tp f0 = data059[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data060[] = { + { 4.5399929762484854e-05, 10.000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.00012340980408667956, 10.000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 10.000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.00091188196555451624, 10.000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 10.000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.0067379469990854670, 10.000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.018315638888734179, 10.000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.049787068367863944, 10.000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.13533528323661270, 10.000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.36787944117144233, 10.000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 2.7182818284590451, 10.000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 7.3890560989306504, 10.000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 20.085536923187668, 10.000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 54.598150033144236, 10.000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 148.41315910257660, 10.000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 403.42879349273511, 10.000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 1096.6331584284585, 10.000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 2980.9579870417283, 10.000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 8103.0839275753842, 10.000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 22026.465794806718, 10.000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test060() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data060) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data060[i].a), Tp(data060[i].c), + Tp(data060[i].x)); + const Tp f0 = data060[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data061[] = { + { 0.00018021852293239465, 20.000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { 0.0017726368057851861, 20.000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { 0.00058280040382329248, 20.000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { -0.0049657717020590141, 20.000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { -0.0012360336087128597, 20.000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 0.014898894139255305, 20.000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { -0.013800784612552089, 20.000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { -0.012192213426039619, 20.000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.050311246773136239, 20.000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { -0.025985814502838461, 20.000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 1563.6577385252015, 20.000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 86377.091910766278, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 2216718.8789979252, 20.000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 38045018.520647161, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 504376263.68346798, 20.000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 5565635666.7972031, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 53451562646.544518, 20.000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 460009135340.33868, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 3620401937301.4907, 20.000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 26446266822604.152, 20.000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=1.0000000000000000. +template <typename Tp> +void test061() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data061) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data061[i].a), Tp(data061[i].c), + Tp(data061[i].x)); + const Tp f0 = data061[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for a=20.000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data062[] = { + { 6.6647681992684102e-05, 20.000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { -3.7248253270227178e-05, 20.000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { -0.00024392611307344028, 20.000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 2.4034559592246216e-05, 20.000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.00081645960584843073, 20.000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { -0.00051326387116462115, 20.000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { -0.0021786279856333920, 20.000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 0.0061029380625179973, 20.000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { -0.011834301617155171, 20.000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 0.037622016973681095, 20.000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 303.10954080179744, 20.000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 11508.923130556599, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 234541.86023461280, 20.000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 3398931.2897027107, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 39382712.287920594, 20.000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 388350500.37087941, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 3385284070.5527201, 20.000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 26751585258.405773, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 195061928138.27673, 20.000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 1329571695324.3132, 20.000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test062() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data062) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data062[i].a), Tp(data062[i].c), + Tp(data062[i].x)); + const Tp f0 = data062[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for a=20.000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data063[] = { + { -8.6671962318505729e-06, 20.000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { -1.8205565180535418e-05, 20.000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 1.5620588717927631e-05, 20.000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 7.6532767373103759e-05, 20.000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { -5.2708600380172109e-05, 20.000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { -0.00028546308121326264, 20.000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.00056490746026256289, 20.000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { -5.0602588875468348e-07, 20.000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { -0.0021376080642211705, 20.000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.0028873127225376070, 20.000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 106.38207299128953, 20.000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 2880.5734732831320, 20.000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 47353.756965165747, 20.000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 584732.27978148917, 20.000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 5957333.1101321029, 20.000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 52725595.633352734, 20.000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 418560160.03369552, 20.000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 3045067611.3150902, 20.000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 20614600690.354652, 20.000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 131344201933.74118, 20.000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=3.0000000000000000. +template <typename Tp> +void test063() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data063) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data063[i].a), Tp(data063[i].c), + Tp(data063[i].x)); + const Tp f0 = data063[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000007e-09)); +} + +// Test data for a=20.000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data064[] = { + { -1.1286669552452404e-06, 20.000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 3.9595188785137704e-06, 20.000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 8.6940153052790034e-06, 20.000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { -1.0858814018067509e-05, 20.000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { -4.1826023828710966e-05, 20.000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 6.6455893622436357e-05, 20.000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.00014238710517977903, 20.000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { -0.00071796294700866132, 20.000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.0020884061677332653, 20.000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { -0.012768833157321986, 20.000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 50.659916934657751, 20.000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 1014.3134442335910, 20.000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 13665.584449611581, 20.000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 145123.62797278629, 20.000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 1308144.4519382305, 20.000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 10438124.578674613, 20.000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 75719160.524424642, 20.000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 508510905.96310234, 20.000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 3203200954.5618095, 20.000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 19111993543.124691, 20.000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test064() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data064) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data064[i].a), Tp(data064[i].c), + Tp(data064[i].x)); + const Tp f0 = data064[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000007e-09)); +} + +// Test data for a=20.000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data065[] = { + { 8.4755643455670995e-07, 20.000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 8.5721061862565634e-07, 20.000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { -2.8228700837555599e-06, 20.000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { -6.6486802159657585e-06, 20.000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 1.1816828026110384e-05, 20.000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 3.6173872819745767e-05, 20.000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { -0.00011481934287296673, 20.000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 1.2650647218867087e-07, 20.000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.0010626537950495971, 20.000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { -0.0085499011205641979, 20.000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 29.126637808809363, 20.000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 446.26914983518060, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 5005.6470164856382, 20.000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 46145.715220935213, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 370342.18574452243, 20.000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 2676402.7371661114, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 17803174.102029990, 20.000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 110674464.63597310, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 650149739.34228516, 20.000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 3639417243.5150661, 20.000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=5.0000000000000000. +template <typename Tp> +void test065() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data065) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data065[i].a), Tp(data065[i].c), + Tp(data065[i].x)); + const Tp f0 = data065[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000005e-07)); +} + +// Test data for a=20.000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data066[] = { + { -1.9022359545309947e-08, 20.000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { -7.4533809656234677e-07, 20.000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { -9.7852420358724059e-07, 20.000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 3.0181569866746340e-06, 20.000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 7.9816910701457280e-06, 20.000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { -2.0133163153966078e-05, 20.000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { -4.7462368393259678e-05, 20.000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.00031910869938964821, 20.000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { -0.0010380528468056445, 20.000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.0084752097558651162, 20.000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 19.002159564861387, 20.000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 229.93981298721295, 20.000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 2180.3120758940981, 20.000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 17610.732510305290, 20.000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 126633.20907014773, 20.000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 832692.83016874129, 20.000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 5097225.0940651651, 20.000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 29414585.342530537, 20.000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 161513229.88138971, 20.000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 849871092.10959554, 20.000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test066() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data066) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data066[i].a), Tp(data066[i].c), + Tp(data066[i].x)); + const Tp f0 = data066[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000019e-07)); +} + +// Test data for a=20.000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data067[] = { + { -1.7754301607387143e-07, 20.000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { -6.2128605089471174e-08, 20.000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 9.1338873372533148e-07, 20.000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 1.6657400269273180e-06, 20.000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { -4.7904165143355465e-06, 20.000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { -1.5503088351319615e-05, 20.000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 5.6425108496954350e-05, 20.000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 9.1083552345479015e-05, 20.000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { -0.0018058773247853399, 20.000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.032850147696977763, 20.000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 13.551527852090816, 20.000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 133.23579819973102, 20.000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 1083.6769250393436, 20.000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 7739.1410905637622, 20.000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 50175.328973240226, 20.000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 301599.46814102860, 20.000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 1705051.1866143674, 20.000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 9159788.2353733126, 20.000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 47122070.398665302, 20.000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 233529421.53991729, 20.000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=7.0000000000000000. +template <typename Tp> +void test067() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data067) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data067[i].a), Tp(data067[i].c), + Tp(data067[i].x)); + const Tp f0 = data067[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000009e-07)); +} + +// Test data for a=20.000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data068[] = { + { 4.4385719622857060e-08, 20.000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 2.7870855352561929e-07, 20.000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 2.7221706037028333e-07, 20.000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { -1.5211293805365477e-06, 20.000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { -4.2978336531553922e-06, 20.000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 1.1339557446266738e-05, 20.000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 5.3526365220658982e-05, 20.000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { -0.00029461053269513242, 20.000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { -0.00026793636646740187, 20.000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.061061258434452835, 20.000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 10.312756690132913, 20.000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 84.471824856846425, 20.000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 597.47335666854985, 20.000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 3805.9786364107408, 20.000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 22386.068461641658, 20.000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 123573.63516975302, 20.000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 647514.24141570868, 20.000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 3247628.2434586394, 20.000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 15690070.625286423, 20.000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 73379158.893325061, 20.000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test068() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data068) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data068[i].a), Tp(data068[i].c), + Tp(data068[i].x)); + const Tp f0 = data068[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000005e-07)); +} + +// Test data for a=20.000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data069[] = { + { 7.3976263576568592e-08, 20.000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { -9.0753238092548416e-09, 20.000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { -5.5549484970396693e-07, 20.000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { -1.1104933512848787e-06, 20.000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 3.2483424385770483e-06, 20.000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 1.7493431113569438e-05, 20.000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { -3.9066110636117253e-05, 20.000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { -0.00040356155493308509, 20.000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.0037671531470534567, 20.000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.090944344485248449, 20.000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 8.2390942957149722, 20.000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 57.468054562166706, 20.000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 358.00109079775746, 20.000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 2051.3704389046998, 20.000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 11012.597503064211, 20.000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 56082.113308934473, 20.000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 273348.46918863337, 20.000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 1283674.4996444662, 20.000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 5838026.8730425332, 20.000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 25817349.972859707, 20.000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=9.0000000000000000. +template <typename Tp> +void test069() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data069) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data069[i].a), Tp(data069[i].c), + Tp(data069[i].x)); + const Tp f0 = data069[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000004e-06)); +} + +// Test data for a=20.000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data070[] = { + { -4.1157677792944940e-08, 20.000000000000000, 10.000000000000000, + -10.000000000000000 }, + { -2.0187210039960906e-07, 20.000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { -2.2272304939386817e-07, 20.000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 1.2925568212606171e-06, 20.000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 5.5744573775996227e-06, 20.000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { -6.2568272011787340e-06, 20.000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { -0.00011955177906335608, 20.000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 9.2475405516991078e-05, 20.000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.010123531287569982, 20.000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.12118937229909535, 20.000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 6.8319857942415494, 20.000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 41.356658140815220, 20.000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 229.57496033810907, 20.000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 1192.7830549969506, 20.000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 5878.6003887215920, 20.000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 27741.749322673899, 20.000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 126220.54599305884, 20.000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 556592.10886612453, 20.000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 2388555.2873243922, 20.000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 10008079.497419352, 20.000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test070() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data070) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data070[i].a), Tp(data070[i].c), + Tp(data070[i].x)); + const Tp f0 = data070[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000009e-07)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + test037<double>(); + test038<double>(); + test039<double>(); + test040<double>(); + test041<double>(); + test042<double>(); + test043<double>(); + test044<double>(); + test045<double>(); + test046<double>(); + test047<double>(); + test048<double>(); + test049<double>(); + test050<double>(); + test051<double>(); + test052<double>(); + test053<double>(); + test054<double>(); + test055<double>(); + test056<double>(); + test057<double>(); + test058<double>(); + test059<double>(); + test060<double>(); + test061<double>(); + test062<double>(); + test063<double>(); + test064<double>(); + test065<double>(); + test066<double>(); + test067<double>(); + test068<double>(); + test069<double>(); + test070<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile.cc new file mode 100644 index 000000000..a2ae94753 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.7 conf_hyperg + +#include <tr1/cmath> + +void +test01() +{ + + float af = 2.0F, cf = 3.0F, xf = 0.5F; + double ad = 2.0, cd = 3.0, xd = 0.5; + long double al = 2.0L, cl = 3.0L, xl = 0.5L; + + std::tr1::conf_hyperg(af, cf, xf); + std::tr1::conf_hypergf(af, cf, xf); + std::tr1::conf_hyperg(ad, cd, xd); + std::tr1::conf_hyperg(al, cl, xl); + std::tr1::conf_hypergl(al, cl, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_2.cc new file mode 100644 index 000000000..27b1634ba --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.7 conf_hyperg + +#include <tr1/math.h> + +void +test01() +{ + + float af = 2.0F, cf = 3.0F, xf = 0.5F; + double ad = 2.0, cd = 3.0, xd = 0.5; + long double al = 2.0L, cl = 3.0L, xl = 0.5L; + + conf_hyperg(af, cf, xf); + conf_hypergf(af, cf, xf); + conf_hyperg(ad, cd, xd); + conf_hyperg(al, cl, xl); + conf_hypergl(al, cl, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_nan.cc new file mode 100644 index 000000000..e57f83d5c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_nan.cc @@ -0,0 +1,87 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.8 cyl_bessel_i + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float nuf = 0.0F; + double nud = 0.0; + long double nul = 0.0L; + + float a = std::tr1::cyl_bessel_i(nuf, xf); + float b = std::tr1::cyl_bessel_if(nuf, xf); + double c = std::tr1::cyl_bessel_i(nud, xd); + long double d = std::tr1::cyl_bessel_i(nul, xl); + long double e = std::tr1::cyl_bessel_il(nul, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float xf = 1.0F; + double xd = 1.0; + long double xl = 1.0L; + + float nuf = std::numeric_limits<float>::quiet_NaN(); + double nud = std::numeric_limits<double>::quiet_NaN(); + long double nul = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::cyl_bessel_i(nuf, xf); + float b = std::tr1::cyl_bessel_if(nuf, xf); + double c = std::tr1::cyl_bessel_i(nud, xd); + long double d = std::tr1::cyl_bessel_i(nul, xl); + long double e = std::tr1::cyl_bessel_il(nul, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_value.cc new file mode 100644 index 000000000..929c2b6ef --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_value.cc @@ -0,0 +1,628 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// cyl_bessel_i + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for nu=0.0000000000000000. +testcase_cyl_bessel_i<double> data001[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, + { 27.239871823604439, 0.0000000000000000, 5.0000000000000000 }, + { 2815.7166284662558, 0.0000000000000000, 10.000000000000000 }, + { 339649.37329791381, 0.0000000000000000, 15.000000000000000 }, + { 43558282.559553474, 0.0000000000000000, 20.000000000000000 }, + { 5774560606.4663124, 0.0000000000000000, 25.000000000000000 }, + { 781672297823.97925, 0.0000000000000000, 30.000000000000000 }, + { 107338818494514.42, 0.0000000000000000, 35.000000000000000 }, + { 14894774793419918., 0.0000000000000000, 40.000000000000000 }, + { 2.0834140751773158e+18, 0.0000000000000000, 45.000000000000000 }, + { 2.9325537838493463e+20, 0.0000000000000000, 50.000000000000000 }, + { 4.1487895607332160e+22, 0.0000000000000000, 55.000000000000000 }, + { 5.8940770556098216e+24, 0.0000000000000000, 60.000000000000000 }, + { 8.4030398456255610e+26, 0.0000000000000000, 65.000000000000000 }, + { 1.2015889579125422e+29, 0.0000000000000000, 70.000000000000000 }, + { 1.7226390780357971e+31, 0.0000000000000000, 75.000000000000000 }, + { 2.4751784043341670e+33, 0.0000000000000000, 80.000000000000000 }, + { 3.5634776304081418e+35, 0.0000000000000000, 85.000000000000000 }, + { 5.1392383455086475e+37, 0.0000000000000000, 90.000000000000000 }, + { 7.4233258618752096e+39, 0.0000000000000000, 95.000000000000000 }, + { 1.0737517071310986e+42, 0.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.0000000000000000. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data001[i].nu), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for nu=0.33333333333333331. +testcase_cyl_bessel_i<double> data002[] = { + { 0.0000000000000000, 0.33333333333333331, 0.0000000000000000 }, + { 26.897553069268362, 0.33333333333333331, 5.0000000000000000 }, + { 2799.2396097056790, 0.33333333333333331, 10.000000000000000 }, + { 338348.63146593655, 0.33333333333333331, 15.000000000000000 }, + { 43434263.927938439, 0.33333333333333331, 20.000000000000000 }, + { 5761474759.6213636, 0.33333333333333331, 25.000000000000000 }, + { 780201111830.30225, 0.33333333333333331, 30.000000000000000 }, + { 107166066959051.92, 0.33333333333333331, 35.000000000000000 }, + { 14873836574083760., 0.33333333333333331, 40.000000000000000 }, + { 2.0808143020217085e+18, 0.33333333333333331, 45.000000000000000 }, + { 2.9292639365644229e+20, 0.33333333333333331, 50.000000000000000 }, + { 4.1445621624120489e+22, 0.33333333333333331, 55.000000000000000 }, + { 5.8885758374365916e+24, 0.33333333333333331, 60.000000000000000 }, + { 8.3958047021083955e+26, 0.33333333333333331, 65.000000000000000 }, + { 1.2006287819446431e+29, 0.33333333333333331, 70.000000000000000 }, + { 1.7213548977150022e+31, 0.33333333333333331, 75.000000000000000 }, + { 2.4734492458444449e+33, 0.33333333333333331, 80.000000000000000 }, + { 3.5611354547857122e+35, 0.33333333333333331, 85.000000000000000 }, + { 5.1360491295551829e+37, 0.33333333333333331, 90.000000000000000 }, + { 7.4189629097600431e+39, 0.33333333333333331, 95.000000000000000 }, + { 1.0731523308358370e+42, 0.33333333333333331, 100.00000000000000 }, +}; + +// Test function for nu=0.33333333333333331. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data002[i].nu), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for nu=0.50000000000000000. +testcase_cyl_bessel_i<double> data003[] = { + { 0.0000000000000000, 0.50000000000000000, 0.0000000000000000 }, + { 26.477547497559065, 0.50000000000000000, 5.0000000000000000 }, + { 2778.7846038745711, 0.50000000000000000, 10.000000000000000 }, + { 336729.88718706399, 0.50000000000000000, 15.000000000000000 }, + { 43279746.272428922, 0.50000000000000000, 20.000000000000000 }, + { 5745159748.3464680, 0.50000000000000000, 25.000000000000000 }, + { 778366068840.44580, 0.50000000000000000, 30.000000000000000 }, + { 106950522408567.66, 0.50000000000000000, 35.000000000000000 }, + { 14847705549021962., 0.50000000000000000, 40.000000000000000 }, + { 2.0775691824625661e+18, 0.50000000000000000, 45.000000000000000 }, + { 2.9251568529912988e+20, 0.50000000000000000, 50.000000000000000 }, + { 4.1392840094781220e+22, 0.50000000000000000, 55.000000000000000 }, + { 5.8817065760751945e+24, 0.50000000000000000, 60.000000000000000 }, + { 8.3867695787277231e+26, 0.50000000000000000, 65.000000000000000 }, + { 1.1994296461653203e+29, 0.50000000000000000, 70.000000000000000 }, + { 1.7197510246063332e+31, 0.50000000000000000, 75.000000000000000 }, + { 2.4712895036230794e+33, 0.50000000000000000, 80.000000000000000 }, + { 3.5582099086757769e+35, 0.50000000000000000, 85.000000000000000 }, + { 5.1320654031231090e+37, 0.50000000000000000, 90.000000000000000 }, + { 7.4135128383495227e+39, 0.50000000000000000, 95.000000000000000 }, + { 1.0724035825423179e+42, 0.50000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.50000000000000000. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data003[i].nu), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for nu=0.66666666666666663. +testcase_cyl_bessel_i<double> data004[] = { + { 0.0000000000000000, 0.66666666666666663, 0.0000000000000000 }, + { 25.902310583215122, 0.66666666666666663, 5.0000000000000000 }, + { 2750.4090423459315, 0.66666666666666663, 10.000000000000000 }, + { 334476.98138574383, 0.66666666666666663, 15.000000000000000 }, + { 43064361.686912313, 0.66666666666666663, 20.000000000000000 }, + { 5722397441.9603882, 0.66666666666666663, 25.000000000000000 }, + { 775804343498.02661, 0.66666666666666663, 30.000000000000000 }, + { 106649495512800.89, 0.66666666666666663, 35.000000000000000 }, + { 14811199896983756., 0.66666666666666663, 40.000000000000000 }, + { 2.0730345814356961e+18, 0.66666666666666663, 45.000000000000000 }, + { 2.9194166755257467e+20, 0.66666666666666663, 50.000000000000000 }, + { 4.1319059569935366e+22, 0.66666666666666663, 55.000000000000000 }, + { 5.8721031476386222e+24, 0.66666666666666663, 60.000000000000000 }, + { 8.3741368248217830e+26, 0.66666666666666663, 65.000000000000000 }, + { 1.1977528777008688e+29, 0.66666666666666663, 70.000000000000000 }, + { 1.7175081240014333e+31, 0.66666666666666663, 75.000000000000000 }, + { 2.4682690458513916e+33, 0.66666666666666663, 80.000000000000000 }, + { 3.5541181975850724e+35, 0.66666666666666663, 85.000000000000000 }, + { 5.1264933963228864e+37, 0.66666666666666663, 90.000000000000000 }, + { 7.4058894880134064e+39, 0.66666666666666663, 95.000000000000000 }, + { 1.0713562154788124e+42, 0.66666666666666663, 100.00000000000000 }, +}; + +// Test function for nu=0.66666666666666663. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data004[i].nu), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for nu=1.0000000000000000. +testcase_cyl_bessel_i<double> data005[] = { + { 0.0000000000000000, 1.0000000000000000, 0.0000000000000000 }, + { 24.335642142450524, 1.0000000000000000, 5.0000000000000000 }, + { 2670.9883037012560, 1.0000000000000000, 10.000000000000000 }, + { 328124.92197020649, 1.0000000000000000, 15.000000000000000 }, + { 42454973.385127775, 1.0000000000000000, 20.000000000000000 }, + { 5657865129.8787022, 1.0000000000000000, 25.000000000000000 }, + { 768532038938.95667, 1.0000000000000000, 30.000000000000000 }, + { 105794126051896.17, 1.0000000000000000, 35.000000000000000 }, + { 14707396163259354., 1.0000000000000000, 40.000000000000000 }, + { 2.0601334620815775e+18, 1.0000000000000000, 45.000000000000000 }, + { 2.9030785901035635e+20, 1.0000000000000000, 50.000000000000000 }, + { 4.1108986452992812e+22, 1.0000000000000000, 55.000000000000000 }, + { 5.8447515883904527e+24, 1.0000000000000000, 60.000000000000000 }, + { 8.3381485471501302e+26, 1.0000000000000000, 65.000000000000000 }, + { 1.1929750788892366e+29, 1.0000000000000000, 70.000000000000000 }, + { 1.7111160152965384e+31, 1.0000000000000000, 75.000000000000000 }, + { 2.4596595795675343e+33, 1.0000000000000000, 80.000000000000000 }, + { 3.5424536064404024e+35, 1.0000000000000000, 85.000000000000000 }, + { 5.1106068152566129e+37, 1.0000000000000000, 90.000000000000000 }, + { 7.3841518091360157e+39, 1.0000000000000000, 95.000000000000000 }, + { 1.0683693903381569e+42, 1.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=1.0000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data005[i].nu), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for nu=2.0000000000000000. +testcase_cyl_bessel_i<double> data006[] = { + { 0.0000000000000000, 2.0000000000000000, 0.0000000000000000 }, + { 17.505614966624233, 2.0000000000000000, 5.0000000000000000 }, + { 2281.5189677260046, 2.0000000000000000, 10.000000000000000 }, + { 295899.38370188634, 2.0000000000000000, 15.000000000000000 }, + { 39312785.221040756, 2.0000000000000000, 20.000000000000000 }, + { 5321931396.0760136, 2.0000000000000000, 25.000000000000000 }, + { 730436828561.38013, 2.0000000000000000, 30.000000000000000 }, + { 101293439862977.19, 2.0000000000000000, 35.000000000000000 }, + { 14159404985256920., 2.0000000000000000, 40.000000000000000 }, + { 1.9918525879736883e+18, 2.0000000000000000, 45.000000000000000 }, + { 2.8164306402451938e+20, 2.0000000000000000, 50.000000000000000 }, + { 3.9993023372677515e+22, 2.0000000000000000, 55.000000000000000 }, + { 5.6992520026634433e+24, 2.0000000000000000, 60.000000000000000 }, + { 8.1464814287900378e+26, 2.0000000000000000, 65.000000000000000 }, + { 1.1675039556585663e+29, 2.0000000000000000, 70.000000000000000 }, + { 1.6770093176278926e+31, 2.0000000000000000, 75.000000000000000 }, + { 2.4136869148449879e+33, 2.0000000000000000, 80.000000000000000 }, + { 3.4801257808448186e+35, 2.0000000000000000, 85.000000000000000 }, + { 5.0256693051696307e+37, 2.0000000000000000, 90.000000000000000 }, + { 7.2678700343145842e+39, 2.0000000000000000, 95.000000000000000 }, + { 1.0523843193243042e+42, 2.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=2.0000000000000000. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data006[i].nu), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for nu=5.0000000000000000. +testcase_cyl_bessel_i<double> data007[] = { + { 0.0000000000000000, 5.0000000000000000, 0.0000000000000000 }, + { 2.1579745473225476, 5.0000000000000000, 5.0000000000000000 }, + { 777.18828640326012, 5.0000000000000000, 10.000000000000000 }, + { 144572.01120063406, 5.0000000000000000, 15.000000000000000 }, + { 23018392.213413671, 5.0000000000000000, 20.000000000000000 }, + { 3472466208.7419176, 5.0000000000000000, 25.000000000000000 }, + { 512151465476.93494, 5.0000000000000000, 30.000000000000000 }, + { 74756743552251.531, 5.0000000000000000, 35.000000000000000 }, + { 10858318337624276., 5.0000000000000000, 40.000000000000000 }, + { 1.5736087399245906e+18, 5.0000000000000000, 45.000000000000000 }, + { 2.2785483079112829e+20, 5.0000000000000000, 50.000000000000000 }, + { 3.2989391052963687e+22, 5.0000000000000000, 55.000000000000000 }, + { 4.7777652072561742e+24, 5.0000000000000000, 60.000000000000000 }, + { 6.9232165147172671e+26, 5.0000000000000000, 65.000000000000000 }, + { 1.0038643002095153e+29, 5.0000000000000000, 70.000000000000000 }, + { 1.4566328222327068e+31, 5.0000000000000000, 75.000000000000000 }, + { 2.1151488565944838e+33, 5.0000000000000000, 80.000000000000000 }, + { 3.0735883450768236e+35, 5.0000000000000000, 85.000000000000000 }, + { 4.4694790189230327e+37, 5.0000000000000000, 90.000000000000000 }, + { 6.5037505570430971e+39, 5.0000000000000000, 95.000000000000000 }, + { 9.4700938730355882e+41, 5.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=5.0000000000000000. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data007[i].nu), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=10.000000000000000. +testcase_cyl_bessel_i<double> data008[] = { + { 0.0000000000000000, 10.000000000000000, 0.0000000000000000 }, + { 0.0045800444191760525, 10.000000000000000, 5.0000000000000000 }, + { 21.891706163723381, 10.000000000000000, 10.000000000000000 }, + { 12267.475049806462, 10.000000000000000, 15.000000000000000 }, + { 3540200.2090195213, 10.000000000000000, 20.000000000000000 }, + { 771298871.17072666, 10.000000000000000, 25.000000000000000 }, + { 145831809975.96713, 10.000000000000000, 30.000000000000000 }, + { 25449470018534.785, 10.000000000000000, 35.000000000000000 }, + { 4228469210516757.5, 10.000000000000000, 40.000000000000000 }, + { 6.8049404557505152e+17, 10.000000000000000, 45.000000000000000 }, + { 1.0715971594776370e+20, 10.000000000000000, 50.000000000000000 }, + { 1.6618215752886714e+22, 10.000000000000000, 55.000000000000000 }, + { 2.5486246072566784e+24, 10.000000000000000, 60.000000000000000 }, + { 3.8764628702155481e+26, 10.000000000000000, 65.000000000000000 }, + { 5.8592538145409686e+28, 10.000000000000000, 70.000000000000000 }, + { 8.8135370711317444e+30, 10.000000000000000, 75.000000000000000 }, + { 1.3207418268325279e+33, 10.000000000000000, 80.000000000000000 }, + { 1.9732791360862186e+35, 10.000000000000000, 85.000000000000000 }, + { 2.9411893748384672e+37, 10.000000000000000, 90.000000000000000 }, + { 4.3754494922439990e+39, 10.000000000000000, 95.000000000000000 }, + { 6.4989755247201446e+41, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=10.000000000000000. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data008[i].nu), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=20.000000000000000. +testcase_cyl_bessel_i<double> data009[] = { + { 0.0000000000000000, 20.000000000000000, 0.0000000000000000 }, + { 5.0242393579718066e-11, 20.000000000000000, 5.0000000000000000 }, + { 0.00012507997356449481, 20.000000000000000, 10.000000000000000 }, + { 1.6470152535015834, 20.000000000000000, 15.000000000000000 }, + { 3188.7503288536154, 20.000000000000000, 20.000000000000000 }, + { 2449840.5422952301, 20.000000000000000, 25.000000000000000 }, + { 1126985104.4483771, 20.000000000000000, 30.000000000000000 }, + { 379617876611.88586, 20.000000000000000, 35.000000000000000 }, + { 104459633129479.89, 20.000000000000000, 40.000000000000000 }, + { 25039579987216504., 20.000000000000000, 45.000000000000000 }, + { 5.4420084027529964e+18, 20.000000000000000, 50.000000000000000 }, + { 1.1007498584335492e+21, 20.000000000000000, 55.000000000000000 }, + { 2.1091734863057236e+23, 20.000000000000000, 60.000000000000000 }, + { 3.8763618091286899e+25, 20.000000000000000, 65.000000000000000 }, + { 6.8946130527930859e+27, 20.000000000000000, 70.000000000000000 }, + { 1.1946319948836447e+30, 20.000000000000000, 75.000000000000000 }, + { 2.0265314377577580e+32, 20.000000000000000, 80.000000000000000 }, + { 3.3784665214179971e+34, 20.000000000000000, 85.000000000000000 }, + { 5.5516089411796670e+36, 20.000000000000000, 90.000000000000000 }, + { 9.0129310795305151e+38, 20.000000000000000, 95.000000000000000 }, + { 1.4483461256427176e+41, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=20.000000000000000. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data009[i].nu), Tp(data009[i].x)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=50.000000000000000. +testcase_cyl_bessel_i<double> data010[] = { + { 0.0000000000000000, 50.000000000000000, 0.0000000000000000 }, + { 2.9314696468108517e-45, 50.000000000000000, 5.0000000000000000 }, + { 4.7568945607268442e-30, 50.000000000000000, 10.000000000000000 }, + { 5.5468372730667069e-21, 50.000000000000000, 15.000000000000000 }, + { 2.2551205757604056e-14, 50.000000000000000, 20.000000000000000 }, + { 4.5344251866130282e-09, 50.000000000000000, 25.000000000000000 }, + { 0.00014590106916468937, 50.000000000000000, 30.000000000000000 }, + { 1.3965549457254878, 50.000000000000000, 35.000000000000000 }, + { 5726.8656631289878, 50.000000000000000, 40.000000000000000 }, + { 12672593.113027776, 50.000000000000000, 45.000000000000000 }, + { 17650802430.016705, 50.000000000000000, 50.000000000000000 }, + { 17220231607789.926, 50.000000000000000, 55.000000000000000 }, + { 12704607933652172., 50.000000000000000, 60.000000000000000 }, + { 7.4989491942193766e+18, 50.000000000000000, 65.000000000000000 }, + { 3.6944034898904901e+21, 50.000000000000000, 70.000000000000000 }, + { 1.5691634774370194e+24, 50.000000000000000, 75.000000000000000 }, + { 5.8927749458163587e+26, 50.000000000000000, 80.000000000000000 }, + { 1.9958849054749339e+29, 50.000000000000000, 85.000000000000000 }, + { 6.1946050361781518e+31, 50.000000000000000, 90.000000000000000 }, + { 1.7845429728697110e+34, 50.000000000000000, 95.000000000000000 }, + { 4.8219580855940813e+36, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=50.000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data010[i].nu), Tp(data010[i].x)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for nu=100.00000000000000. +testcase_cyl_bessel_i<double> data011[] = { + { 0.0000000000000000, 100.00000000000000, 0.0000000000000000 }, + { 7.0935514885313123e-119, 100.00000000000000, 5.0000000000000000 }, + { 1.0823442017492018e-88, 100.00000000000000, 10.000000000000000 }, + { 5.9887888536468904e-71, 100.00000000000000, 15.000000000000000 }, + { 2.8703193216428771e-58, 100.00000000000000, 20.000000000000000 }, + { 2.4426896913122370e-48, 100.00000000000000, 25.000000000000000 }, + { 3.9476420053334271e-40, 100.00000000000000, 30.000000000000000 }, + { 4.2836596180818801e-33, 100.00000000000000, 35.000000000000000 }, + { 6.6249380222596129e-27, 100.00000000000000, 40.000000000000000 }, + { 2.3702587262788881e-21, 100.00000000000000, 45.000000000000000 }, + { 2.7278879470966907e-16, 100.00000000000000, 50.000000000000000 }, + { 1.2763258878228088e-11, 100.00000000000000, 55.000000000000000 }, + { 2.8832770906491951e-07, 100.00000000000000, 60.000000000000000 }, + { 0.0035805902717061240, 100.00000000000000, 65.000000000000000 }, + { 27.017219102595398, 100.00000000000000, 70.000000000000000 }, + { 134001.44891209516, 100.00000000000000, 75.000000000000000 }, + { 465194832.85061038, 100.00000000000000, 80.000000000000000 }, + { 1189280653119.4819, 100.00000000000000, 85.000000000000000 }, + { 2334119331258731.0, 100.00000000000000, 90.000000000000000 }, + { 3.6399223078502380e+18, 100.00000000000000, 95.000000000000000 }, + { 4.6415349416161989e+21, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for nu=100.00000000000000. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data011[i].nu), Tp(data011[i].x)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile.cc new file mode 100644 index 000000000..15b2fa99d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.8 cyl_bessel_i + +#include <tr1/cmath> + +void +test01() +{ + + float nuf = 1.0F / 3.0F, xf = 0.5F; + double nud = 1.0 / 3.0, xd = 0.5; + long double nul = 1.0L / 3.0L, xl = 0.5L; + + std::tr1::cyl_bessel_i(nuf, xf); + std::tr1::cyl_bessel_if(nuf, xf); + std::tr1::cyl_bessel_i(nud, xd); + std::tr1::cyl_bessel_i(nul, xl); + std::tr1::cyl_bessel_il(nul, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile_2.cc new file mode 100644 index 000000000..8263792ce --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.8 cyl_bessel_i + +#include <tr1/math.h> + +void +test01() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + double nud = 1.0 / 3.0, xd = 0.5; + long double nul = 1.0L / 3.0L, xl = 0.5L; + + cyl_bessel_i(nuf, xf); + cyl_bessel_if(nuf, xf); + cyl_bessel_i(nud, xd); + cyl_bessel_i(nul, xl); + cyl_bessel_il(nul, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_nan.cc new file mode 100644 index 000000000..29e484daa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_nan.cc @@ -0,0 +1,87 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.9 cyl_bessel_j + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float nuf = 0.0F; + double nud = 0.0; + long double nul = 0.0L; + + float a = std::tr1::cyl_bessel_j(nuf, xf); + float b = std::tr1::cyl_bessel_jf(nuf, xf); + double c = std::tr1::cyl_bessel_j(nud, xd); + long double d = std::tr1::cyl_bessel_j(nul, xl); + long double e = std::tr1::cyl_bessel_jl(nul, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float xf = 1.0F; + double xd = 1.0; + long double xl = 1.0L; + + float nuf = std::numeric_limits<float>::quiet_NaN(); + double nud = std::numeric_limits<double>::quiet_NaN(); + long double nul = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::cyl_bessel_j(nuf, xf); + float b = std::tr1::cyl_bessel_jf(nuf, xf); + double c = std::tr1::cyl_bessel_j(nud, xd); + long double d = std::tr1::cyl_bessel_j(nul, xl); + long double e = std::tr1::cyl_bessel_jl(nul, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc new file mode 100644 index 000000000..039cb86e7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc @@ -0,0 +1,628 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// cyl_bessel_j + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for nu=0.0000000000000000. +testcase_cyl_bessel_j<double> data001[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, + { -0.17759677131433835, 0.0000000000000000, 5.0000000000000000 }, + { -0.24593576445134832, 0.0000000000000000, 10.000000000000000 }, + { -0.014224472826780788, 0.0000000000000000, 15.000000000000000 }, + { 0.16702466434058319, 0.0000000000000000, 20.000000000000000 }, + { 0.096266783275958140, 0.0000000000000000, 25.000000000000000 }, + { -0.086367983581040184, 0.0000000000000000, 30.000000000000000 }, + { -0.12684568275631256, 0.0000000000000000, 35.000000000000000 }, + { 0.0073668905842372914, 0.0000000000000000, 40.000000000000000 }, + { 0.11581867067325630, 0.0000000000000000, 45.000000000000000 }, + { 0.055812327669251746, 0.0000000000000000, 50.000000000000000 }, + { -0.074548302648236808, 0.0000000000000000, 55.000000000000000 }, + { -0.091471804089061873, 0.0000000000000000, 60.000000000000000 }, + { 0.018687343227677920, 0.0000000000000000, 65.000000000000000 }, + { 0.094908726483013517, 0.0000000000000000, 70.000000000000000 }, + { 0.034643913805097029, 0.0000000000000000, 75.000000000000000 }, + { -0.069742165512210061, 0.0000000000000000, 80.000000000000000 }, + { -0.070940394796273301, 0.0000000000000000, 85.000000000000000 }, + { 0.026630016699969568, 0.0000000000000000, 90.000000000000000 }, + { 0.081811967783384149, 0.0000000000000000, 95.000000000000000 }, + { 0.019985850304223264, 0.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.0000000000000000. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data001[i].nu), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for nu=0.33333333333333331. +testcase_cyl_bessel_j<double> data002[] = { + { 0.0000000000000000, 0.33333333333333331, 0.0000000000000000 }, + { -0.30642046380026405, 0.33333333333333331, 5.0000000000000000 }, + { -0.18614516704869569, 0.33333333333333331, 10.000000000000000 }, + { 0.089740004221152581, 0.33333333333333331, 15.000000000000000 }, + { 0.17606058001293898, 0.33333333333333331, 20.000000000000000 }, + { 0.020097162141383202, 0.33333333333333331, 25.000000000000000 }, + { -0.13334053387426156, 0.33333333333333331, 30.000000000000000 }, + { -0.087118009397765442, 0.33333333333333331, 35.000000000000000 }, + { 0.069202942818858165, 0.33333333333333331, 40.000000000000000 }, + { 0.11387616964518317, 0.33333333333333331, 45.000000000000000 }, + { -0.00057226680771807741, 0.33333333333333331, 50.000000000000000 }, + { -0.10331600929280821, 0.33333333333333331, 55.000000000000000 }, + { -0.055618147270528023, 0.33333333333333331, 60.000000000000000 }, + { 0.064711954014113920, 0.33333333333333331, 65.000000000000000 }, + { 0.086879926462481619, 0.33333333333333331, 70.000000000000000 }, + { -0.012614484229891070, 0.33333333333333331, 75.000000000000000 }, + { -0.088199784400034537, 0.33333333333333331, 80.000000000000000 }, + { -0.036703611076564557, 0.33333333333333331, 85.000000000000000 }, + { 0.062916286828779533, 0.33333333333333331, 90.000000000000000 }, + { 0.069465244416806071, 0.33333333333333331, 95.000000000000000 }, + { -0.021271244853702295, 0.33333333333333331, 100.00000000000000 }, +}; + +// Test function for nu=0.33333333333333331. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data002[i].nu), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for nu=0.50000000000000000. +testcase_cyl_bessel_j<double> data003[] = { + { 0.0000000000000000, 0.50000000000000000, 0.0000000000000000 }, + { -0.34216798479816180, 0.50000000000000000, 5.0000000000000000 }, + { -0.13726373575505049, 0.50000000000000000, 10.000000000000000 }, + { 0.13396768882243942, 0.50000000000000000, 15.000000000000000 }, + { 0.16288076385502981, 0.50000000000000000, 20.000000000000000 }, + { -0.021120283599650416, 0.50000000000000000, 25.000000000000000 }, + { -0.14392965337039987, 0.50000000000000000, 30.000000000000000 }, + { -0.057747757589458860, 0.50000000000000000, 35.000000000000000 }, + { 0.094000962389533579, 0.50000000000000000, 40.000000000000000 }, + { 0.10120783324271412, 0.50000000000000000, 45.000000000000000 }, + { -0.029605831888924662, 0.50000000000000000, 50.000000000000000 }, + { -0.10756039213265806, 0.50000000000000000, 55.000000000000000 }, + { -0.031397461182520445, 0.50000000000000000, 60.000000000000000 }, + { 0.081827430775628568, 0.50000000000000000, 65.000000000000000 }, + { 0.073802429539054637, 0.50000000000000000, 70.000000000000000 }, + { -0.035727009681702594, 0.50000000000000000, 75.000000000000000 }, + { -0.088661035811765446, 0.50000000000000000, 80.000000000000000 }, + { -0.015238065106312407, 0.50000000000000000, 85.000000000000000 }, + { 0.075189068550269425, 0.50000000000000000, 90.000000000000000 }, + { 0.055932643481494140, 0.50000000000000000, 95.000000000000000 }, + { -0.040402132716252113, 0.50000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.50000000000000000. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data003[i].nu), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for nu=0.66666666666666663. +testcase_cyl_bessel_j<double> data004[] = { + { 0.0000000000000000, 0.66666666666666663, 0.0000000000000000 }, + { -0.35712533549168879, 0.66666666666666663, 5.0000000000000000 }, + { -0.080149603304315822, 0.66666666666666663, 10.000000000000000 }, + { 0.16918875175798076, 0.66666666666666663, 15.000000000000000 }, + { 0.13904826122116526, 0.66666666666666663, 20.000000000000000 }, + { -0.060770629698497579, 0.66666666666666663, 25.000000000000000 }, + { -0.14489851974205059, 0.66666666666666663, 30.000000000000000 }, + { -0.024604880159644467, 0.66666666666666663, 35.000000000000000 }, + { 0.11243936464912015, 0.66666666666666663, 40.000000000000000 }, + { 0.081776275512525379, 0.66666666666666663, 45.000000000000000 }, + { -0.056589908749367770, 0.66666666666666663, 50.000000000000000 }, + { -0.10455814523765933, 0.66666666666666663, 55.000000000000000 }, + { -0.0051030148548608109, 0.66666666666666663, 60.000000000000000 }, + { 0.093398227061639250, 0.66666666666666663, 65.000000000000000 }, + { 0.055763883611864899, 0.66666666666666663, 70.000000000000000 }, + { -0.056395322915757343, 0.66666666666666663, 75.000000000000000 }, + { -0.083131347805783087, 0.66666666666666663, 80.000000000000000 }, + { 0.0072315397874096309, 0.66666666666666663, 85.000000000000000 }, + { 0.082362798520905264, 0.66666666666666663, 90.000000000000000 }, + { 0.038630504403446168, 0.66666666666666663, 95.000000000000000 }, + { -0.056778819380529706, 0.66666666666666663, 100.00000000000000 }, +}; + +// Test function for nu=0.66666666666666663. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data004[i].nu), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for nu=1.0000000000000000. +testcase_cyl_bessel_j<double> data005[] = { + { 0.0000000000000000, 1.0000000000000000, 0.0000000000000000 }, + { -0.32757913759146523, 1.0000000000000000, 5.0000000000000000 }, + { 0.043472746168861369, 1.0000000000000000, 10.000000000000000 }, + { 0.20510403861352278, 1.0000000000000000, 15.000000000000000 }, + { 0.066833124175850092, 1.0000000000000000, 20.000000000000000 }, + { -0.12535024958028987, 1.0000000000000000, 25.000000000000000 }, + { -0.11875106261662292, 1.0000000000000000, 30.000000000000000 }, + { 0.043990942179625556, 1.0000000000000000, 35.000000000000000 }, + { 0.12603831803758497, 1.0000000000000000, 40.000000000000000 }, + { 0.028348854376424548, 1.0000000000000000, 45.000000000000000 }, + { -0.097511828125175157, 1.0000000000000000, 50.000000000000000 }, + { -0.078250038308684655, 1.0000000000000000, 55.000000000000000 }, + { 0.046598383758166398, 1.0000000000000000, 60.000000000000000 }, + { 0.097330172226126929, 1.0000000000000000, 65.000000000000000 }, + { 0.0099877887848384625, 1.0000000000000000, 70.000000000000000 }, + { -0.085139995044829109, 1.0000000000000000, 75.000000000000000 }, + { -0.056057296675712610, 1.0000000000000000, 80.000000000000000 }, + { 0.049151460334891116, 1.0000000000000000, 85.000000000000000 }, + { 0.079925646708868064, 1.0000000000000000, 90.000000000000000 }, + { -0.0023925612997268684, 1.0000000000000000, 95.000000000000000 }, + { -0.077145352014112142, 1.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=1.0000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data005[i].nu), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for nu=2.0000000000000000. +testcase_cyl_bessel_j<double> data006[] = { + { 0.0000000000000000, 2.0000000000000000, 0.0000000000000000 }, + { 0.046565116277751971, 2.0000000000000000, 5.0000000000000000 }, + { 0.25463031368512062, 2.0000000000000000, 10.000000000000000 }, + { 0.041571677975250479, 2.0000000000000000, 15.000000000000000 }, + { -0.16034135192299817, 2.0000000000000000, 20.000000000000000 }, + { -0.10629480324238134, 2.0000000000000000, 25.000000000000000 }, + { 0.078451246073265340, 2.0000000000000000, 30.000000000000000 }, + { 0.12935945088086262, 2.0000000000000000, 35.000000000000000 }, + { -0.0010649746823580893, 2.0000000000000000, 40.000000000000000 }, + { -0.11455872158985966, 2.0000000000000000, 45.000000000000000 }, + { -0.059712800794258801, 2.0000000000000000, 50.000000000000000 }, + { 0.071702846709739212, 2.0000000000000000, 55.000000000000000 }, + { 0.093025083547667448, 2.0000000000000000, 60.000000000000000 }, + { -0.015692568697643280, 2.0000000000000000, 65.000000000000000 }, + { -0.094623361089160987, 2.0000000000000000, 70.000000000000000 }, + { -0.036914313672959186, 2.0000000000000000, 75.000000000000000 }, + { 0.068340733095317227, 2.0000000000000000, 80.000000000000000 }, + { 0.072096899745329499, 2.0000000000000000, 85.000000000000000 }, + { -0.024853891217550262, 2.0000000000000000, 90.000000000000000 }, + { -0.081862337494957346, 2.0000000000000000, 95.000000000000000 }, + { -0.021528757344505392, 2.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=2.0000000000000000. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data006[i].nu), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for nu=5.0000000000000000. +testcase_cyl_bessel_j<double> data007[] = { + { 0.0000000000000000, 5.0000000000000000, 0.0000000000000000 }, + { 0.26114054612017007, 5.0000000000000000, 5.0000000000000000 }, + { -0.23406152818679365, 5.0000000000000000, 10.000000000000000 }, + { 0.13045613456502966, 5.0000000000000000, 15.000000000000000 }, + { 0.15116976798239504, 5.0000000000000000, 20.000000000000000 }, + { -0.066007995398423044, 5.0000000000000000, 25.000000000000000 }, + { -0.14324029551207709, 5.0000000000000000, 30.000000000000000 }, + { -0.0015053072953907080, 5.0000000000000000, 35.000000000000000 }, + { 0.12257346597711774, 5.0000000000000000, 40.000000000000000 }, + { 0.057984499200954144, 5.0000000000000000, 45.000000000000000 }, + { -0.081400247696569658, 5.0000000000000000, 50.000000000000000 }, + { -0.092569895786432710, 5.0000000000000000, 55.000000000000000 }, + { 0.027454744228344184, 5.0000000000000000, 60.000000000000000 }, + { 0.099110527701539039, 5.0000000000000000, 65.000000000000000 }, + { 0.026058129823895274, 5.0000000000000000, 70.000000000000000 }, + { -0.078523977013751398, 5.0000000000000000, 75.000000000000000 }, + { -0.065862349140031654, 5.0000000000000000, 80.000000000000000 }, + { 0.038669072284680923, 5.0000000000000000, 85.000000000000000 }, + { 0.082759319528415129, 5.0000000000000000, 90.000000000000000 }, + { 0.0079423372702472905, 5.0000000000000000, 95.000000000000000 }, + { -0.074195736964513911, 5.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=5.0000000000000000. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data007[i].nu), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for nu=10.000000000000000. +testcase_cyl_bessel_j<double> data008[] = { + { 0.0000000000000000, 10.000000000000000, 0.0000000000000000 }, + { 0.0014678026473104744, 10.000000000000000, 5.0000000000000000 }, + { 0.20748610663335865, 10.000000000000000, 10.000000000000000 }, + { -0.090071811047659045, 10.000000000000000, 15.000000000000000 }, + { 0.18648255802394512, 10.000000000000000, 20.000000000000000 }, + { -0.075179843948523270, 10.000000000000000, 25.000000000000000 }, + { -0.12987689399858882, 10.000000000000000, 30.000000000000000 }, + { 0.063546391343962852, 10.000000000000000, 35.000000000000000 }, + { 0.11938336278226093, 10.000000000000000, 40.000000000000000 }, + { -0.026971402475010734, 10.000000000000000, 45.000000000000000 }, + { -0.11384784914946940, 10.000000000000000, 50.000000000000000 }, + { -0.015773790303746010, 10.000000000000000, 55.000000000000000 }, + { 0.097177143328071106, 10.000000000000000, 60.000000000000000 }, + { 0.054617389951112157, 10.000000000000000, 65.000000000000000 }, + { -0.065870338561951874, 10.000000000000000, 70.000000000000000 }, + { -0.080417867891894437, 10.000000000000000, 75.000000000000000 }, + { 0.024043850978184754, 10.000000000000000, 80.000000000000000 }, + { 0.086824832700067869, 10.000000000000000, 85.000000000000000 }, + { 0.019554748856312278, 10.000000000000000, 90.000000000000000 }, + { -0.072341598669443757, 10.000000000000000, 95.000000000000000 }, + { -0.054732176935472103, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=10.000000000000000. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data008[i].nu), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for nu=20.000000000000000. +testcase_cyl_bessel_j<double> data009[] = { + { 0.0000000000000000, 20.000000000000000, 0.0000000000000000 }, + { 2.7703300521289426e-11, 20.000000000000000, 5.0000000000000000 }, + { 1.1513369247813403e-05, 20.000000000000000, 10.000000000000000 }, + { 0.0073602340792234882, 20.000000000000000, 15.000000000000000 }, + { 0.16474777377532657, 20.000000000000000, 20.000000000000000 }, + { 0.051994049228303287, 20.000000000000000, 25.000000000000000 }, + { 0.0048310199934041105, 20.000000000000000, 30.000000000000000 }, + { -0.10927417397178038, 20.000000000000000, 35.000000000000000 }, + { 0.12779393355084886, 20.000000000000000, 40.000000000000000 }, + { 0.0047633437900312841, 20.000000000000000, 45.000000000000000 }, + { -0.11670435275957974, 20.000000000000000, 50.000000000000000 }, + { 0.025389204574566695, 20.000000000000000, 55.000000000000000 }, + { 0.10266020557876331, 20.000000000000000, 60.000000000000000 }, + { -0.023138582263434168, 20.000000000000000, 65.000000000000000 }, + { -0.096058573489952323, 20.000000000000000, 70.000000000000000 }, + { 0.0068961047221522270, 20.000000000000000, 75.000000000000000 }, + { 0.090565405489918357, 20.000000000000000, 80.000000000000000 }, + { 0.015985497599497155, 20.000000000000000, 85.000000000000000 }, + { -0.080345344044422506, 20.000000000000000, 90.000000000000000 }, + { -0.040253075701614051, 20.000000000000000, 95.000000000000000 }, + { 0.062217458498338679, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=20.000000000000000. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data009[i].nu), Tp(data009[i].x)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for nu=50.000000000000000. +testcase_cyl_bessel_j<double> data010[] = { + { 0.0000000000000000, 50.000000000000000, 0.0000000000000000 }, + { 2.2942476159525415e-45, 50.000000000000000, 5.0000000000000000 }, + { 1.7845136078715964e-30, 50.000000000000000, 10.000000000000000 }, + { 6.1060519495338733e-22, 50.000000000000000, 15.000000000000000 }, + { 4.4510392847006872e-16, 50.000000000000000, 20.000000000000000 }, + { 9.7561594280229727e-12, 50.000000000000000, 25.000000000000000 }, + { 2.0581656631564181e-08, 50.000000000000000, 30.000000000000000 }, + { 7.6069951699272926e-06, 50.000000000000000, 35.000000000000000 }, + { 0.00068185243531768255, 50.000000000000000, 40.000000000000000 }, + { 0.017284343240791228, 50.000000000000000, 45.000000000000000 }, + { 0.12140902189761522, 50.000000000000000, 50.000000000000000 }, + { 0.13594720957176004, 50.000000000000000, 55.000000000000000 }, + { -0.13798273148535209, 50.000000000000000, 60.000000000000000 }, + { 0.12116217746619408, 50.000000000000000, 65.000000000000000 }, + { -0.11394866738787141, 50.000000000000000, 70.000000000000000 }, + { 0.094076799581573417, 50.000000000000000, 75.000000000000000 }, + { -0.039457764590251236, 50.000000000000000, 80.000000000000000 }, + { -0.040412060734136369, 50.000000000000000, 85.000000000000000 }, + { 0.090802099838032252, 50.000000000000000, 90.000000000000000 }, + { -0.055979156267280269, 50.000000000000000, 95.000000000000000 }, + { -0.038698339728525460, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=50.000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data010[i].nu), Tp(data010[i].x)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +// Test data for nu=100.00000000000000. +testcase_cyl_bessel_j<double> data011[] = { + { 0.0000000000000000, 100.00000000000000, 0.0000000000000000 }, + { 6.2677893955418763e-119, 100.00000000000000, 5.0000000000000000 }, + { 6.5973160641553816e-89, 100.00000000000000, 10.000000000000000 }, + { 1.9660095611249536e-71, 100.00000000000000, 15.000000000000000 }, + { 3.9617550943362524e-59, 100.00000000000000, 20.000000000000000 }, + { 1.1064482655301687e-49, 100.00000000000000, 25.000000000000000 }, + { 4.5788015281752354e-42, 100.00000000000000, 30.000000000000000 }, + { 9.9210206714732606e-36, 100.00000000000000, 35.000000000000000 }, + { 2.3866062996027414e-30, 100.00000000000000, 40.000000000000000 }, + { 1.0329791804565538e-25, 100.00000000000000, 45.000000000000000 }, + { 1.1159273690838340e-21, 100.00000000000000, 50.000000000000000 }, + { 3.7899753451900682e-18, 100.00000000000000, 55.000000000000000 }, + { 4.7832744078781205e-15, 100.00000000000000, 60.000000000000000 }, + { 2.5375564579490517e-12, 100.00000000000000, 65.000000000000000 }, + { 6.1982452141641260e-10, 100.00000000000000, 70.000000000000000 }, + { 7.4479005905904457e-08, 100.00000000000000, 75.000000000000000 }, + { 4.6065530648234948e-06, 100.00000000000000, 80.000000000000000 }, + { 0.00015043869999501605, 100.00000000000000, 85.000000000000000 }, + { 0.0026021305819963472, 100.00000000000000, 90.000000000000000 }, + { 0.023150768009428162, 100.00000000000000, 95.000000000000000 }, + { 0.096366673295861571, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for nu=100.00000000000000. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data011[i].nu), Tp(data011[i].x)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile.cc new file mode 100644 index 000000000..f1fe92df5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.9 cyl_bessel_j + +#include <tr1/cmath> + +void +test01() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + double nud = 1.0 / 3.0, xd = 0.5; + long double nul = 1.0L / 3.0L, xl = 0.5L; + + std::tr1::cyl_bessel_j(nuf, xf); + std::tr1::cyl_bessel_jf(nuf, xf); + std::tr1::cyl_bessel_j(nud, xd); + std::tr1::cyl_bessel_j(nul, xl); + std::tr1::cyl_bessel_jl(nul, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile_2.cc new file mode 100644 index 000000000..b5b8d2463 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.9 cyl_bessel_j + +#include <tr1/math.h> + +void +test01() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + double nud = 1.0 / 3.0, xd = 0.5; + long double nul = 1.0L / 3.0L, xl = 0.5L; + + cyl_bessel_j(nuf, xf); + cyl_bessel_jf(nuf, xf); + cyl_bessel_j(nud, xd); + cyl_bessel_j(nul, xl); + cyl_bessel_jl(nul, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_nan.cc new file mode 100644 index 000000000..7426f2510 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_nan.cc @@ -0,0 +1,87 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.10 cyl_bessel_k + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float nuf = 0.0F; + double nud = 0.0; + long double nul = 0.0L; + + float a = std::tr1::cyl_bessel_k(nuf, xf); + float b = std::tr1::cyl_bessel_kf(nuf, xf); + double c = std::tr1::cyl_bessel_k(nud, xd); + long double d = std::tr1::cyl_bessel_k(nul, xl); + long double e = std::tr1::cyl_bessel_kl(nul, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float xf = 1.0F; + double xd = 1.0; + long double xl = 1.0L; + + float nuf = std::numeric_limits<float>::quiet_NaN(); + double nud = std::numeric_limits<double>::quiet_NaN(); + long double nul = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::cyl_bessel_k(nuf, xf); + float b = std::tr1::cyl_bessel_kf(nuf, xf); + double c = std::tr1::cyl_bessel_k(nud, xd); + long double d = std::tr1::cyl_bessel_k(nul, xl); + long double e = std::tr1::cyl_bessel_kl(nul, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_value.cc new file mode 100644 index 000000000..3cd332b2a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_value.cc @@ -0,0 +1,617 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// cyl_bessel_k + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for nu=0.0000000000000000. +testcase_cyl_bessel_k<double> data001[] = { + { 0.0036910983340425947, 0.0000000000000000, 5.0000000000000000 }, + { 1.7780062316167650e-05, 0.0000000000000000, 10.000000000000000 }, + { 9.8195364823964333e-08, 0.0000000000000000, 15.000000000000000 }, + { 5.7412378153365238e-10, 0.0000000000000000, 20.000000000000000 }, + { 3.4641615622131151e-12, 0.0000000000000000, 25.000000000000000 }, + { 2.1324774964630566e-14, 0.0000000000000000, 30.000000000000000 }, + { 1.3310351491429464e-16, 0.0000000000000000, 35.000000000000000 }, + { 8.3928611000995700e-19, 0.0000000000000000, 40.000000000000000 }, + { 5.3334561226187255e-21, 0.0000000000000000, 45.000000000000000 }, + { 3.4101677497894956e-23, 0.0000000000000000, 50.000000000000000 }, + { 2.1913102183534147e-25, 0.0000000000000000, 55.000000000000000 }, + { 1.4138978405591074e-27, 0.0000000000000000, 60.000000000000000 }, + { 9.1544673210030045e-30, 0.0000000000000000, 65.000000000000000 }, + { 5.9446613372925013e-32, 0.0000000000000000, 70.000000000000000 }, + { 3.8701170455869113e-34, 0.0000000000000000, 75.000000000000000 }, + { 2.5251198425054723e-36, 0.0000000000000000, 80.000000000000000 }, + { 1.6507623579783908e-38, 0.0000000000000000, 85.000000000000000 }, + { 1.0810242556984256e-40, 0.0000000000000000, 90.000000000000000 }, + { 7.0901249699001278e-43, 0.0000000000000000, 95.000000000000000 }, + { 4.6566282291759032e-45, 0.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.0000000000000000. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data001[i].nu), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=0.33333333333333331. +testcase_cyl_bessel_k<double> data002[] = { + { 0.0037288750960535887, 0.33333333333333331, 5.0000000000000000 }, + { 1.7874608271055339e-05, 0.33333333333333331, 10.000000000000000 }, + { 9.8548341568798317e-08, 0.33333333333333331, 15.000000000000000 }, + { 5.7568278247790865e-10, 0.33333333333333331, 20.000000000000000 }, + { 3.4717201424907059e-12, 0.33333333333333331, 25.000000000000000 }, + { 2.1363664736611189e-14, 0.33333333333333331, 30.000000000000000 }, + { 1.3331202314165813e-16, 0.33333333333333331, 35.000000000000000 }, + { 8.4043837769480934e-19, 0.33333333333333331, 40.000000000000000 }, + { 5.3399731261024948e-21, 0.33333333333333331, 45.000000000000000 }, + { 3.4139217813583632e-23, 0.33333333333333331, 50.000000000000000 }, + { 2.1935050179185627e-25, 0.33333333333333331, 55.000000000000000 }, + { 1.4151968805623662e-27, 0.33333333333333331, 60.000000000000000 }, + { 9.1622357217019043e-30, 0.33333333333333331, 65.000000000000000 }, + { 5.9493479703461315e-32, 0.33333333333333331, 70.000000000000000 }, + { 3.8729660011055947e-34, 0.33333333333333331, 75.000000000000000 }, + { 2.5268631828013877e-36, 0.33333333333333331, 80.000000000000000 }, + { 1.6518353676138867e-38, 0.33333333333333331, 85.000000000000000 }, + { 1.0816880942511496e-40, 0.33333333333333331, 90.000000000000000 }, + { 7.0942508599231512e-43, 0.33333333333333331, 95.000000000000000 }, + { 4.6592031570213454e-45, 0.33333333333333331, 100.00000000000000 }, +}; + +// Test function for nu=0.33333333333333331. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data002[i].nu), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=0.50000000000000000. +testcase_cyl_bessel_k<double> data003[] = { + { 0.0037766133746428825, 0.50000000000000000, 5.0000000000000000 }, + { 1.7993478093705181e-05, 0.50000000000000000, 10.000000000000000 }, + { 9.8991312032877236e-08, 0.50000000000000000, 15.000000000000000 }, + { 5.7763739747074450e-10, 0.50000000000000000, 20.000000000000000 }, + { 3.4811912768406949e-12, 0.50000000000000000, 25.000000000000000 }, + { 2.1412375659560111e-14, 0.50000000000000000, 30.000000000000000 }, + { 1.3357311366035824e-16, 0.50000000000000000, 35.000000000000000 }, + { 8.4188091949489049e-19, 0.50000000000000000, 40.000000000000000 }, + { 5.3481305002517408e-21, 0.50000000000000000, 45.000000000000000 }, + { 3.4186200954570754e-23, 0.50000000000000000, 50.000000000000000 }, + { 2.1962515908772453e-25, 0.50000000000000000, 55.000000000000000 }, + { 1.4168223500353693e-27, 0.50000000000000000, 60.000000000000000 }, + { 9.1719554473256892e-30, 0.50000000000000000, 65.000000000000000 }, + { 5.9552114337788932e-32, 0.50000000000000000, 70.000000000000000 }, + { 3.8765301321409432e-34, 0.50000000000000000, 75.000000000000000 }, + { 2.5290440439442910e-36, 0.50000000000000000, 80.000000000000000 }, + { 1.6531776067605980e-38, 0.50000000000000000, 85.000000000000000 }, + { 1.0825184636529955e-40, 0.50000000000000000, 90.000000000000000 }, + { 7.0994115873258822e-43, 0.50000000000000000, 95.000000000000000 }, + { 4.6624238126346715e-45, 0.50000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.50000000000000000. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data003[i].nu), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=0.66666666666666663. +testcase_cyl_bessel_k<double> data004[] = { + { 0.0038444246344968226, 0.66666666666666663, 5.0000000000000000 }, + { 1.8161187569530204e-05, 0.66666666666666663, 10.000000000000000 }, + { 9.9614751542305571e-08, 0.66666666666666663, 15.000000000000000 }, + { 5.8038484271925811e-10, 0.66666666666666663, 20.000000000000000 }, + { 3.4944937498488603e-12, 0.66666666666666663, 25.000000000000000 }, + { 2.1480755645577720e-14, 0.66666666666666663, 30.000000000000000 }, + { 1.3393949190152161e-16, 0.66666666666666663, 35.000000000000000 }, + { 8.4390460553642992e-19, 0.66666666666666663, 40.000000000000000 }, + { 5.3595716143622089e-21, 0.66666666666666663, 45.000000000000000 }, + { 3.4252085301433749e-23, 0.66666666666666663, 50.000000000000000 }, + { 2.2001025377982308e-25, 0.66666666666666663, 55.000000000000000 }, + { 1.4191011274172078e-27, 0.66666666666666663, 60.000000000000000 }, + { 9.1855803020269763e-30, 0.66666666666666663, 65.000000000000000 }, + { 5.9634299472578764e-32, 0.66666666666666663, 70.000000000000000 }, + { 3.8815254026478500e-34, 0.66666666666666663, 75.000000000000000 }, + { 2.5321003991943851e-36, 0.66666666666666663, 80.000000000000000 }, + { 1.6550585670593067e-38, 0.66666666666666663, 85.000000000000000 }, + { 1.0836820479428609e-40, 0.66666666666666663, 90.000000000000000 }, + { 7.1066428916285356e-43, 0.66666666666666663, 95.000000000000000 }, + { 4.6669364587280465e-45, 0.66666666666666663, 100.00000000000000 }, +}; + +// Test function for nu=0.66666666666666663. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data004[i].nu), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=1.0000000000000000. +testcase_cyl_bessel_k<double> data005[] = { + { 0.0040446134454521655, 1.0000000000000000, 5.0000000000000000 }, + { 1.8648773453825582e-05, 1.0000000000000000, 10.000000000000000 }, + { 1.0141729369762091e-07, 1.0000000000000000, 15.000000000000000 }, + { 5.8830579695570384e-10, 1.0000000000000000, 20.000000000000000 }, + { 3.5327780731999345e-12, 1.0000000000000000, 25.000000000000000 }, + { 2.1677320018915498e-14, 1.0000000000000000, 30.000000000000000 }, + { 1.3499178340011053e-16, 1.0000000000000000, 35.000000000000000 }, + { 8.4971319548610435e-19, 1.0000000000000000, 40.000000000000000 }, + { 5.3923945937225050e-21, 1.0000000000000000, 45.000000000000000 }, + { 3.4441022267175555e-23, 1.0000000000000000, 50.000000000000000 }, + { 2.2111422716117463e-25, 1.0000000000000000, 55.000000000000000 }, + { 1.4256320265171041e-27, 1.0000000000000000, 60.000000000000000 }, + { 9.2246195278906156e-30, 1.0000000000000000, 65.000000000000000 }, + { 5.9869736739138550e-32, 1.0000000000000000, 70.000000000000000 }, + { 3.8958329467421912e-34, 1.0000000000000000, 75.000000000000000 }, + { 2.5408531275211708e-36, 1.0000000000000000, 80.000000000000000 }, + { 1.6604444948567571e-38, 1.0000000000000000, 85.000000000000000 }, + { 1.0870134457498335e-40, 1.0000000000000000, 90.000000000000000 }, + { 7.1273442329907240e-43, 1.0000000000000000, 95.000000000000000 }, + { 4.6798537356369101e-45, 1.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=1.0000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data005[i].nu), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=2.0000000000000000. +testcase_cyl_bessel_k<double> data006[] = { + { 0.0053089437122234608, 2.0000000000000000, 5.0000000000000000 }, + { 2.1509817006932767e-05, 2.0000000000000000, 10.000000000000000 }, + { 1.1171767065031378e-07, 2.0000000000000000, 15.000000000000000 }, + { 6.3295436122922281e-10, 2.0000000000000000, 20.000000000000000 }, + { 3.7467838080691102e-12, 2.0000000000000000, 25.000000000000000 }, + { 2.2769929632558265e-14, 2.0000000000000000, 30.000000000000000 }, + { 1.4081733110858665e-16, 2.0000000000000000, 35.000000000000000 }, + { 8.8177176978426223e-19, 2.0000000000000000, 40.000000000000000 }, + { 5.5731181045619477e-21, 2.0000000000000000, 45.000000000000000 }, + { 3.5479318388581979e-23, 2.0000000000000000, 50.000000000000000 }, + { 2.2717153918665688e-25, 2.0000000000000000, 55.000000000000000 }, + { 1.4614189081096777e-27, 2.0000000000000000, 60.000000000000000 }, + { 9.4383017680150234e-30, 2.0000000000000000, 65.000000000000000 }, + { 6.1157177279757537e-32, 2.0000000000000000, 70.000000000000000 }, + { 3.9740059241667034e-34, 2.0000000000000000, 75.000000000000000 }, + { 2.5886411706935015e-36, 2.0000000000000000, 80.000000000000000 }, + { 1.6898316402103145e-38, 2.0000000000000000, 85.000000000000000 }, + { 1.1051801100484218e-40, 2.0000000000000000, 90.000000000000000 }, + { 7.2401743221736176e-43, 2.0000000000000000, 95.000000000000000 }, + { 4.7502253038886413e-45, 2.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=2.0000000000000000. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data006[i].nu), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=5.0000000000000000. +testcase_cyl_bessel_k<double> data007[] = { + { 0.032706273712031865, 5.0000000000000000, 5.0000000000000000 }, + { 5.7541849985312275e-05, 5.0000000000000000, 10.000000000000000 }, + { 2.1878261369258224e-07, 5.0000000000000000, 15.000000000000000 }, + { 1.0538660139974233e-09, 5.0000000000000000, 20.000000000000000 }, + { 5.6485921365284157e-12, 5.0000000000000000, 25.000000000000000 }, + { 3.2103335105890266e-14, 5.0000000000000000, 30.000000000000000 }, + { 1.8919208406439644e-16, 5.0000000000000000, 35.000000000000000 }, + { 1.1423814375953188e-18, 5.0000000000000000, 40.000000000000000 }, + { 7.0181216822204116e-21, 5.0000000000000000, 45.000000000000000 }, + { 4.3671822541009859e-23, 5.0000000000000000, 50.000000000000000 }, + { 2.7444967640357869e-25, 5.0000000000000000, 55.000000000000000 }, + { 1.7382232741886986e-27, 5.0000000000000000, 60.000000000000000 }, + { 1.1078474298959669e-29, 5.0000000000000000, 65.000000000000000 }, + { 7.0974537081794416e-32, 5.0000000000000000, 70.000000000000000 }, + { 4.5667269500061064e-34, 5.0000000000000000, 75.000000000000000 }, + { 2.9491764420206150e-36, 5.0000000000000000, 80.000000000000000 }, + { 1.9105685973117463e-38, 5.0000000000000000, 85.000000000000000 }, + { 1.2411034311592645e-40, 5.0000000000000000, 90.000000000000000 }, + { 8.0814211331379146e-43, 5.0000000000000000, 95.000000000000000 }, + { 5.2732561132929509e-45, 5.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=5.0000000000000000. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data007[i].nu), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=10.000000000000000. +testcase_cyl_bessel_k<double> data008[] = { + { 9.7585628291778121, 10.000000000000000, 5.0000000000000000 }, + { 0.0016142553003906700, 10.000000000000000, 10.000000000000000 }, + { 2.2605303776606440e-06, 10.000000000000000, 15.000000000000000 }, + { 6.3162145283215787e-09, 10.000000000000000, 20.000000000000000 }, + { 2.4076769602801230e-11, 10.000000000000000, 25.000000000000000 }, + { 1.0842816942222975e-13, 10.000000000000000, 30.000000000000000 }, + { 5.3976770429777191e-16, 10.000000000000000, 35.000000000000000 }, + { 2.8680293113671932e-18, 10.000000000000000, 40.000000000000000 }, + { 1.5939871900169603e-20, 10.000000000000000, 45.000000000000000 }, + { 9.1509882099879962e-23, 10.000000000000000, 50.000000000000000 }, + { 5.3823846249592858e-25, 10.000000000000000, 55.000000000000000 }, + { 3.2253408700563144e-27, 10.000000000000000, 60.000000000000000 }, + { 1.9613367530075138e-29, 10.000000000000000, 65.000000000000000 }, + { 1.2068471495933484e-31, 10.000000000000000, 70.000000000000000 }, + { 7.4979152649449644e-34, 10.000000000000000, 75.000000000000000 }, + { 4.6957285830490538e-36, 10.000000000000000, 80.000000000000000 }, + { 2.9606323347034084e-38, 10.000000000000000, 85.000000000000000 }, + { 1.8773542561131613e-40, 10.000000000000000, 90.000000000000000 }, + { 1.1962899527846350e-42, 10.000000000000000, 95.000000000000000 }, + { 7.6554279773881018e-45, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=10.000000000000000. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data008[i].nu), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=20.000000000000000. +testcase_cyl_bessel_k<double> data009[] = { + { 482700052.06214869, 20.000000000000000, 5.0000000000000000 }, + { 178.74427820770549, 20.000000000000000, 10.000000000000000 }, + { 0.012141257729731146, 20.000000000000000, 15.000000000000000 }, + { 5.5431116361258155e-06, 20.000000000000000, 20.000000000000000 }, + { 6.3744029330352105e-09, 20.000000000000000, 25.000000000000000 }, + { 1.2304516475442478e-11, 20.000000000000000, 30.000000000000000 }, + { 3.2673136479809012e-14, 20.000000000000000, 35.000000000000000 }, + { 1.0703023799997383e-16, 20.000000000000000, 40.000000000000000 }, + { 4.0549953175660486e-19, 20.000000000000000, 45.000000000000000 }, + { 1.7061483797220352e-21, 20.000000000000000, 50.000000000000000 }, + { 7.7617008115659413e-24, 20.000000000000000, 55.000000000000000 }, + { 3.7482954006874725e-26, 20.000000000000000, 60.000000000000000 }, + { 1.8966880763956578e-28, 20.000000000000000, 65.000000000000000 }, + { 9.9615763479998882e-31, 20.000000000000000, 70.000000000000000 }, + { 5.3921623063091066e-33, 20.000000000000000, 75.000000000000000 }, + { 2.9920407657642272e-35, 20.000000000000000, 80.000000000000000 }, + { 1.6948662723618263e-37, 20.000000000000000, 85.000000000000000 }, + { 9.7689149642963025e-40, 20.000000000000000, 90.000000000000000 }, + { 5.7143603019220823e-42, 20.000000000000000, 95.000000000000000 }, + { 3.3852054148901700e-44, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=20.000000000000000. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data009[i].nu), Tp(data009[i].x)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=50.000000000000000. +testcase_cyl_bessel_k<double> data010[] = { + { 3.3943222434301628e+42, 50.000000000000000, 5.0000000000000000 }, + { 2.0613737753892579e+27, 50.000000000000000, 10.000000000000000 }, + { 1.7267736974519191e+18, 50.000000000000000, 15.000000000000000 }, + { 411711209122.01794, 50.000000000000000, 20.000000000000000 }, + { 1972478.7419813862, 50.000000000000000, 25.000000000000000 }, + { 58.770686258007267, 50.000000000000000, 30.000000000000000 }, + { 0.0058659391182535195, 50.000000000000000, 35.000000000000000 }, + { 1.3634854128794103e-06, 50.000000000000000, 40.000000000000000 }, + { 5.8652396362160840e-10, 50.000000000000000, 45.000000000000000 }, + { 4.0060134766400903e-13, 50.000000000000000, 50.000000000000000 }, + { 3.9062324485711016e-16, 50.000000000000000, 55.000000000000000 }, + { 5.0389298085176520e-19, 50.000000000000000, 60.000000000000000 }, + { 8.1305344250110396e-22, 50.000000000000000, 65.000000000000000 }, + { 1.5732816234949002e-24, 50.000000000000000, 70.000000000000000 }, + { 3.5349854993874397e-27, 50.000000000000000, 75.000000000000000 }, + { 8.9940101003189485e-30, 50.000000000000000, 80.000000000000000 }, + { 2.5403205503080723e-32, 50.000000000000000, 85.000000000000000 }, + { 7.8397596486715711e-35, 50.000000000000000, 90.000000000000000 }, + { 2.6098900651329550e-37, 50.000000000000000, 95.000000000000000 }, + { 9.2745226536133274e-40, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=50.000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data010[i].nu), Tp(data010[i].x)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for nu=100.00000000000000. +testcase_cyl_bessel_k<double> data011[] = { + { 7.0398601930616797e+115, 100.00000000000000, 5.0000000000000000 }, + { 4.5966740842695286e+85, 100.00000000000000, 10.000000000000000 }, + { 8.2565552242653898e+67, 100.00000000000000, 15.000000000000000 }, + { 1.7081356456876038e+55, 100.00000000000000, 20.000000000000000 }, + { 1.9858028128780595e+45, 100.00000000000000, 25.000000000000000 }, + { 1.2131584253026677e+37, 100.00000000000000, 30.000000000000000 }, + { 1.1016916354696684e+30, 100.00000000000000, 35.000000000000000 }, + { 7.0074023297775712e+23, 100.00000000000000, 40.000000000000000 }, + { 1.9236643958470909e+18, 100.00000000000000, 45.000000000000000 }, + { 16394035276269.254, 100.00000000000000, 50.000000000000000 }, + { 343254952.89495456, 100.00000000000000, 55.000000000000000 }, + { 14870.012754946305, 100.00000000000000, 60.000000000000000 }, + { 1.1708099078572209, 100.00000000000000, 65.000000000000000 }, + { 0.00015161193930722305, 100.00000000000000, 70.000000000000000 }, + { 2.9850234381623436e-08, 100.00000000000000, 75.000000000000000 }, + { 8.3928710724649065e-12, 100.00000000000000, 80.000000000000000 }, + { 3.2033435630927728e-15, 100.00000000000000, 85.000000000000000 }, + { 1.5922281431788077e-18, 100.00000000000000, 90.000000000000000 }, + { 9.9589454577674300e-22, 100.00000000000000, 95.000000000000000 }, + { 7.6171296304940858e-25, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for nu=100.00000000000000. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data011[i].nu), Tp(data011[i].x)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile.cc new file mode 100644 index 000000000..3c625eb3d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.10 cyl_bessel_k + +#include <tr1/cmath> + +void +test01() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + double nud = 1.0 / 3.0, xd = 0.5; + long double nul = 1.0L / 3.0L, xl = 0.5L; + + std::tr1::cyl_bessel_k(nuf, xf); + std::tr1::cyl_bessel_kf(nuf, xf); + std::tr1::cyl_bessel_k(nud, xd); + std::tr1::cyl_bessel_k(nul, xl); + std::tr1::cyl_bessel_kl(nul, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile_2.cc new file mode 100644 index 000000000..6a1b590dd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.10 cyl_bessel_k + +#include <tr1/math.h> + +void +test01() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + double nud = 1.0 / 3.0, xd = 0.5; + long double nul = 1.0L / 3.0L, xl = 0.5L; + + cyl_bessel_k(nuf, xf); + cyl_bessel_kf(nuf, xf); + cyl_bessel_k(nud, xd); + cyl_bessel_k(nul, xl); + cyl_bessel_kl(nul, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_nan.cc new file mode 100644 index 000000000..229140723 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_nan.cc @@ -0,0 +1,87 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.11 cyl_neumann + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float nuf = 0.0F; + double nud = 0.0; + long double nul = 0.0L; + + float a = std::tr1::cyl_neumann(nuf, xf); + float b = std::tr1::cyl_neumannf(nuf, xf); + double c = std::tr1::cyl_neumann(nud, xd); + long double d = std::tr1::cyl_neumann(nul, xl); + long double e = std::tr1::cyl_neumannl(nul, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float xf = 1.0F; + double xd = 1.0; + long double xl = 1.0L; + + float nuf = std::numeric_limits<float>::quiet_NaN(); + double nud = std::numeric_limits<double>::quiet_NaN(); + long double nul = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::cyl_neumann(nuf, xf); + float b = std::tr1::cyl_neumannf(nuf, xf); + double c = std::tr1::cyl_neumann(nud, xd); + long double d = std::tr1::cyl_neumann(nul, xl); + long double e = std::tr1::cyl_neumannl(nul, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc new file mode 100644 index 000000000..047b5812d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc @@ -0,0 +1,617 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// cyl_neumann + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for nu=0.0000000000000000. +testcase_cyl_neumann<double> data001[] = { + { -0.30851762524903376, 0.0000000000000000, 5.0000000000000000 }, + { 0.055671167283599395, 0.0000000000000000, 10.000000000000000 }, + { 0.20546429603891825, 0.0000000000000000, 15.000000000000000 }, + { 0.062640596809383955, 0.0000000000000000, 20.000000000000000 }, + { -0.12724943226800620, 0.0000000000000000, 25.000000000000000 }, + { -0.11729573168666411, 0.0000000000000000, 30.000000000000000 }, + { 0.045797987195155640, 0.0000000000000000, 35.000000000000000 }, + { 0.12593641705826095, 0.0000000000000000, 40.000000000000000 }, + { 0.027060469763313322, 0.0000000000000000, 45.000000000000000 }, + { -0.098064995470077104, 0.0000000000000000, 50.000000000000000 }, + { -0.077569178730412622, 0.0000000000000000, 55.000000000000000 }, + { 0.047358952209449412, 0.0000000000000000, 60.000000000000000 }, + { 0.097183557740181933, 0.0000000000000000, 65.000000000000000 }, + { 0.0093096664589410131, 0.0000000000000000, 70.000000000000000 }, + { -0.085369047647775642, 0.0000000000000000, 75.000000000000000 }, + { -0.055620339089769981, 0.0000000000000000, 80.000000000000000 }, + { 0.049567884951494258, 0.0000000000000000, 85.000000000000000 }, + { 0.079776475854877765, 0.0000000000000000, 90.000000000000000 }, + { -0.0028230995861232323, 0.0000000000000000, 95.000000000000000 }, + { -0.077244313365083112, 0.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.0000000000000000. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data001[i].nu), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for nu=0.33333333333333331. +testcase_cyl_neumann<double> data002[] = { + { -0.18192321129343830, 0.33333333333333331, 5.0000000000000000 }, + { 0.17020111788268769, 0.33333333333333331, 10.000000000000000 }, + { 0.18540507541540799, 0.33333333333333331, 15.000000000000000 }, + { -0.028777707635715091, 0.33333333333333331, 20.000000000000000 }, + { -0.15829741864944166, 0.33333333333333331, 25.000000000000000 }, + { -0.058645772316705216, 0.33333333333333331, 30.000000000000000 }, + { 0.10294930308870620, 0.33333333333333331, 35.000000000000000 }, + { 0.10547870367098920, 0.33333333333333331, 40.000000000000000 }, + { -0.034334228816010864, 0.33333333333333331, 45.000000000000000 }, + { -0.11283489933031278, 0.33333333333333331, 50.000000000000000 }, + { -0.030007358986895123, 0.33333333333333331, 55.000000000000000 }, + { 0.086699173295718093, 0.33333333333333331, 60.000000000000000 }, + { 0.074875579668878672, 0.33333333333333331, 65.000000000000000 }, + { -0.039323246374552645, 0.33333333333333331, 70.000000000000000 }, + { -0.091263539574475222, 0.33333333333333331, 75.000000000000000 }, + { -0.013358849535984282, 0.33333333333333331, 80.000000000000000 }, + { 0.078373575537830184, 0.33333333333333331, 85.000000000000000 }, + { 0.055812482883955974, 0.33333333333333331, 90.000000000000000 }, + { -0.043310380106990579, 0.33333333333333331, 95.000000000000000 }, + { -0.076900504962136587, 0.33333333333333331, 100.00000000000000 }, +}; + +// Test function for nu=0.33333333333333331. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data002[i].nu), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for nu=0.50000000000000000. +testcase_cyl_neumann<double> data003[] = { + { -0.10121770918510843, 0.50000000000000000, 5.0000000000000000 }, + { 0.21170886633139813, 0.50000000000000000, 10.000000000000000 }, + { 0.15650551590730860, 0.50000000000000000, 15.000000000000000 }, + { -0.072806904785061841, 0.50000000000000000, 20.000000000000000 }, + { -0.15817308404205055, 0.50000000000000000, 25.000000000000000 }, + { -0.022470290598831121, 0.50000000000000000, 30.000000000000000 }, + { 0.12187835265849536, 0.50000000000000000, 35.000000000000000 }, + { 0.084138655676395432, 0.50000000000000000, 40.000000000000000 }, + { -0.062482641933003132, 0.50000000000000000, 45.000000000000000 }, + { -0.10888475635053953, 0.50000000000000000, 50.000000000000000 }, + { -0.0023805454010948804, 0.50000000000000000, 55.000000000000000 }, + { 0.098104683735037904, 0.50000000000000000, 60.000000000000000 }, + { 0.055663470218594434, 0.50000000000000000, 65.000000000000000 }, + { -0.060396767883824809, 0.50000000000000000, 70.000000000000000 }, + { -0.084922578922046868, 0.50000000000000000, 75.000000000000000 }, + { 0.0098472271924441215, 0.50000000000000000, 80.000000000000000 }, + { 0.085190643574343639, 0.50000000000000000, 85.000000000000000 }, + { 0.037684970437156261, 0.50000000000000000, 90.000000000000000 }, + { -0.059772904856097479, 0.50000000000000000, 95.000000000000000 }, + { -0.068803091468728053, 0.50000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.50000000000000000. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data003[i].nu), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for nu=0.66666666666666663. +testcase_cyl_neumann<double> data004[] = { + { -0.016050662643389616, 0.66666666666666663, 5.0000000000000000 }, + { 0.23937232657540730, 0.66666666666666663, 10.000000000000000 }, + { 0.11762106604241242, 0.66666666666666663, 15.000000000000000 }, + { -0.11182254014899563, 0.66666666666666663, 20.000000000000000 }, + { -0.14756582982938804, 0.66666666666666663, 25.000000000000000 }, + { 0.015078692908077665, 0.66666666666666663, 30.000000000000000 }, + { 0.13260911815705798, 0.66666666666666663, 35.000000000000000 }, + { 0.057217565989652795, 0.66666666666666663, 40.000000000000000 }, + { -0.086373755152382048, 0.66666666666666663, 45.000000000000000 }, + { -0.097624139208051630, 0.66666666666666663, 50.000000000000000 }, + { 0.025354902147023434, 0.66666666666666663, 55.000000000000000 }, + { 0.10288136476351209, 0.66666666666666663, 60.000000000000000 }, + { 0.032728379560128203, 0.66666666666666663, 65.000000000000000 }, + { -0.077363672735747777, 0.66666666666666663, 70.000000000000000 }, + { -0.072855870458293975, 0.66666666666666663, 75.000000000000000 }, + { 0.032358106046953494, 0.66666666666666663, 80.000000000000000 }, + { 0.086240651537394228, 0.66666666666666663, 85.000000000000000 }, + { 0.017029601697285159, 0.66666666666666663, 90.000000000000000 }, + { -0.072173520560584709, 0.66666666666666663, 95.000000000000000 }, + { -0.056057339204073985, 0.66666666666666663, 100.00000000000000 }, +}; + +// Test function for nu=0.66666666666666663. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data004[i].nu), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for nu=1.0000000000000000. +testcase_cyl_neumann<double> data005[] = { + { 0.14786314339122689, 1.0000000000000000, 5.0000000000000000 }, + { 0.24901542420695388, 1.0000000000000000, 10.000000000000000 }, + { 0.021073628036873546, 1.0000000000000000, 15.000000000000000 }, + { -0.16551161436252118, 1.0000000000000000, 20.000000000000000 }, + { -0.098829964783237384, 1.0000000000000000, 25.000000000000000 }, + { 0.084425570661747149, 1.0000000000000000, 30.000000000000000 }, + { 0.12751273354559012, 1.0000000000000000, 35.000000000000000 }, + { -0.0057935058215496330, 1.0000000000000000, 40.000000000000000 }, + { -0.11552517964639945, 1.0000000000000000, 45.000000000000000 }, + { -0.056795668562014713, 1.0000000000000000, 50.000000000000000 }, + { 0.073846265432577940, 1.0000000000000000, 55.000000000000000 }, + { 0.091869609369866906, 1.0000000000000000, 60.000000000000000 }, + { -0.017940374275377303, 1.0000000000000000, 65.000000000000000 }, + { -0.094844652625716244, 1.0000000000000000, 70.000000000000000 }, + { -0.035213785160580456, 1.0000000000000000, 75.000000000000000 }, + { 0.069395913784588051, 1.0000000000000000, 80.000000000000000 }, + { 0.071233187582749782, 1.0000000000000000, 85.000000000000000 }, + { -0.026187238607768282, 1.0000000000000000, 90.000000000000000 }, + { -0.081827958724501229, 1.0000000000000000, 95.000000000000000 }, + { -0.020372312002759942, 1.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=1.0000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data005[i].nu), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for nu=2.0000000000000000. +testcase_cyl_neumann<double> data006[] = { + { 0.36766288260552449, 2.0000000000000000, 5.0000000000000000 }, + { -0.0058680824422086154, 2.0000000000000000, 10.000000000000000 }, + { -0.20265447896733510, 2.0000000000000000, 15.000000000000000 }, + { -0.079191758245636068, 2.0000000000000000, 20.000000000000000 }, + { 0.11934303508534720, 2.0000000000000000, 25.000000000000000 }, + { 0.12292410306411393, 2.0000000000000000, 30.000000000000000 }, + { -0.038511545278264774, 2.0000000000000000, 35.000000000000000 }, + { -0.12622609234933843, 2.0000000000000000, 40.000000000000000 }, + { -0.032194922192042189, 2.0000000000000000, 45.000000000000000 }, + { 0.095793168727596509, 2.0000000000000000, 50.000000000000000 }, + { 0.080254497473415454, 2.0000000000000000, 55.000000000000000 }, + { -0.044296631897120513, 2.0000000000000000, 60.000000000000000 }, + { -0.097735569256347382, 2.0000000000000000, 65.000000000000000 }, + { -0.012019513676818619, 2.0000000000000000, 70.000000000000000 }, + { 0.084430013376826832, 2.0000000000000000, 75.000000000000000 }, + { 0.057355236934384685, 2.0000000000000000, 80.000000000000000 }, + { -0.047891809949547205, 2.0000000000000000, 85.000000000000000 }, + { -0.080358414490605948, 2.0000000000000000, 90.000000000000000 }, + { 0.0011004057182389959, 2.0000000000000000, 95.000000000000000 }, + { 0.076836867125027908, 2.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=2.0000000000000000. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data006[i].nu), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for nu=5.0000000000000000. +testcase_cyl_neumann<double> data007[] = { + { -0.45369482249110188, 5.0000000000000000, 5.0000000000000000 }, + { 0.13540304768936232, 5.0000000000000000, 10.000000000000000 }, + { 0.16717271575940021, 5.0000000000000000, 15.000000000000000 }, + { -0.10003576788953225, 5.0000000000000000, 20.000000000000000 }, + { -0.14705799311372267, 5.0000000000000000, 25.000000000000000 }, + { 0.031627359289264322, 5.0000000000000000, 30.000000000000000 }, + { 0.13554781474770031, 5.0000000000000000, 35.000000000000000 }, + { 0.031869448780850372, 5.0000000000000000, 40.000000000000000 }, + { -0.10426932700176872, 5.0000000000000000, 45.000000000000000 }, + { -0.078548413913081608, 5.0000000000000000, 50.000000000000000 }, + { 0.055257033062858382, 5.0000000000000000, 55.000000000000000 }, + { 0.099464632840450901, 5.0000000000000000, 60.000000000000000 }, + { 0.00023860469499600970, 5.0000000000000000, 65.000000000000000 }, + { -0.091861802216406066, 5.0000000000000000, 70.000000000000000 }, + { -0.048383671296970077, 5.0000000000000000, 75.000000000000000 }, + { 0.060293667104896330, 5.0000000000000000, 80.000000000000000 }, + { 0.077506166682734010, 5.0000000000000000, 85.000000000000000 }, + { -0.015338764062239803, 5.0000000000000000, 90.000000000000000 }, + { -0.081531504045514375, 5.0000000000000000, 95.000000000000000 }, + { -0.029480196281662041, 5.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=5.0000000000000000. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data007[i].nu), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000013e-09)); +} + +// Test data for nu=10.000000000000000. +testcase_cyl_neumann<double> data008[] = { + { -25.129110095610098, 10.000000000000000, 5.0000000000000000 }, + { -0.35981415218340279, 10.000000000000000, 10.000000000000000 }, + { 0.21997141360195582, 10.000000000000000, 15.000000000000000 }, + { -0.043894653515658202, 10.000000000000000, 20.000000000000000 }, + { -0.14871839049980651, 10.000000000000000, 25.000000000000000 }, + { 0.075056702122397012, 10.000000000000000, 30.000000000000000 }, + { 0.12222473135000553, 10.000000000000000, 35.000000000000000 }, + { -0.046723877232677867, 10.000000000000000, 40.000000000000000 }, + { -0.11739339009322178, 10.000000000000000, 45.000000000000000 }, + { 0.0057238971820535740, 10.000000000000000, 50.000000000000000 }, + { 0.10733910125831635, 10.000000000000000, 55.000000000000000 }, + { 0.036290350559545506, 10.000000000000000, 60.000000000000000 }, + { -0.083239127691715639, 10.000000000000000, 65.000000000000000 }, + { -0.069639384138314872, 10.000000000000000, 70.000000000000000 }, + { 0.045798335061325038, 10.000000000000000, 75.000000000000000 }, + { 0.086269195064844428, 10.000000000000000, 80.000000000000000 }, + { -0.0018234674126248629, 10.000000000000000, 85.000000000000000 }, + { -0.082067762371231298, 10.000000000000000, 90.000000000000000 }, + { -0.038798074754578075, 10.000000000000000, 95.000000000000000 }, + { 0.058331574236414815, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=10.000000000000000. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data008[i].nu), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for nu=20.000000000000000. +testcase_cyl_neumann<double> data009[] = { + { -593396529.69143212, 20.000000000000000, 5.0000000000000000 }, + { -1597.4838482696264, 20.000000000000000, 10.000000000000000 }, + { -3.3087330924737630, 20.000000000000000, 15.000000000000000 }, + { -0.28548945860020319, 20.000000000000000, 20.000000000000000 }, + { 0.19804074776289243, 20.000000000000000, 25.000000000000000 }, + { -0.16848153948742675, 20.000000000000000, 30.000000000000000 }, + { 0.10102784152594022, 20.000000000000000, 35.000000000000000 }, + { 0.045161820565805928, 20.000000000000000, 40.000000000000000 }, + { -0.12556489308015448, 20.000000000000000, 45.000000000000000 }, + { 0.016442633948115841, 20.000000000000000, 50.000000000000000 }, + { 0.10853448778255187, 20.000000000000000, 55.000000000000000 }, + { -0.026721408520664677, 20.000000000000000, 60.000000000000000 }, + { -0.098780425256324203, 20.000000000000000, 65.000000000000000 }, + { 0.016201957786018205, 20.000000000000000, 70.000000000000000 }, + { 0.093591198265063735, 20.000000000000000, 75.000000000000000 }, + { 0.0040484400737295740, 20.000000000000000, 80.000000000000000 }, + { -0.086314929459920503, 20.000000000000000, 85.000000000000000 }, + { -0.028274110097231495, 20.000000000000000, 90.000000000000000 }, + { 0.072349520791638755, 20.000000000000000, 95.000000000000000 }, + { 0.051247973076188565, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=20.000000000000000. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data009[i].nu), Tp(data009[i].x)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for nu=50.000000000000000. +testcase_cyl_neumann<double> data010[] = { + { -2.7888370175838943e+42, 50.000000000000000, 5.0000000000000000 }, + { -3.6410665018007421e+27, 50.000000000000000, 10.000000000000000 }, + { -1.0929732912175405e+19, 50.000000000000000, 15.000000000000000 }, + { -15606426801663.732, 50.000000000000000, 20.000000000000000 }, + { -753573251.44662631, 50.000000000000000, 25.000000000000000 }, + { -386759.32602734747, 50.000000000000000, 30.000000000000000 }, + { -1172.8690492895341, 50.000000000000000, 35.000000000000000 }, + { -15.615608873419953, 50.000000000000000, 40.000000000000000 }, + { -0.87058346204176951, 50.000000000000000, 45.000000000000000 }, + { -0.21031655464397736, 50.000000000000000, 50.000000000000000 }, + { 0.093048240412999375, 50.000000000000000, 55.000000000000000 }, + { 0.0086417699626745066, 50.000000000000000, 60.000000000000000 }, + { -0.025019788459221974, 50.000000000000000, 65.000000000000000 }, + { -0.0014815155191908913, 50.000000000000000, 70.000000000000000 }, + { 0.050335774732164155, 50.000000000000000, 75.000000000000000 }, + { -0.092924250967987204, 50.000000000000000, 80.000000000000000 }, + { 0.087332463030205670, 50.000000000000000, 85.000000000000000 }, + { -0.016164237701651891, 50.000000000000000, 90.000000000000000 }, + { -0.068897613820457920, 50.000000000000000, 95.000000000000000 }, + { 0.076505263944802962, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=50.000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data010[i].nu), Tp(data010[i].x)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for nu=100.00000000000000. +testcase_cyl_neumann<double> data011[] = { + { -5.0848639160196196e+115, 100.00000000000000, 5.0000000000000000 }, + { -4.8491482711800245e+85, 100.00000000000000, 10.000000000000000 }, + { -1.6375955323195320e+68, 100.00000000000000, 15.000000000000000 }, + { -8.2002648144679137e+55, 100.00000000000000, 20.000000000000000 }, + { -2.9712216432562373e+46, 100.00000000000000, 25.000000000000000 }, + { -7.2875284708240766e+38, 100.00000000000000, 30.000000000000000 }, + { -3.4251079902108953e+32, 100.00000000000000, 35.000000000000000 }, + { -1.4552439438101799e+27, 100.00000000000000, 40.000000000000000 }, + { -3.4506612476220073e+22, 100.00000000000000, 45.000000000000000 }, + { -3.2938001882025948e+18, 100.00000000000000, 50.000000000000000 }, + { -1005686182055527.4, 100.00000000000000, 55.000000000000000 }, + { -831892881402.11377, 100.00000000000000, 60.000000000000000 }, + { -1650863778.0598330, 100.00000000000000, 65.000000000000000 }, + { -7192614.1976097804, 100.00000000000000, 70.000000000000000 }, + { -64639.072261231602, 100.00000000000000, 75.000000000000000 }, + { -1152.5905185698464, 100.00000000000000, 80.000000000000000 }, + { -40.250761402102000, 100.00000000000000, 85.000000000000000 }, + { -2.8307771387185459, 100.00000000000000, 90.000000000000000 }, + { -0.45762200495904559, 100.00000000000000, 95.000000000000000 }, + { -0.16692141141757649, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for nu=100.00000000000000. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data011[i].nu), Tp(data011[i].x)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile.cc new file mode 100644 index 000000000..bd606fbaf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.11 cyl_neumann + +#include <tr1/cmath> + +void +test01() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + double nud = 1.0 / 3.0, xd = 0.5; + long double nul = 1.0L / 3.0L, xl = 0.5L; + + std::tr1::cyl_neumann(nuf, xf); + std::tr1::cyl_neumannf(nuf, xf); + std::tr1::cyl_neumann(nud, xd); + std::tr1::cyl_neumann(nul, xl); + std::tr1::cyl_neumannl(nul, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile_2.cc new file mode 100644 index 000000000..651afa1c8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.11 cyl_neumann + +#include <tr1/math.h> + +void +test01() +{ + float nuf = 1.0F / 3.0F, xf = 0.5F; + double nud = 1.0 / 3.0, xd = 0.5; + long double nul = 1.0L / 3.0L, xl = 0.5L; + + cyl_neumann(nuf, xf); + cyl_neumannf(nuf, xf); + cyl_neumann(nud, xd); + cyl_neumann(nul, xl); + cyl_neumannl(nul, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_nan.cc new file mode 100644 index 000000000..1cb2377d7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_nan.cc @@ -0,0 +1,87 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.12 ellint_1 + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float kf = std::numeric_limits<float>::quiet_NaN(); + double kd = std::numeric_limits<double>::quiet_NaN(); + long double kl = std::numeric_limits<long double>::quiet_NaN(); + + float phif = std::atan2(1.0F, 1.0F); + double phid = std::atan2(1.0, 1.0); + long double phil = std::atan2(1.0L, 1.0L); + + float a = std::tr1::ellint_1(kf, phif); + float b = std::tr1::ellint_1f(kf, phif); + double c = std::tr1::ellint_1(kd, phid); + long double d = std::tr1::ellint_1(kl, phil); + long double e = std::tr1::ellint_1l(kl, phil); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float kf = 0.5F; + double kd = 0.5; + long double kl = 0.5L; + + float phif = std::numeric_limits<float>::quiet_NaN(); + double phid = std::numeric_limits<double>::quiet_NaN(); + long double phil = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::ellint_1(kf, phif); + float b = std::tr1::ellint_1f(kf, phif); + double c = std::tr1::ellint_1(kd, phid); + long double d = std::tr1::ellint_1(kl, phil); + long double e = std::tr1::ellint_1l(kl, phil); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_value.cc new file mode 100644 index 000000000..c363d778f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_value.cc @@ -0,0 +1,843 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// ellint_1 + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for k=-0.90000000000000002. +testcase_ellint_1<double> data001[] = { + { -0.0000000000000000, -0.90000000000000002, 0.0000000000000000 }, + { 0.17525427376115027, -0.90000000000000002, 0.17453292519943295 }, + { 0.35492464591297446, -0.90000000000000002, 0.34906585039886590 }, + { 0.54388221416157134, -0.90000000000000002, 0.52359877559829882 }, + { 0.74797400423532523, -0.90000000000000002, 0.69813170079773179 }, + { 0.97463898451966458, -0.90000000000000002, 0.87266462599716477 }, + { 1.2334463254523440, -0.90000000000000002, 1.0471975511965976 }, + { 1.5355247765594910, -0.90000000000000002, 1.2217304763960306 }, + { 1.8882928567775124, -0.90000000000000002, 1.3962634015954636 }, + { 2.2805491384227703, -0.90000000000000002, 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data001[i].k), Tp(data001[i].phi)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004. +testcase_ellint_1<double> data002[] = { + { -0.0000000000000000, -0.80000000000000004, 0.0000000000000000 }, + { 0.17510154241338902, -0.80000000000000004, 0.17453292519943295 }, + { 0.35365068839779390, -0.80000000000000004, 0.34906585039886590 }, + { 0.53926804409084561, -0.80000000000000004, 0.52359877559829882 }, + { 0.73587926028070383, -0.80000000000000004, 0.69813170079773179 }, + { 0.94770942970071170, -0.80000000000000004, 0.87266462599716477 }, + { 1.1789022995388239, -0.80000000000000004, 1.0471975511965976 }, + { 1.4323027881876009, -0.80000000000000004, 1.2217304763960306 }, + { 1.7069629739121674, -0.80000000000000004, 1.3962634015954636 }, + { 1.9953027776647296, -0.80000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data002[i].k), Tp(data002[i].phi)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996. +testcase_ellint_1<double> data003[] = { + { -0.0000000000000000, -0.69999999999999996, 0.0000000000000000 }, + { 0.17496737466916720, -0.69999999999999996, 0.17453292519943295 }, + { 0.35254687535677925, -0.69999999999999996, 0.34906585039886590 }, + { 0.53536740275997130, -0.69999999999999996, 0.52359877559829882 }, + { 0.72603797651684465, -0.69999999999999996, 0.69813170079773179 }, + { 0.92698296348313458, -0.69999999999999996, 0.87266462599716477 }, + { 1.1400447527693316, -0.69999999999999996, 1.0471975511965976 }, + { 1.3657668117194071, -0.69999999999999996, 1.2217304763960306 }, + { 1.6024686895959159, -0.69999999999999996, 1.3962634015954636 }, + { 1.8456939983747236, -0.69999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data003[i].k), Tp(data003[i].phi)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998. +testcase_ellint_1<double> data004[] = { + { -0.0000000000000000, -0.59999999999999998, 0.0000000000000000 }, + { 0.17485154362988362, -0.59999999999999998, 0.17453292519943295 }, + { 0.35160509865544326, -0.59999999999999998, 0.34906585039886590 }, + { 0.53210652578446160, -0.59999999999999998, 0.52359877559829882 }, + { 0.71805304664485670, -0.59999999999999998, 0.69813170079773179 }, + { 0.91082759030195970, -0.59999999999999998, 0.87266462599716477 }, + { 1.1112333229323361, -0.59999999999999998, 1.0471975511965976 }, + { 1.3191461190365270, -0.59999999999999998, 1.2217304763960306 }, + { 1.5332022105084773, -0.59999999999999998, 1.3962634015954636 }, + { 1.7507538029157526, -0.59999999999999998, 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data004[i].k), Tp(data004[i].phi)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000. +testcase_ellint_1<double> data005[] = { + { -0.0000000000000000, -0.50000000000000000, 0.0000000000000000 }, + { 0.17475385514035785, -0.50000000000000000, 0.17453292519943295 }, + { 0.35081868470101585, -0.50000000000000000, 0.34906585039886590 }, + { 0.52942862705190585, -0.50000000000000000, 0.52359877559829882 }, + { 0.71164727562630326, -0.50000000000000000, 0.69813170079773179 }, + { 0.89824523594227768, -0.50000000000000000, 0.87266462599716477 }, + { 1.0895506700518851, -0.50000000000000000, 1.0471975511965976 }, + { 1.2853005857432933, -0.50000000000000000, 1.2217304763960306 }, + { 1.4845545520549484, -0.50000000000000000, 1.3962634015954636 }, + { 1.6857503548125963, -0.50000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data005[i].k), Tp(data005[i].phi)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002. +testcase_ellint_1<double> data006[] = { + { -0.0000000000000000, -0.40000000000000002, 0.0000000000000000 }, + { 0.17467414669441531, -0.40000000000000002, 0.17453292519943295 }, + { 0.35018222772483443, -0.40000000000000002, 0.34906585039886590 }, + { 0.52729015917508748, -0.40000000000000002, 0.52359877559829882 }, + { 0.70662374407341255, -0.40000000000000002, 0.69813170079773179 }, + { 0.88859210497602170, -0.40000000000000002, 0.87266462599716477 }, + { 1.0733136290471379, -0.40000000000000002, 1.0471975511965976 }, + { 1.2605612170157061, -0.40000000000000002, 1.2217304763960306 }, + { 1.4497513956433437, -0.40000000000000002, 1.3962634015954636 }, + { 1.6399998658645112, -0.40000000000000002, 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data006[i].k), Tp(data006[i].phi)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004. +testcase_ellint_1<double> data007[] = { + { -0.0000000000000000, -0.30000000000000004, 0.0000000000000000 }, + { 0.17461228653000102, -0.30000000000000004, 0.17453292519943295 }, + { 0.34969146102798415, -0.30000000000000004, 0.34906585039886590 }, + { 0.52565822873726320, -0.30000000000000004, 0.52359877559829882 }, + { 0.70284226512408532, -0.30000000000000004, 0.69813170079773179 }, + { 0.88144139195111182, -0.30000000000000004, 0.87266462599716477 }, + { 1.0614897067260523, -0.30000000000000004, 1.0471975511965976 }, + { 1.2428416824174218, -0.30000000000000004, 1.2217304763960306 }, + { 1.4251795877015925, -0.30000000000000004, 1.3962634015954636 }, + { 1.6080486199305126, -0.30000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data007[i].k), Tp(data007[i].phi)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996. +testcase_ellint_1<double> data008[] = { + { -0.0000000000000000, -0.19999999999999996, 0.0000000000000000 }, + { 0.17456817290292811, -0.19999999999999996, 0.17453292519943295 }, + { 0.34934315932086801, -0.19999999999999996, 0.34906585039886590 }, + { 0.52450880529443988, -0.19999999999999996, 0.52359877559829882 }, + { 0.70020491009844910, -0.19999999999999996, 0.69813170079773179 }, + { 0.87651006649967955, -0.19999999999999996, 0.87266462599716477 }, + { 1.0534305870298994, -0.19999999999999996, 1.0471975511965976 }, + { 1.2308975521670784, -0.19999999999999996, 1.2217304763960306 }, + { 1.4087733584990738, -0.19999999999999996, 1.3962634015954636 }, + { 1.5868678474541664, -0.19999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data008[i].k), Tp(data008[i].phi)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978. +testcase_ellint_1<double> data009[] = { + { -0.0000000000000000, -0.099999999999999978, 0.0000000000000000 }, + { 0.17454173353063665, -0.099999999999999978, 0.17453292519943295 }, + { 0.34913506721468085, -0.099999999999999978, 0.34906585039886590 }, + { 0.52382550016538953, -0.099999999999999978, 0.52359877559829882 }, + { 0.69864700854177031, -0.099999999999999978, 0.69813170079773179 }, + { 0.87361792586964870, -0.099999999999999978, 0.87266462599716477 }, + { 1.0487386319621685, -0.099999999999999978, 1.0471975511965976 }, + { 1.2239913752078757, -0.099999999999999978, 1.2217304763960306 }, + { 1.3993423113684049, -0.099999999999999978, 1.3962634015954636 }, + { 1.5747455615173562, -0.099999999999999978, 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data009[i].k), Tp(data009[i].phi)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000. +testcase_ellint_1<double> data010[] = { + { -0.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, + { 0.17453292519943295, 0.0000000000000000, 0.17453292519943295 }, + { 0.34906585039886584, 0.0000000000000000, 0.34906585039886590 }, + { 0.52359877559829882, 0.0000000000000000, 0.52359877559829882 }, + { 0.69813170079773179, 0.0000000000000000, 0.69813170079773179 }, + { 0.87266462599716477, 0.0000000000000000, 0.87266462599716477 }, + { 1.0471975511965976, 0.0000000000000000, 1.0471975511965976 }, + { 1.2217304763960304, 0.0000000000000000, 1.2217304763960306 }, + { 1.3962634015954631, 0.0000000000000000, 1.3962634015954636 }, + { 1.5707963267948966, 0.0000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data010[i].k), Tp(data010[i].phi)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009. +testcase_ellint_1<double> data011[] = { + { -0.0000000000000000, 0.10000000000000009, 0.0000000000000000 }, + { 0.17454173353063665, 0.10000000000000009, 0.17453292519943295 }, + { 0.34913506721468085, 0.10000000000000009, 0.34906585039886590 }, + { 0.52382550016538953, 0.10000000000000009, 0.52359877559829882 }, + { 0.69864700854177031, 0.10000000000000009, 0.69813170079773179 }, + { 0.87361792586964870, 0.10000000000000009, 0.87266462599716477 }, + { 1.0487386319621685, 0.10000000000000009, 1.0471975511965976 }, + { 1.2239913752078757, 0.10000000000000009, 1.2217304763960306 }, + { 1.3993423113684049, 0.10000000000000009, 1.3962634015954636 }, + { 1.5747455615173562, 0.10000000000000009, 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data011[i].k), Tp(data011[i].phi)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996. +testcase_ellint_1<double> data012[] = { + { -0.0000000000000000, 0.19999999999999996, 0.0000000000000000 }, + { 0.17456817290292811, 0.19999999999999996, 0.17453292519943295 }, + { 0.34934315932086801, 0.19999999999999996, 0.34906585039886590 }, + { 0.52450880529443988, 0.19999999999999996, 0.52359877559829882 }, + { 0.70020491009844910, 0.19999999999999996, 0.69813170079773179 }, + { 0.87651006649967955, 0.19999999999999996, 0.87266462599716477 }, + { 1.0534305870298994, 0.19999999999999996, 1.0471975511965976 }, + { 1.2308975521670784, 0.19999999999999996, 1.2217304763960306 }, + { 1.4087733584990738, 0.19999999999999996, 1.3962634015954636 }, + { 1.5868678474541664, 0.19999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data012[i].k), Tp(data012[i].phi)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004. +testcase_ellint_1<double> data013[] = { + { -0.0000000000000000, 0.30000000000000004, 0.0000000000000000 }, + { 0.17461228653000102, 0.30000000000000004, 0.17453292519943295 }, + { 0.34969146102798415, 0.30000000000000004, 0.34906585039886590 }, + { 0.52565822873726320, 0.30000000000000004, 0.52359877559829882 }, + { 0.70284226512408532, 0.30000000000000004, 0.69813170079773179 }, + { 0.88144139195111182, 0.30000000000000004, 0.87266462599716477 }, + { 1.0614897067260523, 0.30000000000000004, 1.0471975511965976 }, + { 1.2428416824174218, 0.30000000000000004, 1.2217304763960306 }, + { 1.4251795877015925, 0.30000000000000004, 1.3962634015954636 }, + { 1.6080486199305126, 0.30000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data013[i].k), Tp(data013[i].phi)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991. +testcase_ellint_1<double> data014[] = { + { -0.0000000000000000, 0.39999999999999991, 0.0000000000000000 }, + { 0.17467414669441531, 0.39999999999999991, 0.17453292519943295 }, + { 0.35018222772483443, 0.39999999999999991, 0.34906585039886590 }, + { 0.52729015917508748, 0.39999999999999991, 0.52359877559829882 }, + { 0.70662374407341255, 0.39999999999999991, 0.69813170079773179 }, + { 0.88859210497602170, 0.39999999999999991, 0.87266462599716477 }, + { 1.0733136290471379, 0.39999999999999991, 1.0471975511965976 }, + { 1.2605612170157061, 0.39999999999999991, 1.2217304763960306 }, + { 1.4497513956433437, 0.39999999999999991, 1.3962634015954636 }, + { 1.6399998658645112, 0.39999999999999991, 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data014[i].k), Tp(data014[i].phi)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000. +testcase_ellint_1<double> data015[] = { + { -0.0000000000000000, 0.50000000000000000, 0.0000000000000000 }, + { 0.17475385514035785, 0.50000000000000000, 0.17453292519943295 }, + { 0.35081868470101585, 0.50000000000000000, 0.34906585039886590 }, + { 0.52942862705190585, 0.50000000000000000, 0.52359877559829882 }, + { 0.71164727562630326, 0.50000000000000000, 0.69813170079773179 }, + { 0.89824523594227768, 0.50000000000000000, 0.87266462599716477 }, + { 1.0895506700518851, 0.50000000000000000, 1.0471975511965976 }, + { 1.2853005857432933, 0.50000000000000000, 1.2217304763960306 }, + { 1.4845545520549484, 0.50000000000000000, 1.3962634015954636 }, + { 1.6857503548125963, 0.50000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data015[i].k), Tp(data015[i].phi)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009. +testcase_ellint_1<double> data016[] = { + { -0.0000000000000000, 0.60000000000000009, 0.0000000000000000 }, + { 0.17485154362988362, 0.60000000000000009, 0.17453292519943295 }, + { 0.35160509865544326, 0.60000000000000009, 0.34906585039886590 }, + { 0.53210652578446160, 0.60000000000000009, 0.52359877559829882 }, + { 0.71805304664485670, 0.60000000000000009, 0.69813170079773179 }, + { 0.91082759030195970, 0.60000000000000009, 0.87266462599716477 }, + { 1.1112333229323366, 0.60000000000000009, 1.0471975511965976 }, + { 1.3191461190365270, 0.60000000000000009, 1.2217304763960306 }, + { 1.5332022105084775, 0.60000000000000009, 1.3962634015954636 }, + { 1.7507538029157526, 0.60000000000000009, 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data016[i].k), Tp(data016[i].phi)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996. +testcase_ellint_1<double> data017[] = { + { -0.0000000000000000, 0.69999999999999996, 0.0000000000000000 }, + { 0.17496737466916720, 0.69999999999999996, 0.17453292519943295 }, + { 0.35254687535677925, 0.69999999999999996, 0.34906585039886590 }, + { 0.53536740275997130, 0.69999999999999996, 0.52359877559829882 }, + { 0.72603797651684465, 0.69999999999999996, 0.69813170079773179 }, + { 0.92698296348313458, 0.69999999999999996, 0.87266462599716477 }, + { 1.1400447527693316, 0.69999999999999996, 1.0471975511965976 }, + { 1.3657668117194071, 0.69999999999999996, 1.2217304763960306 }, + { 1.6024686895959159, 0.69999999999999996, 1.3962634015954636 }, + { 1.8456939983747236, 0.69999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data017[i].k), Tp(data017[i].phi)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004. +testcase_ellint_1<double> data018[] = { + { -0.0000000000000000, 0.80000000000000004, 0.0000000000000000 }, + { 0.17510154241338902, 0.80000000000000004, 0.17453292519943295 }, + { 0.35365068839779390, 0.80000000000000004, 0.34906585039886590 }, + { 0.53926804409084561, 0.80000000000000004, 0.52359877559829882 }, + { 0.73587926028070383, 0.80000000000000004, 0.69813170079773179 }, + { 0.94770942970071170, 0.80000000000000004, 0.87266462599716477 }, + { 1.1789022995388239, 0.80000000000000004, 1.0471975511965976 }, + { 1.4323027881876009, 0.80000000000000004, 1.2217304763960306 }, + { 1.7069629739121674, 0.80000000000000004, 1.3962634015954636 }, + { 1.9953027776647296, 0.80000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data018[i].k), Tp(data018[i].phi)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991. +testcase_ellint_1<double> data019[] = { + { -0.0000000000000000, 0.89999999999999991, 0.0000000000000000 }, + { 0.17525427376115027, 0.89999999999999991, 0.17453292519943295 }, + { 0.35492464591297446, 0.89999999999999991, 0.34906585039886590 }, + { 0.54388221416157123, 0.89999999999999991, 0.52359877559829882 }, + { 0.74797400423532501, 0.89999999999999991, 0.69813170079773179 }, + { 0.97463898451966458, 0.89999999999999991, 0.87266462599716477 }, + { 1.2334463254523438, 0.89999999999999991, 1.0471975511965976 }, + { 1.5355247765594910, 0.89999999999999991, 1.2217304763960306 }, + { 1.8882928567775117, 0.89999999999999991, 1.3962634015954636 }, + { 2.2805491384227699, 0.89999999999999991, 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data019[i].k), Tp(data019[i].phi)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile.cc new file mode 100644 index 000000000..1a6b91611 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.12 ellint_1 + +#include <tr1/cmath> + +void +test01() +{ + float kf = 0.5F, phif = std::atan2(1.0F, 1.0F); + double kd = 0.5, phid = std::atan2(1.0, 1.0); + long double kl = 0.5L, phil = std::atan2(1.0L, 1.0L); + + std::tr1::ellint_1(kf, phif); + std::tr1::ellint_1f(kf, phif); + std::tr1::ellint_1(kd, phid); + std::tr1::ellint_1(kl, phil); + std::tr1::ellint_1l(kl, phil); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile_2.cc new file mode 100644 index 000000000..42395d793 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.12 ellint_1 + +#include <tr1/math.h> + +void +test01() +{ + float kf = 0.5F, phif = std::atan2(1.0F, 1.0F); + double kd = 0.5, phid = std::atan2(1.0, 1.0); + long double kl = 0.5L, phil = std::atan2(1.0L, 1.0L); + + ellint_1(kf, phif); + ellint_1f(kf, phif); + ellint_1(kd, phid); + ellint_1(kl, phil); + ellint_1l(kl, phil); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_nan.cc new file mode 100644 index 000000000..e5e7bbab5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_nan.cc @@ -0,0 +1,87 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.13 ellint_2 + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float kf = std::numeric_limits<float>::quiet_NaN(); + double kd = std::numeric_limits<double>::quiet_NaN(); + long double kl = std::numeric_limits<long double>::quiet_NaN(); + + float phif = std::atan2(1.0F, 1.0F); + double phid = std::atan2(1.0, 1.0); + long double phil = std::atan2(1.0L, 1.0L); + + float a = std::tr1::ellint_2(kf, phif); + float b = std::tr1::ellint_2f(kf, phif); + double c = std::tr1::ellint_2(kd, phid); + long double d = std::tr1::ellint_2(kl, phil); + long double e = std::tr1::ellint_2l(kl, phil); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float kf = 0.5F; + double kd = 0.5; + long double kl = 0.5L; + + float phif = std::numeric_limits<float>::quiet_NaN(); + double phid = std::numeric_limits<double>::quiet_NaN(); + long double phil = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::ellint_2(kf, phif); + float b = std::tr1::ellint_2f(kf, phif); + double c = std::tr1::ellint_2(kd, phid); + long double d = std::tr1::ellint_2(kl, phil); + long double e = std::tr1::ellint_2l(kl, phil); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_value.cc new file mode 100644 index 000000000..baca5ed85 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_value.cc @@ -0,0 +1,843 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// ellint_2 + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for k=-0.90000000000000002. +testcase_ellint_2<double> data001[] = { + { -0.0000000000000000, -0.90000000000000002, 0.0000000000000000 }, + { 0.17381690606167963, -0.90000000000000002, 0.17453292519943295 }, + { 0.34337919186972055, -0.90000000000000002, 0.34906585039886590 }, + { 0.50464268659856337, -0.90000000000000002, 0.52359877559829882 }, + { 0.65400003842368593, -0.90000000000000002, 0.69813170079773179 }, + { 0.78854928419904657, -0.90000000000000002, 0.87266462599716477 }, + { 0.90645698626315407, -0.90000000000000002, 1.0471975511965976 }, + { 1.0075154899135925, -0.90000000000000002, 1.2217304763960306 }, + { 1.0940135583194071, -0.90000000000000002, 1.3962634015954636 }, + { 1.1716970527816140, -0.90000000000000002, 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data001[i].k), Tp(data001[i].phi)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for k=-0.80000000000000004. +testcase_ellint_2<double> data002[] = { + { -0.0000000000000000, -0.80000000000000004, 0.0000000000000000 }, + { 0.17396762274534808, -0.80000000000000004, 0.17453292519943295 }, + { 0.34458685226969316, -0.80000000000000004, 0.34906585039886590 }, + { 0.50872923654502444, -0.80000000000000004, 0.52359877559829882 }, + { 0.66372016539176237, -0.80000000000000004, 0.69813170079773179 }, + { 0.80760344410167406, -0.80000000000000004, 0.87266462599716477 }, + { 0.93945480372495072, -0.80000000000000004, 1.0471975511965976 }, + { 1.0597473310395036, -0.80000000000000004, 1.2217304763960306 }, + { 1.1706981862452361, -0.80000000000000004, 1.3962634015954636 }, + { 1.2763499431699066, -0.80000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data002[i].k), Tp(data002[i].phi)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for k=-0.69999999999999996. +testcase_ellint_2<double> data003[] = { + { -0.0000000000000000, -0.69999999999999996, 0.0000000000000000 }, + { 0.17410041242702540, -0.69999999999999996, 0.17453292519943295 }, + { 0.34564605085764760, -0.69999999999999996, 0.34906585039886590 }, + { 0.51228495693314657, -0.69999999999999996, 0.52359877559829882 }, + { 0.67207654098799530, -0.69999999999999996, 0.69813170079773179 }, + { 0.82370932631556515, -0.69999999999999996, 0.87266462599716477 }, + { 0.96672313309452795, -0.69999999999999996, 1.0471975511965976 }, + { 1.1017090644949503, -0.69999999999999996, 1.2217304763960306 }, + { 1.2304180097292916, -0.69999999999999996, 1.3962634015954636 }, + { 1.3556611355719557, -0.69999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data003[i].k), Tp(data003[i].phi)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for k=-0.59999999999999998. +testcase_ellint_2<double> data004[] = { + { -0.0000000000000000, -0.59999999999999998, 0.0000000000000000 }, + { 0.17421534919599130, -0.59999999999999998, 0.17453292519943295 }, + { 0.34655927787174101, -0.59999999999999998, 0.34906585039886590 }, + { 0.51533034538432165, -0.59999999999999998, 0.52359877559829882 }, + { 0.67916550597453029, -0.59999999999999998, 0.69813170079773179 }, + { 0.83720218180349870, -0.59999999999999998, 0.87266462599716477 }, + { 0.98922159354937755, -0.59999999999999998, 1.0471975511965976 }, + { 1.1357478470419360, -0.59999999999999998, 1.2217304763960306 }, + { 1.2780617372844056, -0.59999999999999998, 1.3962634015954636 }, + { 1.4180833944487243, -0.59999999999999998, 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data004[i].k), Tp(data004[i].phi)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for k=-0.50000000000000000. +testcase_ellint_2<double> data005[] = { + { -0.0000000000000000, -0.50000000000000000, 0.0000000000000000 }, + { 0.17431249677315910, -0.50000000000000000, 0.17453292519943295 }, + { 0.34732862537770803, -0.50000000000000000, 0.34906585039886590 }, + { 0.51788193485993805, -0.50000000000000000, 0.52359877559829882 }, + { 0.68506022954164536, -0.50000000000000000, 0.69813170079773179 }, + { 0.84831662803347196, -0.50000000000000000, 0.87266462599716477 }, + { 1.0075555551444717, -0.50000000000000000, 1.0471975511965976 }, + { 1.1631768599287302, -0.50000000000000000, 1.2217304763960306 }, + { 1.3160584048772543, -0.50000000000000000, 1.3962634015954636 }, + { 1.4674622093394274, -0.50000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data005[i].k), Tp(data005[i].phi)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002. +testcase_ellint_2<double> data006[] = { + { -0.0000000000000000, -0.40000000000000002, 0.0000000000000000 }, + { 0.17439190872481269, -0.40000000000000002, 0.17453292519943295 }, + { 0.34795581767099210, -0.40000000000000002, 0.34906585039886590 }, + { 0.51995290683804474, -0.40000000000000002, 0.52359877559829882 }, + { 0.68981638464431549, -0.40000000000000002, 0.69813170079773179 }, + { 0.85722088859936041, -0.40000000000000002, 0.87266462599716477 }, + { 1.0221301327876993, -0.40000000000000002, 1.0471975511965976 }, + { 1.1848138019818371, -0.40000000000000002, 1.2217304763960306 }, + { 1.3458259266501531, -0.40000000000000002, 1.3962634015954636 }, + { 1.5059416123600402, -0.40000000000000002, 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data006[i].k), Tp(data006[i].phi)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004. +testcase_ellint_2<double> data007[] = { + { -0.0000000000000000, -0.30000000000000004, 0.0000000000000000 }, + { 0.17445362864048916, -0.30000000000000004, 0.17453292519943295 }, + { 0.34844223535713464, -0.30000000000000004, 0.34906585039886590 }, + { 0.52155353877411770, -0.30000000000000004, 0.52359877559829882 }, + { 0.69347584418369879, -0.30000000000000004, 0.69813170079773179 }, + { 0.86403609928237668, -0.30000000000000004, 0.87266462599716477 }, + { 1.0332234514065410, -0.30000000000000004, 1.0471975511965976 }, + { 1.2011943182068923, -0.30000000000000004, 1.2217304763960306 }, + { 1.3682566113689620, -0.30000000000000004, 1.3962634015954636 }, + { 1.5348334649232489, -0.30000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data007[i].k), Tp(data007[i].phi)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996. +testcase_ellint_2<double> data008[] = { + { -0.0000000000000000, -0.19999999999999996, 0.0000000000000000 }, + { 0.17449769027652814, -0.19999999999999996, 0.17453292519943295 }, + { 0.34878893400762095, -0.19999999999999996, 0.34906585039886590 }, + { 0.52269152856057410, -0.19999999999999996, 0.52359877559829882 }, + { 0.69606913360157596, -0.19999999999999996, 0.69813170079773179 }, + { 0.86884782374863356, -0.19999999999999996, 0.87266462599716477 }, + { 1.0410255369689567, -0.19999999999999996, 1.0471975511965976 }, + { 1.2126730391631360, -0.19999999999999996, 1.2217304763960306 }, + { 1.3839259540325153, -0.19999999999999996, 1.3962634015954636 }, + { 1.5549685462425296, -0.19999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data008[i].k), Tp(data008[i].phi)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978. +testcase_ellint_2<double> data009[] = { + { -0.0000000000000000, -0.099999999999999978, 0.0000000000000000 }, + { 0.17452411766649945, -0.099999999999999978, 0.17453292519943295 }, + { 0.34899665805442398, -0.099999999999999978, 0.34906585039886590 }, + { 0.52337222400508787, -0.099999999999999978, 0.52359877559829882 }, + { 0.69761705217284875, -0.099999999999999978, 0.69813170079773179 }, + { 0.87171309273007491, -0.099999999999999978, 0.87266462599716477 }, + { 1.0456602197056328, -0.099999999999999978, 1.0471975511965976 }, + { 1.2194762899272025, -0.099999999999999978, 1.2217304763960306 }, + { 1.3931950229892744, -0.099999999999999978, 1.3962634015954636 }, + { 1.5668619420216685, -0.099999999999999978, 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data009[i].k), Tp(data009[i].phi)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000. +testcase_ellint_2<double> data010[] = { + { -0.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, + { 0.17453292519943295, 0.0000000000000000, 0.17453292519943295 }, + { 0.34906585039886584, 0.0000000000000000, 0.34906585039886590 }, + { 0.52359877559829882, 0.0000000000000000, 0.52359877559829882 }, + { 0.69813170079773179, 0.0000000000000000, 0.69813170079773179 }, + { 0.87266462599716477, 0.0000000000000000, 0.87266462599716477 }, + { 1.0471975511965976, 0.0000000000000000, 1.0471975511965976 }, + { 1.2217304763960304, 0.0000000000000000, 1.2217304763960306 }, + { 1.3962634015954631, 0.0000000000000000, 1.3962634015954636 }, + { 1.5707963267948966, 0.0000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data010[i].k), Tp(data010[i].phi)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009. +testcase_ellint_2<double> data011[] = { + { -0.0000000000000000, 0.10000000000000009, 0.0000000000000000 }, + { 0.17452411766649945, 0.10000000000000009, 0.17453292519943295 }, + { 0.34899665805442398, 0.10000000000000009, 0.34906585039886590 }, + { 0.52337222400508787, 0.10000000000000009, 0.52359877559829882 }, + { 0.69761705217284875, 0.10000000000000009, 0.69813170079773179 }, + { 0.87171309273007491, 0.10000000000000009, 0.87266462599716477 }, + { 1.0456602197056328, 0.10000000000000009, 1.0471975511965976 }, + { 1.2194762899272025, 0.10000000000000009, 1.2217304763960306 }, + { 1.3931950229892744, 0.10000000000000009, 1.3962634015954636 }, + { 1.5668619420216685, 0.10000000000000009, 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data011[i].k), Tp(data011[i].phi)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996. +testcase_ellint_2<double> data012[] = { + { -0.0000000000000000, 0.19999999999999996, 0.0000000000000000 }, + { 0.17449769027652814, 0.19999999999999996, 0.17453292519943295 }, + { 0.34878893400762095, 0.19999999999999996, 0.34906585039886590 }, + { 0.52269152856057410, 0.19999999999999996, 0.52359877559829882 }, + { 0.69606913360157596, 0.19999999999999996, 0.69813170079773179 }, + { 0.86884782374863356, 0.19999999999999996, 0.87266462599716477 }, + { 1.0410255369689567, 0.19999999999999996, 1.0471975511965976 }, + { 1.2126730391631360, 0.19999999999999996, 1.2217304763960306 }, + { 1.3839259540325153, 0.19999999999999996, 1.3962634015954636 }, + { 1.5549685462425296, 0.19999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data012[i].k), Tp(data012[i].phi)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004. +testcase_ellint_2<double> data013[] = { + { -0.0000000000000000, 0.30000000000000004, 0.0000000000000000 }, + { 0.17445362864048916, 0.30000000000000004, 0.17453292519943295 }, + { 0.34844223535713464, 0.30000000000000004, 0.34906585039886590 }, + { 0.52155353877411770, 0.30000000000000004, 0.52359877559829882 }, + { 0.69347584418369879, 0.30000000000000004, 0.69813170079773179 }, + { 0.86403609928237668, 0.30000000000000004, 0.87266462599716477 }, + { 1.0332234514065410, 0.30000000000000004, 1.0471975511965976 }, + { 1.2011943182068923, 0.30000000000000004, 1.2217304763960306 }, + { 1.3682566113689620, 0.30000000000000004, 1.3962634015954636 }, + { 1.5348334649232489, 0.30000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data013[i].k), Tp(data013[i].phi)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991. +testcase_ellint_2<double> data014[] = { + { -0.0000000000000000, 0.39999999999999991, 0.0000000000000000 }, + { 0.17439190872481269, 0.39999999999999991, 0.17453292519943295 }, + { 0.34795581767099210, 0.39999999999999991, 0.34906585039886590 }, + { 0.51995290683804474, 0.39999999999999991, 0.52359877559829882 }, + { 0.68981638464431549, 0.39999999999999991, 0.69813170079773179 }, + { 0.85722088859936041, 0.39999999999999991, 0.87266462599716477 }, + { 1.0221301327876993, 0.39999999999999991, 1.0471975511965976 }, + { 1.1848138019818373, 0.39999999999999991, 1.2217304763960306 }, + { 1.3458259266501531, 0.39999999999999991, 1.3962634015954636 }, + { 1.5059416123600404, 0.39999999999999991, 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data014[i].k), Tp(data014[i].phi)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000. +testcase_ellint_2<double> data015[] = { + { -0.0000000000000000, 0.50000000000000000, 0.0000000000000000 }, + { 0.17431249677315910, 0.50000000000000000, 0.17453292519943295 }, + { 0.34732862537770803, 0.50000000000000000, 0.34906585039886590 }, + { 0.51788193485993805, 0.50000000000000000, 0.52359877559829882 }, + { 0.68506022954164536, 0.50000000000000000, 0.69813170079773179 }, + { 0.84831662803347196, 0.50000000000000000, 0.87266462599716477 }, + { 1.0075555551444717, 0.50000000000000000, 1.0471975511965976 }, + { 1.1631768599287302, 0.50000000000000000, 1.2217304763960306 }, + { 1.3160584048772543, 0.50000000000000000, 1.3962634015954636 }, + { 1.4674622093394274, 0.50000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data015[i].k), Tp(data015[i].phi)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009. +testcase_ellint_2<double> data016[] = { + { -0.0000000000000000, 0.60000000000000009, 0.0000000000000000 }, + { 0.17421534919599130, 0.60000000000000009, 0.17453292519943295 }, + { 0.34655927787174101, 0.60000000000000009, 0.34906585039886590 }, + { 0.51533034538432165, 0.60000000000000009, 0.52359877559829882 }, + { 0.67916550597453029, 0.60000000000000009, 0.69813170079773179 }, + { 0.83720218180349870, 0.60000000000000009, 0.87266462599716477 }, + { 0.98922159354937789, 0.60000000000000009, 1.0471975511965976 }, + { 1.1357478470419360, 0.60000000000000009, 1.2217304763960306 }, + { 1.2780617372844056, 0.60000000000000009, 1.3962634015954636 }, + { 1.4180833944487241, 0.60000000000000009, 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data016[i].k), Tp(data016[i].phi)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for k=0.69999999999999996. +testcase_ellint_2<double> data017[] = { + { -0.0000000000000000, 0.69999999999999996, 0.0000000000000000 }, + { 0.17410041242702540, 0.69999999999999996, 0.17453292519943295 }, + { 0.34564605085764760, 0.69999999999999996, 0.34906585039886590 }, + { 0.51228495693314657, 0.69999999999999996, 0.52359877559829882 }, + { 0.67207654098799530, 0.69999999999999996, 0.69813170079773179 }, + { 0.82370932631556515, 0.69999999999999996, 0.87266462599716477 }, + { 0.96672313309452795, 0.69999999999999996, 1.0471975511965976 }, + { 1.1017090644949503, 0.69999999999999996, 1.2217304763960306 }, + { 1.2304180097292916, 0.69999999999999996, 1.3962634015954636 }, + { 1.3556611355719557, 0.69999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data017[i].k), Tp(data017[i].phi)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for k=0.80000000000000004. +testcase_ellint_2<double> data018[] = { + { -0.0000000000000000, 0.80000000000000004, 0.0000000000000000 }, + { 0.17396762274534808, 0.80000000000000004, 0.17453292519943295 }, + { 0.34458685226969316, 0.80000000000000004, 0.34906585039886590 }, + { 0.50872923654502444, 0.80000000000000004, 0.52359877559829882 }, + { 0.66372016539176237, 0.80000000000000004, 0.69813170079773179 }, + { 0.80760344410167406, 0.80000000000000004, 0.87266462599716477 }, + { 0.93945480372495072, 0.80000000000000004, 1.0471975511965976 }, + { 1.0597473310395036, 0.80000000000000004, 1.2217304763960306 }, + { 1.1706981862452361, 0.80000000000000004, 1.3962634015954636 }, + { 1.2763499431699066, 0.80000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data018[i].k), Tp(data018[i].phi)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for k=0.89999999999999991. +testcase_ellint_2<double> data019[] = { + { -0.0000000000000000, 0.89999999999999991, 0.0000000000000000 }, + { 0.17381690606167963, 0.89999999999999991, 0.17453292519943295 }, + { 0.34337919186972055, 0.89999999999999991, 0.34906585039886590 }, + { 0.50464268659856337, 0.89999999999999991, 0.52359877559829882 }, + { 0.65400003842368581, 0.89999999999999991, 0.69813170079773179 }, + { 0.78854928419904657, 0.89999999999999991, 0.87266462599716477 }, + { 0.90645698626315385, 0.89999999999999991, 1.0471975511965976 }, + { 1.0075154899135930, 0.89999999999999991, 1.2217304763960306 }, + { 1.0940135583194071, 0.89999999999999991, 1.3962634015954636 }, + { 1.1716970527816142, 0.89999999999999991, 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data019[i].k), Tp(data019[i].phi)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile.cc new file mode 100644 index 000000000..59a53b6a1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.13 ellint_2 + +#include <tr1/cmath> + +void +test01() +{ + float kf = 0.5F, phif = std::atan2(1.0F, 1.0F); + double kd = 0.5, phid = std::atan2(1.0, 1.0); + long double kl = 0.5L, phil = std::atan2(1.0L, 1.0L); + + std::tr1::ellint_2(kf, phif); + std::tr1::ellint_2f(kf, phif); + std::tr1::ellint_2(kd, phid); + std::tr1::ellint_2(kl, phil); + std::tr1::ellint_2l(kl, phil); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile_2.cc new file mode 100644 index 000000000..1802cb792 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.13 ellint_2 + +#include <tr1/math.h> + +void +test01() +{ + float kf = 0.5F, phif = std::atan2(1.0F, 1.0F); + double kd = 0.5, phid = std::atan2(1.0, 1.0); + long double kl = 0.5L, phil = std::atan2(1.0L, 1.0L); + + ellint_2(kf, phif); + ellint_2f(kf, phif); + ellint_2(kd, phid); + ellint_2(kl, phil); + ellint_2l(kl, phil); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_nan.cc new file mode 100644 index 000000000..bff17ae90 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_nan.cc @@ -0,0 +1,126 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.13 ellint_3 + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float kf = std::numeric_limits<float>::quiet_NaN(); + double kd = std::numeric_limits<double>::quiet_NaN(); + long double kl = std::numeric_limits<long double>::quiet_NaN(); + + float nuf = 0.2F; + double nud = 0.2; + long double nul = 0.2L; + + float phif = std::atan2(1.0F, 1.0F); + double phid = std::atan2(1.0, 1.0); + long double phil = std::atan2(1.0L, 1.0L); + + float a = std::tr1::ellint_3(kf, nuf, phif); + float b = std::tr1::ellint_3f(kf, nuf, phif); + double c = std::tr1::ellint_3(kd, nud, phid); + long double d = std::tr1::ellint_3(kl, nul, phil); + long double e = std::tr1::ellint_3l(kl, nul, phil); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float kf = 0.5F; + double kd = 0.5; + long double kl = 0.5L; + + float nuf = std::numeric_limits<float>::quiet_NaN(); + double nud = std::numeric_limits<double>::quiet_NaN(); + long double nul = std::numeric_limits<long double>::quiet_NaN(); + + float phif = std::atan2(1.0F, 1.0F); + double phid = std::atan2(1.0, 1.0); + long double phil = std::atan2(1.0L, 1.0L); + + float a = std::tr1::ellint_3(kf, nuf, phif); + float b = std::tr1::ellint_3f(kf, nuf, phif); + double c = std::tr1::ellint_3(kd, nud, phid); + long double d = std::tr1::ellint_3(kl, nul, phil); + long double e = std::tr1::ellint_3l(kl, nul, phil); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test03() +{ + float kf = 0.5F; + double kd = 0.5; + long double kl = 0.5L; + + float nuf = 0.2F; + double nud = 0.2; + long double nul = 0.2L; + + float phif = std::numeric_limits<float>::quiet_NaN(); + double phid = std::numeric_limits<double>::quiet_NaN(); + long double phil = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::ellint_3(kf, nuf, phif); + float b = std::tr1::ellint_3f(kf, nuf, phif); + double c = std::tr1::ellint_3(kd, nud, phid); + long double d = std::tr1::ellint_3(kl, nul, phil); + long double e = std::tr1::ellint_3l(kl, nul, phil); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + test03(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_value.cc new file mode 100644 index 000000000..7db645fb7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_value.cc @@ -0,0 +1,10115 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// ellint_3 + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for k=-0.90000000000000002, nu=0.0000000000000000. +testcase_ellint_3<double> data001[] = { + { -0.0000000000000000, -0.90000000000000002, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17525427376115027, -0.90000000000000002, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35492464591297446, -0.90000000000000002, 0.0000000000000000, + 0.34906585039886590 }, + { 0.54388221416157134, -0.90000000000000002, 0.0000000000000000, + 0.52359877559829882 }, + { 0.74797400423532523, -0.90000000000000002, 0.0000000000000000, + 0.69813170079773179 }, + { 0.97463898451966458, -0.90000000000000002, 0.0000000000000000, + 0.87266462599716477 }, + { 1.2334463254523440, -0.90000000000000002, 0.0000000000000000, + 1.0471975511965976 }, + { 1.5355247765594910, -0.90000000000000002, 0.0000000000000000, + 1.2217304763960306 }, + { 1.8882928567775124, -0.90000000000000002, 0.0000000000000000, + 1.3962634015954636 }, + { 2.2805491384227703, -0.90000000000000002, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.0000000000000000. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data001[i].k), Tp(data001[i].nu), + Tp(data001[i].phi)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.10000000000000001. +testcase_ellint_3<double> data002[] = { + { -0.0000000000000000, -0.90000000000000002, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17507714233254659, -0.90000000000000002, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35350932904326521, -0.90000000000000002, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53911129989870998, -0.90000000000000002, 0.10000000000000001, + 0.52359877559829882 }, + { 0.73666644254508429, -0.90000000000000002, 0.10000000000000001, + 0.69813170079773179 }, + { 0.95250736612100184, -0.90000000000000002, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1950199550905594, -0.90000000000000002, 0.10000000000000001, + 1.0471975511965976 }, + { 1.4741687286340848, -0.90000000000000002, 0.10000000000000001, + 1.2217304763960306 }, + { 1.7968678183506059, -0.90000000000000002, 0.10000000000000001, + 1.3962634015954636 }, + { 2.1537868513875287, -0.90000000000000002, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.10000000000000001. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data002[i].k), Tp(data002[i].nu), + Tp(data002[i].phi)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.20000000000000001. +testcase_ellint_3<double> data003[] = { + { -0.0000000000000000, -0.90000000000000002, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17490065089140930, -0.90000000000000002, 0.20000000000000001, + 0.17453292519943295 }, + { 0.35211377590661436, -0.90000000000000002, 0.20000000000000001, + 0.34906585039886590 }, + { 0.53448220334204122, -0.90000000000000002, 0.20000000000000001, + 0.52359877559829882 }, + { 0.72591368943179613, -0.90000000000000002, 0.20000000000000001, + 0.69813170079773179 }, + { 0.93192539780038763, -0.90000000000000002, 0.20000000000000001, + 0.87266462599716477 }, + { 1.1600809679692683, -0.90000000000000002, 0.20000000000000001, + 1.0471975511965976 }, + { 1.4195407225882508, -0.90000000000000002, 0.20000000000000001, + 1.2217304763960306 }, + { 1.7168966476424528, -0.90000000000000002, 0.20000000000000001, + 1.3962634015954636 }, + { 2.0443194576468890, -0.90000000000000002, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.20000000000000001. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data003[i].k), Tp(data003[i].nu), + Tp(data003[i].phi)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.29999999999999999. +testcase_ellint_3<double> data004[] = { + { -0.0000000000000000, -0.90000000000000002, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17472479532647534, -0.90000000000000002, 0.29999999999999999, + 0.17453292519943295 }, + { 0.35073750187374114, -0.90000000000000002, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52998766129466979, -0.90000000000000002, 0.29999999999999999, + 0.52359877559829882 }, + { 0.71566993548699587, -0.90000000000000002, 0.29999999999999999, + 0.69813170079773179 }, + { 0.91271517762560195, -0.90000000000000002, 0.29999999999999999, + 0.87266462599716477 }, + { 1.1281241199843370, -0.90000000000000002, 0.29999999999999999, + 1.0471975511965976 }, + { 1.3704929576917448, -0.90000000000000002, 0.29999999999999999, + 1.2217304763960306 }, + { 1.6461981511487715, -0.90000000000000002, 0.29999999999999999, + 1.3962634015954636 }, + { 1.9486280260314426, -0.90000000000000002, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.29999999999999999. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data004[i].k), Tp(data004[i].nu), + Tp(data004[i].phi)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.40000000000000002. +testcase_ellint_3<double> data005[] = { + { -0.0000000000000000, -0.90000000000000002, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17454957156468839, -0.90000000000000002, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34938003933330430, -0.90000000000000002, 0.40000000000000002, + 0.34906585039886590 }, + { 0.52562093533067455, -0.90000000000000002, 0.40000000000000002, + 0.52359877559829882 }, + { 0.70589461324915703, -0.90000000000000002, 0.40000000000000002, + 0.69813170079773179 }, + { 0.89472658511942849, -0.90000000000000002, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0987419542323440, -0.90000000000000002, 0.40000000000000002, + 1.0471975511965976 }, + { 1.3261349565496301, -0.90000000000000002, 0.40000000000000002, + 1.2217304763960306 }, + { 1.5831293909853767, -0.90000000000000002, 0.40000000000000002, + 1.3962634015954636 }, + { 1.8641114227238349, -0.90000000000000002, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.40000000000000002. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data005[i].k), Tp(data005[i].nu), + Tp(data005[i].phi)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.50000000000000000. +testcase_ellint_3<double> data006[] = { + { -0.0000000000000000, -0.90000000000000002, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17437497557073336, -0.90000000000000002, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34804093691586013, -0.90000000000000002, 0.50000000000000000, + 0.34906585039886590 }, + { 0.52137576320372914, -0.90000000000000002, 0.50000000000000000, + 0.52359877559829882 }, + { 0.69655163996912284, -0.90000000000000002, 0.50000000000000000, + 0.69813170079773179 }, + { 0.87783188683054236, -0.90000000000000002, 0.50000000000000000, + 0.87266462599716477 }, + { 1.0716015959755185, -0.90000000000000002, 0.50000000000000000, + 1.0471975511965976 }, + { 1.2857636916026747, -0.90000000000000002, 0.50000000000000000, + 1.2217304763960306 }, + { 1.5264263913252365, -0.90000000000000002, 0.50000000000000000, + 1.3962634015954636 }, + { 1.7888013241937861, -0.90000000000000002, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.50000000000000000. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data006[i].k), Tp(data006[i].nu), + Tp(data006[i].phi)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.59999999999999998. +testcase_ellint_3<double> data007[] = { + { -0.0000000000000000, -0.90000000000000002, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17420100334657815, -0.90000000000000002, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34671975876122157, -0.90000000000000002, 0.59999999999999998, + 0.34906585039886590 }, + { 0.51724631570707968, -0.90000000000000002, 0.59999999999999998, + 0.52359877559829882 }, + { 0.68760879113743056, -0.90000000000000002, 0.59999999999999998, + 0.69813170079773179 }, + { 0.86192157779698364, -0.90000000000000002, 0.59999999999999998, + 0.87266462599716477 }, + { 1.0464279696166354, -0.90000000000000002, 0.59999999999999998, + 1.0471975511965976 }, + { 1.2488156247094004, -0.90000000000000002, 0.59999999999999998, + 1.2217304763960306 }, + { 1.4750988777188474, -0.90000000000000002, 0.59999999999999998, + 1.3962634015954636 }, + { 1.7211781128919523, -0.90000000000000002, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.59999999999999998. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data007[i].k), Tp(data007[i].nu), + Tp(data007[i].phi)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.69999999999999996. +testcase_ellint_3<double> data008[] = { + { -0.0000000000000000, -0.90000000000000002, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17402765093102210, -0.90000000000000002, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34541608382635131, -0.90000000000000002, 0.69999999999999996, + 0.34906585039886590 }, + { 0.51322715827061705, -0.90000000000000002, 0.69999999999999996, + 0.52359877559829882 }, + { 0.67903717872440306, -0.90000000000000002, 0.69999999999999996, + 0.69813170079773179 }, + { 0.84690113601682671, -0.90000000000000002, 0.69999999999999996, + 0.87266462599716477 }, + { 1.0229914311548418, -0.90000000000000002, 0.69999999999999996, + 1.0471975511965976 }, + { 1.2148329639709381, -0.90000000000000002, 0.69999999999999996, + 1.2217304763960306 }, + { 1.4283586501307806, -0.90000000000000002, 0.69999999999999996, + 1.3962634015954636 }, + { 1.6600480747670938, -0.90000000000000002, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.69999999999999996. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data008[i].k), Tp(data008[i].nu), + Tp(data008[i].phi)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.80000000000000004. +testcase_ellint_3<double> data009[] = { + { -0.0000000000000000, -0.90000000000000002, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17385491439925149, -0.90000000000000002, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34412950523113928, -0.90000000000000002, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50931321668729612, -0.90000000000000002, 0.80000000000000004, + 0.52359877559829882 }, + { 0.67081081392296349, -0.90000000000000002, 0.80000000000000004, + 0.69813170079773179 }, + { 0.83268846097293259, -0.90000000000000002, 0.80000000000000004, + 0.87266462599716477 }, + { 1.0010985015814027, -0.90000000000000002, 0.80000000000000004, + 1.0471975511965976 }, + { 1.1834394045489678, -0.90000000000000002, 0.80000000000000004, + 1.2217304763960306 }, + { 1.3855695891683188, -0.90000000000000002, 0.80000000000000004, + 1.3962634015954636 }, + { 1.6044591960982204, -0.90000000000000002, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.80000000000000004. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data009[i].k), Tp(data009[i].nu), + Tp(data009[i].phi)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.90000000000000002, nu=0.90000000000000002. +testcase_ellint_3<double> data010[] = { + { -0.0000000000000000, -0.90000000000000002, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17368278986240138, -0.90000000000000002, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34285962963961397, -0.90000000000000002, 0.90000000000000002, + 0.34906585039886590 }, + { 0.50549974644993323, -0.90000000000000002, 0.90000000000000002, + 0.52359877559829882 }, + { 0.66290623857720898, -0.90000000000000002, 0.90000000000000002, + 0.69813170079773179 }, + { 0.81921183128847164, -0.90000000000000002, 0.90000000000000002, + 0.87266462599716477 }, + { 0.98058481956066390, -0.90000000000000002, 0.90000000000000002, + 1.0471975511965976 }, + { 1.1543223520473567, -0.90000000000000002, 0.90000000000000002, + 1.2217304763960306 }, + { 1.3462119782292938, -0.90000000000000002, 0.90000000000000002, + 1.3962634015954636 }, + { 1.5536420236310946, -0.90000000000000002, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.90000000000000002. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data010[i].k), Tp(data010[i].nu), + Tp(data010[i].phi)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.0000000000000000. +testcase_ellint_3<double> data011[] = { + { -0.0000000000000000, -0.80000000000000004, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17510154241338902, -0.80000000000000004, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35365068839779390, -0.80000000000000004, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53926804409084561, -0.80000000000000004, 0.0000000000000000, + 0.52359877559829882 }, + { 0.73587926028070383, -0.80000000000000004, 0.0000000000000000, + 0.69813170079773179 }, + { 0.94770942970071170, -0.80000000000000004, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1789022995388239, -0.80000000000000004, 0.0000000000000000, + 1.0471975511965976 }, + { 1.4323027881876009, -0.80000000000000004, 0.0000000000000000, + 1.2217304763960306 }, + { 1.7069629739121674, -0.80000000000000004, 0.0000000000000000, + 1.3962634015954636 }, + { 1.9953027776647296, -0.80000000000000004, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.0000000000000000. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data011[i].k), Tp(data011[i].nu), + Tp(data011[i].phi)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.10000000000000001. +testcase_ellint_3<double> data012[] = { + { -0.0000000000000000, -0.80000000000000004, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17492468824017166, -0.80000000000000004, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35224443521476911, -0.80000000000000004, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53456851853226961, -0.80000000000000004, 0.10000000000000001, + 0.52359877559829882 }, + { 0.72488875602364944, -0.80000000000000004, 0.10000000000000001, + 0.69813170079773179 }, + { 0.92661354274638952, -0.80000000000000004, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1432651144499077, -0.80000000000000004, 0.10000000000000001, + 1.0471975511965976 }, + { 1.3774479927211429, -0.80000000000000004, 0.10000000000000001, + 1.2217304763960306 }, + { 1.6287092337196041, -0.80000000000000004, 0.10000000000000001, + 1.3962634015954636 }, + { 1.8910755418379521, -0.80000000000000004, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.10000000000000001. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data012[i].k), Tp(data012[i].nu), + Tp(data012[i].phi)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.20000000000000001. +testcase_ellint_3<double> data013[] = { + { -0.0000000000000000, -0.80000000000000004, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17474847286224943, -0.80000000000000004, 0.20000000000000001, + 0.17453292519943295 }, + { 0.35085779529084682, -0.80000000000000004, 0.20000000000000001, + 0.34906585039886590 }, + { 0.53000829263059157, -0.80000000000000004, 0.20000000000000001, + 0.52359877559829882 }, + { 0.71443466027453406, -0.80000000000000004, 0.20000000000000001, + 0.69813170079773179 }, + { 0.90698196872715420, -0.80000000000000004, 0.20000000000000001, + 0.87266462599716477 }, + { 1.1108198200558581, -0.80000000000000004, 0.20000000000000001, + 1.0471975511965976 }, + { 1.3284988909963957, -0.80000000000000004, 0.20000000000000001, + 1.2217304763960306 }, + { 1.5600369318140328, -0.80000000000000004, 0.20000000000000001, + 1.3962634015954636 }, + { 1.8007226661734588, -0.80000000000000004, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.20000000000000001. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data013[i].k), Tp(data013[i].nu), + Tp(data013[i].phi)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.29999999999999999. +testcase_ellint_3<double> data014[] = { + { -0.0000000000000000, -0.80000000000000004, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17457289217669891, -0.80000000000000004, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34949028801501258, -0.80000000000000004, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52558024362769318, -0.80000000000000004, 0.29999999999999999, + 0.52359877559829882 }, + { 0.70447281740094914, -0.80000000000000004, 0.29999999999999999, + 0.69813170079773179 }, + { 0.88864745641528986, -0.80000000000000004, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0811075819341465, -0.80000000000000004, 0.29999999999999999, + 1.0471975511965976 }, + { 1.2844589654082377, -0.80000000000000004, 0.29999999999999999, + 1.2217304763960306 }, + { 1.4991461361277849, -0.80000000000000004, 0.29999999999999999, + 1.3962634015954636 }, + { 1.7214611048717301, -0.80000000000000004, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.29999999999999999. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data014[i].k), Tp(data014[i].nu), + Tp(data014[i].phi)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.40000000000000002. +testcase_ellint_3<double> data015[] = { + { -0.0000000000000000, -0.80000000000000004, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17439794211872178, -0.80000000000000004, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34814144964568972, -0.80000000000000004, 0.40000000000000002, + 0.34906585039886590 }, + { 0.52127776285273075, -0.80000000000000004, 0.40000000000000002, + 0.52359877559829882 }, + { 0.69496411438966599, -0.80000000000000004, 0.40000000000000002, + 0.69813170079773179 }, + { 0.87146878427509589, -0.80000000000000004, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0537579024937762, -0.80000000000000004, 0.40000000000000002, + 1.0471975511965976 }, + { 1.2445534387922637, -0.80000000000000004, 0.40000000000000002, + 1.2217304763960306 }, + { 1.4446769766361993, -0.80000000000000004, 0.40000000000000002, + 1.3962634015954636 }, + { 1.6512267838651289, -0.80000000000000004, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.40000000000000002. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data015[i].k), Tp(data015[i].nu), + Tp(data015[i].phi)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.50000000000000000. +testcase_ellint_3<double> data016[] = { + { -0.0000000000000000, -0.80000000000000004, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17422361866118047, -0.80000000000000004, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34681083254170475, -0.80000000000000004, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51709470815494440, -0.80000000000000004, 0.50000000000000000, + 0.52359877559829882 }, + { 0.68587375344080259, -0.80000000000000004, 0.50000000000000000, + 0.69813170079773179 }, + { 0.85532571852810624, -0.80000000000000004, 0.50000000000000000, + 0.87266462599716477 }, + { 1.0284677391874906, -0.80000000000000004, 0.50000000000000000, + 1.0471975511965976 }, + { 1.2081693942686225, -0.80000000000000004, 0.50000000000000000, + 1.2217304763960306 }, + { 1.3955803006426311, -0.80000000000000004, 0.50000000000000000, + 1.3962634015954636 }, + { 1.5884528947755532, -0.80000000000000004, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.50000000000000000. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data016[i].k), Tp(data016[i].nu), + Tp(data016[i].phi)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.59999999999999998. +testcase_ellint_3<double> data017[] = { + { -0.0000000000000000, -0.80000000000000004, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17404991781414092, -0.80000000000000004, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34549800443625167, -0.80000000000000004, 0.59999999999999998, + 0.34906585039886590 }, + { 0.51302536167001556, -0.80000000000000004, 0.59999999999999998, + 0.52359877559829882 }, + { 0.67717065003912258, -0.80000000000000004, 0.59999999999999998, + 0.69813170079773179 }, + { 0.84011512421134416, -0.80000000000000004, 0.59999999999999998, + 0.87266462599716477 }, + { 1.0049863847088742, -0.80000000000000004, 0.59999999999999998, + 1.0471975511965976 }, + { 1.1748145941898918, -0.80000000000000004, 0.59999999999999998, + 1.2217304763960306 }, + { 1.3510319699755071, -0.80000000000000004, 0.59999999999999998, + 1.3962634015954636 }, + { 1.5319262547427865, -0.80000000000000004, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.59999999999999998. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data017[i].k), Tp(data017[i].nu), + Tp(data017[i].phi)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.69999999999999996. +testcase_ellint_3<double> data018[] = { + { -0.0000000000000000, -0.80000000000000004, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17387683562442202, -0.80000000000000004, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34420254775101611, -0.80000000000000004, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50906439222143685, -0.80000000000000004, 0.69999999999999996, + 0.52359877559829882 }, + { 0.66882693152688433, -0.80000000000000004, 0.69999999999999996, + 0.69813170079773179 }, + { 0.82574792844091316, -0.80000000000000004, 0.69999999999999996, + 0.87266462599716477 }, + { 0.98310431309490953, -0.80000000000000004, 0.69999999999999996, + 1.0471975511965976 }, + { 1.1440884535113258, -0.80000000000000004, 0.69999999999999996, + 1.2217304763960306 }, + { 1.3103743938952537, -0.80000000000000004, 0.69999999999999996, + 1.3962634015954636 }, + { 1.4806912324625332, -0.80000000000000004, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.69999999999999996. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data018[i].k), Tp(data018[i].nu), + Tp(data018[i].phi)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.80000000000000004. +testcase_ellint_3<double> data019[] = { + { -0.0000000000000000, -0.80000000000000004, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17370436817515206, -0.80000000000000004, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34292405894783395, -0.80000000000000004, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50520682176250087, -0.80000000000000004, 0.80000000000000004, + 0.52359877559829882 }, + { 0.66081751679736189, -0.80000000000000004, 0.80000000000000004, + 0.69813170079773179 }, + { 0.81214672249355102, -0.80000000000000004, 0.80000000000000004, + 0.87266462599716477 }, + { 0.96264481387685574, -0.80000000000000004, 0.80000000000000004, + 1.0471975511965976 }, + { 1.1156611352656258, -0.80000000000000004, 0.80000000000000004, + 1.2217304763960306 }, + { 1.2730756225143889, -0.80000000000000004, 0.80000000000000004, + 1.3962634015954636 }, + { 1.4339837018309474, -0.80000000000000004, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.80000000000000004. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data019[i].k), Tp(data019[i].nu), + Tp(data019[i].phi)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.80000000000000004, nu=0.90000000000000002. +testcase_ellint_3<double> data020[] = { + { -0.0000000000000000, -0.80000000000000004, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17353251158533153, -0.80000000000000004, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34166214791545768, -0.80000000000000004, 0.90000000000000002, + 0.34906585039886590 }, + { 0.50144799535130580, -0.80000000000000004, 0.90000000000000002, + 0.52359877559829882 }, + { 0.65311976193814447, -0.80000000000000004, 0.90000000000000002, + 0.69813170079773179 }, + { 0.79924384892320866, -0.80000000000000004, 0.90000000000000002, + 0.87266462599716477 }, + { 0.94345762353365625, -0.80000000000000004, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0892582069219159, -0.80000000000000004, 0.90000000000000002, + 1.2217304763960306 }, + { 1.2387000876610268, -0.80000000000000004, 0.90000000000000002, + 1.3962634015954636 }, + { 1.3911845406776222, -0.80000000000000004, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.90000000000000002. +template <typename Tp> +void test020() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data020) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data020[i].k), Tp(data020[i].nu), + Tp(data020[i].phi)); + const Tp f0 = data020[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.0000000000000000. +testcase_ellint_3<double> data021[] = { + { -0.0000000000000000, -0.69999999999999996, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17496737466916720, -0.69999999999999996, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35254687535677925, -0.69999999999999996, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53536740275997130, -0.69999999999999996, 0.0000000000000000, + 0.52359877559829882 }, + { 0.72603797651684465, -0.69999999999999996, 0.0000000000000000, + 0.69813170079773179 }, + { 0.92698296348313458, -0.69999999999999996, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1400447527693316, -0.69999999999999996, 0.0000000000000000, + 1.0471975511965976 }, + { 1.3657668117194071, -0.69999999999999996, 0.0000000000000000, + 1.2217304763960306 }, + { 1.6024686895959159, -0.69999999999999996, 0.0000000000000000, + 1.3962634015954636 }, + { 1.8456939983747236, -0.69999999999999996, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.0000000000000000. +template <typename Tp> +void test021() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data021) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data021[i].k), Tp(data021[i].nu), + Tp(data021[i].phi)); + const Tp f0 = data021[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.10000000000000001. +testcase_ellint_3<double> data022[] = { + { -0.0000000000000000, -0.69999999999999996, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17479076384884681, -0.69999999999999996, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35114844900396364, -0.69999999999999996, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53072776947527012, -0.69999999999999996, 0.10000000000000001, + 0.52359877559829882 }, + { 0.71530198262386246, -0.69999999999999996, 0.10000000000000001, + 0.69813170079773179 }, + { 0.90666760677828306, -0.69999999999999996, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1063366517438080, -0.69999999999999996, 0.10000000000000001, + 1.0471975511965976 }, + { 1.3149477243092147, -0.69999999999999996, 0.10000000000000001, + 1.2217304763960306 }, + { 1.5314886725038925, -0.69999999999999996, 0.10000000000000001, + 1.3962634015954636 }, + { 1.7528050171757608, -0.69999999999999996, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.10000000000000001. +template <typename Tp> +void test022() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data022) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data022[i].k), Tp(data022[i].nu), + Tp(data022[i].phi)); + const Tp f0 = data022[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.20000000000000001. +testcase_ellint_3<double> data023[] = { + { -0.0000000000000000, -0.69999999999999996, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17461479077791472, -0.69999999999999996, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34976950621407538, -0.69999999999999996, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52622533231350188, -0.69999999999999996, 0.20000000000000001, + 0.52359877559829882 }, + { 0.70508774017895226, -0.69999999999999996, 0.20000000000000001, + 0.69813170079773179 }, + { 0.88775302531730294, -0.69999999999999996, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0756195476149006, -0.69999999999999996, 0.20000000000000001, + 1.0471975511965976 }, + { 1.2695349716654372, -0.69999999999999996, 0.20000000000000001, + 1.2217304763960306 }, + { 1.4690814617070540, -0.69999999999999996, 0.20000000000000001, + 1.3962634015954636 }, + { 1.6721098780092147, -0.69999999999999996, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.20000000000000001. +template <typename Tp> +void test023() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data023) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data023[i].k), Tp(data023[i].nu), + Tp(data023[i].phi)); + const Tp f0 = data023[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.29999999999999999. +testcase_ellint_3<double> data024[] = { + { -0.0000000000000000, -0.69999999999999996, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17443945136076172, -0.69999999999999996, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34840956983535287, -0.69999999999999996, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52185308551329179, -0.69999999999999996, 0.29999999999999999, + 0.52359877559829882 }, + { 0.69535240431168266, -0.69999999999999996, 0.29999999999999999, + 0.69813170079773179 }, + { 0.87007983473964923, -0.69999999999999996, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0474657975577066, -0.69999999999999996, 0.29999999999999999, + 1.0471975511965976 }, + { 1.2286225419931889, -0.69999999999999996, 0.29999999999999999, + 1.2217304763960306 }, + { 1.4136490671013271, -0.69999999999999996, 0.29999999999999999, + 1.3962634015954636 }, + { 1.6011813647733213, -0.69999999999999996, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.29999999999999999. +template <typename Tp> +void test024() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data024) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data024[i].k), Tp(data024[i].nu), + Tp(data024[i].phi)); + const Tp f0 = data024[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.40000000000000002. +testcase_ellint_3<double> data025[] = { + { -0.0000000000000000, -0.69999999999999996, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17426474153983226, -0.69999999999999996, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34706817945773732, -0.69999999999999996, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51760452851738159, -0.69999999999999996, 0.40000000000000002, + 0.52359877559829882 }, + { 0.68605801534722766, -0.69999999999999996, 0.40000000000000002, + 0.69813170079773179 }, + { 0.85351339387296532, -0.69999999999999996, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0215297967969537, -0.69999999999999996, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1915051074460528, -0.69999999999999996, 0.40000000000000002, + 1.2217304763960306 }, + { 1.3639821911744707, -0.69999999999999996, 0.40000000000000002, + 1.3962634015954636 }, + { 1.5382162002954762, -0.69999999999999996, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.40000000000000002. +template <typename Tp> +void test025() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data025) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data025[i].k), Tp(data025[i].nu), + Tp(data025[i].phi)); + const Tp f0 = data025[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.50000000000000000. +testcase_ellint_3<double> data026[] = { + { -0.0000000000000000, -0.69999999999999996, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17409065729516093, -0.69999999999999996, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34574489064986091, -0.69999999999999996, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51347361925579793, -0.69999999999999996, 0.50000000000000000, + 0.52359877559829882 }, + { 0.67717079489579290, -0.69999999999999996, 0.50000000000000000, + 0.69813170079773179 }, + { 0.83793902055292280, -0.69999999999999996, 0.50000000000000000, + 0.87266462599716477 }, + { 0.99752863545289705, -0.69999999999999996, 0.50000000000000000, + 1.0471975511965976 }, + { 1.1576240080401499, -0.69999999999999996, 0.50000000000000000, + 1.2217304763960306 }, + { 1.3191464023923762, -0.69999999999999996, 0.50000000000000000, + 1.3962634015954636 }, + { 1.4818433192178544, -0.69999999999999996, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.50000000000000000. +template <typename Tp> +void test026() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data026) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data026[i].k), Tp(data026[i].nu), + Tp(data026[i].phi)); + const Tp f0 = data026[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.59999999999999998. +testcase_ellint_3<double> data027[] = { + { -0.0000000000000000, -0.69999999999999996, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17391719464391611, -0.69999999999999996, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34443927423869031, -0.69999999999999996, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50945473266486074, -0.69999999999999996, 0.59999999999999998, + 0.52359877559829882 }, + { 0.66866056326513823, -0.69999999999999996, 0.59999999999999998, + 0.69813170079773179 }, + { 0.82325830002337352, -0.69999999999999996, 0.59999999999999998, + 0.87266462599716477 }, + { 0.97522808245669357, -0.69999999999999996, 0.59999999999999998, + 1.0471975511965976 }, + { 1.1265300613705282, -0.69999999999999996, 0.59999999999999998, + 1.2217304763960306 }, + { 1.2784066076152003, -0.69999999999999996, 0.59999999999999998, + 1.3962634015954636 }, + { 1.4309994736080540, -0.69999999999999996, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.59999999999999998. +template <typename Tp> +void test027() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data027) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data027[i].k), Tp(data027[i].nu), + Tp(data027[i].phi)); + const Tp f0 = data027[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.69999999999999996. +testcase_ellint_3<double> data028[] = { + { -0.0000000000000000, -0.69999999999999996, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17374434963995028, -0.69999999999999996, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34315091562900674, -0.69999999999999996, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50554262375653358, -0.69999999999999996, 0.69999999999999996, + 0.52359877559829882 }, + { 0.66050025406305812, -0.69999999999999996, 0.69999999999999996, + 0.69813170079773179 }, + { 0.80938620118847404, -0.69999999999999996, 0.69999999999999996, + 0.87266462599716477 }, + { 0.95443223855852144, -0.69999999999999996, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0978573207128302, -0.69999999999999996, 0.69999999999999996, + 1.2217304763960306 }, + { 1.2411754575007123, -0.69999999999999996, 0.69999999999999996, + 1.3962634015954636 }, + { 1.3848459188329196, -0.69999999999999996, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.69999999999999996. +template <typename Tp> +void test028() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data028) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data028[i].k), Tp(data028[i].nu), + Tp(data028[i].phi)); + const Tp f0 = data028[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.80000000000000004. +testcase_ellint_3<double> data029[] = { + { -0.0000000000000000, -0.69999999999999996, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17357211837335737, -0.69999999999999996, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34187941416012108, -0.69999999999999996, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50173239465478270, -0.69999999999999996, 0.80000000000000004, + 0.52359877559829882 }, + { 0.65266550725988315, -0.69999999999999996, 0.80000000000000004, + 0.69813170079773179 }, + { 0.79624879865249298, -0.69999999999999996, 0.80000000000000004, + 0.87266462599716477 }, + { 0.93497577043296920, -0.69999999999999996, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0713041566930748, -0.69999999999999996, 0.80000000000000004, + 1.2217304763960306 }, + { 1.2069772023255652, -0.69999999999999996, 0.80000000000000004, + 1.3962634015954636 }, + { 1.3427110650397533, -0.69999999999999996, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.80000000000000004. +template <typename Tp> +void test029() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data029) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data029[i].k), Tp(data029[i].nu), + Tp(data029[i].phi)); + const Tp f0 = data029[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.69999999999999996, nu=0.90000000000000002. +testcase_ellint_3<double> data030[] = { + { -0.0000000000000000, -0.69999999999999996, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17340049697003634, -0.69999999999999996, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34062438249741556, -0.69999999999999996, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49801946510076878, -0.69999999999999996, 0.90000000000000002, + 0.52359877559829882 }, + { 0.64513432604750487, -0.69999999999999996, 0.90000000000000002, + 0.69813170079773179 }, + { 0.78378145487573758, -0.69999999999999996, 0.90000000000000002, + 0.87266462599716477 }, + { 0.91671799500854634, -0.69999999999999996, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0466193579463123, -0.69999999999999996, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1754218079199146, -0.69999999999999996, 0.90000000000000002, + 1.3962634015954636 }, + { 1.3040500499695911, -0.69999999999999996, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.90000000000000002. +template <typename Tp> +void test030() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data030) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data030[i].k), Tp(data030[i].nu), + Tp(data030[i].phi)); + const Tp f0 = data030[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.0000000000000000. +testcase_ellint_3<double> data031[] = { + { -0.0000000000000000, -0.59999999999999998, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17485154362988362, -0.59999999999999998, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35160509865544326, -0.59999999999999998, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53210652578446160, -0.59999999999999998, 0.0000000000000000, + 0.52359877559829882 }, + { 0.71805304664485670, -0.59999999999999998, 0.0000000000000000, + 0.69813170079773179 }, + { 0.91082759030195970, -0.59999999999999998, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1112333229323361, -0.59999999999999998, 0.0000000000000000, + 1.0471975511965976 }, + { 1.3191461190365270, -0.59999999999999998, 0.0000000000000000, + 1.2217304763960306 }, + { 1.5332022105084773, -0.59999999999999998, 0.0000000000000000, + 1.3962634015954636 }, + { 1.7507538029157526, -0.59999999999999998, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.0000000000000000. +template <typename Tp> +void test031() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data031) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data031[i].k), Tp(data031[i].nu), + Tp(data031[i].phi)); + const Tp f0 = data031[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.10000000000000001. +testcase_ellint_3<double> data032[] = { + { -0.0000000000000000, -0.59999999999999998, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17467514275022014, -0.59999999999999998, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35021333086258255, -0.59999999999999998, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52751664092962713, -0.59999999999999998, 0.10000000000000001, + 0.52359877559829882 }, + { 0.70752126971957885, -0.59999999999999998, 0.10000000000000001, + 0.69813170079773179 }, + { 0.89111058756112871, -0.59999999999999998, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0789241202877768, -0.59999999999999998, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2710800210399946, -0.59999999999999998, 0.10000000000000001, + 1.2217304763960306 }, + { 1.4669060574440276, -0.59999999999999998, 0.10000000000000001, + 1.3962634015954636 }, + { 1.6648615773343014, -0.59999999999999998, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.10000000000000001. +template <typename Tp> +void test032() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data032) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data032[i].k), Tp(data032[i].nu), + Tp(data032[i].phi)); + const Tp f0 = data032[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.20000000000000001. +testcase_ellint_3<double> data033[] = { + { -0.0000000000000000, -0.59999999999999998, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17449937871800653, -0.59999999999999998, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34884093647346553, -0.59999999999999998, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52306221119844110, -0.59999999999999998, 0.20000000000000001, + 0.52359877559829882 }, + { 0.69749955678982223, -0.59999999999999998, 0.20000000000000001, + 0.69813170079773179 }, + { 0.87274610682416853, -0.59999999999999998, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0494620540750792, -0.59999999999999998, 0.20000000000000001, + 1.0471975511965976 }, + { 1.2280847305507339, -0.59999999999999998, 0.20000000000000001, + 1.2217304763960306 }, + { 1.4085436279696886, -0.59999999999999998, 0.20000000000000001, + 1.3962634015954636 }, + { 1.5901418016279374, -0.59999999999999998, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.20000000000000001. +template <typename Tp> +void test033() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data033) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data033[i].k), Tp(data033[i].nu), + Tp(data033[i].phi)); + const Tp f0 = data033[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.29999999999999999. +testcase_ellint_3<double> data034[] = { + { -0.0000000000000000, -0.59999999999999998, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17432424744393935, -0.59999999999999998, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34748744127146447, -0.59999999999999998, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51873632743924847, -0.59999999999999998, 0.29999999999999999, + 0.52359877559829882 }, + { 0.68794610396313127, -0.59999999999999998, 0.29999999999999999, + 0.69813170079773179 }, + { 0.85558070175468726, -0.59999999999999998, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0224416343605653, -0.59999999999999998, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1893144457936788, -0.59999999999999998, 0.29999999999999999, + 1.2217304763960306 }, + { 1.3566435377982575, -0.59999999999999998, 0.29999999999999999, + 1.3962634015954636 }, + { 1.5243814243493585, -0.59999999999999998, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.29999999999999999. +template <typename Tp> +void test034() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data034) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data034[i].k), Tp(data034[i].nu), + Tp(data034[i].phi)); + const Tp f0 = data034[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.40000000000000002. +testcase_ellint_3<double> data035[] = { + { -0.0000000000000000, -0.59999999999999998, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17414974487670720, -0.59999999999999998, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34615238767335027, -0.59999999999999998, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51453257838108579, -0.59999999999999998, 0.40000000000000002, + 0.52359877559829882 }, + { 0.67882386787534410, -0.59999999999999998, 0.40000000000000002, + 0.69813170079773179 }, + { 0.83948470233173578, -0.59999999999999998, 0.40000000000000002, + 0.87266462599716477 }, + { 0.99753496200073977, -0.59999999999999998, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1541101404388487, -0.59999999999999998, 0.40000000000000002, + 1.2217304763960306 }, + { 1.3100911323398814, -0.59999999999999998, 0.40000000000000002, + 1.3962634015954636 }, + { 1.4659345278069984, -0.59999999999999998, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.40000000000000002. +template <typename Tp> +void test035() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data035) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data035[i].k), Tp(data035[i].nu), + Tp(data035[i].phi)); + const Tp f0 = data035[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.50000000000000000. +testcase_ellint_3<double> data036[] = { + { -0.0000000000000000, -0.59999999999999998, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17397586700252810, -0.59999999999999998, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34483533397138516, -0.59999999999999998, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51044500461706499, -0.59999999999999998, 0.50000000000000000, + 0.52359877559829882 }, + { 0.67009988034712675, -0.59999999999999998, 0.50000000000000000, + 0.69813170079773179 }, + { 0.82434762375735193, -0.59999999999999998, 0.50000000000000000, + 0.87266462599716477 }, + { 0.97447346702798998, -0.59999999999999998, 0.50000000000000000, + 1.0471975511965976 }, + { 1.1219494000522143, -0.59999999999999998, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2680242605954486, -0.59999999999999998, 0.50000000000000000, + 1.3962634015954636 }, + { 1.4135484285693078, -0.59999999999999998, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.50000000000000000. +template <typename Tp> +void test036() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data036) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data036[i].k), Tp(data036[i].nu), + Tp(data036[i].phi)); + const Tp f0 = data036[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.59999999999999998. +testcase_ellint_3<double> data037[] = { + { -0.0000000000000000, -0.59999999999999998, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17380260984469356, -0.59999999999999998, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34353585361777839, -0.59999999999999998, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50646805774321402, -0.59999999999999998, 0.59999999999999998, + 0.52359877559829882 }, + { 0.66174468108625517, -0.59999999999999998, 0.59999999999999998, + 0.69813170079773179 }, + { 0.81007462280278408, -0.59999999999999998, 0.59999999999999998, + 0.87266462599716477 }, + { 0.95303466945718729, -0.59999999999999998, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0924118588677503, -0.59999999999999998, 0.59999999999999998, + 1.2217304763960306 }, + { 1.2297640574847937, -0.59999999999999998, 0.59999999999999998, + 1.3962634015954636 }, + { 1.3662507535812816, -0.59999999999999998, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.59999999999999998. +template <typename Tp> +void test037() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data037) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data037[i].k), Tp(data037[i].nu), + Tp(data037[i].phi)); + const Tp f0 = data037[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.69999999999999996. +testcase_ellint_3<double> data038[] = { + { -0.0000000000000000, -0.59999999999999998, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17362996946312009, -0.59999999999999998, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34225353454870588, -0.59999999999999998, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50259656397799546, -0.59999999999999998, 0.69999999999999996, + 0.52359877559829882 }, + { 0.65373184496628944, -0.59999999999999998, 0.69999999999999996, + 0.69813170079773179 }, + { 0.79658372884056439, -0.59999999999999998, 0.69999999999999996, + 0.87266462599716477 }, + { 0.93303240100245421, -0.59999999999999998, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0651547944716557, -0.59999999999999998, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1947676204853441, -0.59999999999999998, 0.69999999999999996, + 1.3962634015954636 }, + { 1.3232737468822811, -0.59999999999999998, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.69999999999999996. +template <typename Tp> +void test038() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data038) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data038[i].k), Tp(data038[i].nu), + Tp(data038[i].phi)); + const Tp f0 = data038[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.80000000000000004. +testcase_ellint_3<double> data039[] = { + { -0.0000000000000000, -0.59999999999999998, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17345794195390687, -0.59999999999999998, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34098797854531027, -0.59999999999999998, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49882569168826230, -0.59999999999999998, 0.80000000000000004, + 0.52359877559829882 }, + { 0.64603758566475511, -0.59999999999999998, 0.80000000000000004, + 0.69813170079773179 }, + { 0.78380365594769730, -0.59999999999999998, 0.80000000000000004, + 0.87266462599716477 }, + { 0.91430946255611190, -0.59999999999999998, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0398955217270607, -0.59999999999999998, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1625948314277676, -0.59999999999999998, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2840021261752192, -0.59999999999999998, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.80000000000000004. +template <typename Tp> +void test039() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data039) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data039[i].k), Tp(data039[i].nu), + Tp(data039[i].phi)); + const Tp f0 = data039[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.59999999999999998, nu=0.90000000000000002. +testcase_ellint_3<double> data040[] = { + { -0.0000000000000000, -0.59999999999999998, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17328652344890033, -0.59999999999999998, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33973880062929018, -0.59999999999999998, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49515092233122765, -0.59999999999999998, 0.90000000000000002, + 0.52359877559829882 }, + { 0.63864042139737043, -0.59999999999999998, 0.90000000000000002, + 0.69813170079773179 }, + { 0.77167205646538850, -0.59999999999999998, 0.90000000000000002, + 0.87266462599716477 }, + { 0.89673202848034383, -0.59999999999999998, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0163984492661304, -0.59999999999999998, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1328845785162431, -0.59999999999999998, 0.90000000000000002, + 1.3962634015954636 }, + { 1.2479362973851875, -0.59999999999999998, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.90000000000000002. +template <typename Tp> +void test040() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data040) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data040[i].k), Tp(data040[i].nu), + Tp(data040[i].phi)); + const Tp f0 = data040[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.0000000000000000. +testcase_ellint_3<double> data041[] = { + { -0.0000000000000000, -0.50000000000000000, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17475385514035785, -0.50000000000000000, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35081868470101585, -0.50000000000000000, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52942862705190585, -0.50000000000000000, 0.0000000000000000, + 0.52359877559829882 }, + { 0.71164727562630326, -0.50000000000000000, 0.0000000000000000, + 0.69813170079773179 }, + { 0.89824523594227768, -0.50000000000000000, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0895506700518851, -0.50000000000000000, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2853005857432933, -0.50000000000000000, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4845545520549484, -0.50000000000000000, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6857503548125963, -0.50000000000000000, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.0000000000000000. +template <typename Tp> +void test041() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data041) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data041[i].k), Tp(data041[i].nu), + Tp(data041[i].phi)); + const Tp f0 = data041[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.10000000000000001. +testcase_ellint_3<double> data042[] = { + { -0.0000000000000000, -0.50000000000000000, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17457763120814676, -0.50000000000000000, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34943246340849154, -0.50000000000000000, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52487937869610801, -0.50000000000000000, 0.10000000000000001, + 0.52359877559829882 }, + { 0.70127785096388395, -0.50000000000000000, 0.10000000000000001, + 0.69813170079773179 }, + { 0.87898815988624479, -0.50000000000000000, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0582764576094172, -0.50000000000000000, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2391936844060207, -0.50000000000000000, 0.10000000000000001, + 1.2217304763960306 }, + { 1.4214793542995841, -0.50000000000000000, 0.10000000000000001, + 1.3962634015954636 }, + { 1.6045524936084892, -0.50000000000000000, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.10000000000000001. +template <typename Tp> +void test042() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data042) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data042[i].k), Tp(data042[i].nu), + Tp(data042[i].phi)); + const Tp f0 = data042[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.20000000000000001. +testcase_ellint_3<double> data043[] = { + { -0.0000000000000000, -0.50000000000000000, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17440204336345433, -0.50000000000000000, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34806552388338824, -0.50000000000000000, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52046416757129821, -0.50000000000000000, 0.20000000000000001, + 0.52359877559829882 }, + { 0.69140924550993876, -0.50000000000000000, 0.20000000000000001, + 0.69813170079773179 }, + { 0.86104678636125520, -0.50000000000000000, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0297439459053981, -0.50000000000000000, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1979214112912036, -0.50000000000000000, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3659033858648930, -0.50000000000000000, 0.20000000000000001, + 1.3962634015954636 }, + { 1.5338490483665983, -0.50000000000000000, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.20000000000000001. +template <typename Tp> +void test043() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data043) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data043[i].k), Tp(data043[i].nu), + Tp(data043[i].phi)); + const Tp f0 = data043[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.29999999999999999. +testcase_ellint_3<double> data044[] = { + { -0.0000000000000000, -0.50000000000000000, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17422708752228896, -0.50000000000000000, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34671739434855858, -0.50000000000000000, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51617616305641889, -0.50000000000000000, 0.29999999999999999, + 0.52359877559829882 }, + { 0.68200047612545178, -0.50000000000000000, 0.29999999999999999, + 0.69813170079773179 }, + { 0.84427217869498372, -0.50000000000000000, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0035637821389782, -0.50000000000000000, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1606800483933113, -0.50000000000000000, 0.29999999999999999, + 1.2217304763960306 }, + { 1.3164407134643459, -0.50000000000000000, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4715681939859637, -0.50000000000000000, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.29999999999999999. +template <typename Tp> +void test044() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data044) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data044[i].k), Tp(data044[i].nu), + Tp(data044[i].phi)); + const Tp f0 = data044[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.40000000000000002. +testcase_ellint_3<double> data045[] = { + { -0.0000000000000000, -0.50000000000000000, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17405275963859917, -0.50000000000000000, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34538761957029329, -0.50000000000000000, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51200902646603919, -0.50000000000000000, 0.40000000000000002, + 0.52359877559829882 }, + { 0.67301522212868792, -0.50000000000000000, 0.40000000000000002, + 0.69813170079773179 }, + { 0.82853844466313320, -0.50000000000000000, 0.40000000000000002, + 0.87266462599716477 }, + { 0.97942097862681488, -0.50000000000000000, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1268429801220616, -0.50000000000000000, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2720406704533922, -0.50000000000000000, 0.40000000000000002, + 1.3962634015954636 }, + { 1.4161679518465340, -0.50000000000000000, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.40000000000000002. +template <typename Tp> +void test045() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data045) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data045[i].k), Tp(data045[i].nu), + Tp(data045[i].phi)); + const Tp f0 = data045[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.50000000000000000. +testcase_ellint_3<double> data046[] = { + { -0.0000000000000000, -0.50000000000000000, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17387905570381157, -0.50000000000000000, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34407576010465207, -0.50000000000000000, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50795686560160835, -0.50000000000000000, 0.50000000000000000, + 0.52359877559829882 }, + { 0.66442115453330175, -0.50000000000000000, 0.50000000000000000, + 0.69813170079773179 }, + { 0.81373829119355345, -0.50000000000000000, 0.50000000000000000, + 0.87266462599716477 }, + { 0.95705743313235825, -0.50000000000000000, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0959131991362556, -0.50000000000000000, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2318900529754597, -0.50000000000000000, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3664739530045971, -0.50000000000000000, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.50000000000000000. +template <typename Tp> +void test046() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data046) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data046[i].k), Tp(data046[i].nu), + Tp(data046[i].phi)); + const Tp f0 = data046[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.59999999999999998. +testcase_ellint_3<double> data047[] = { + { -0.0000000000000000, -0.50000000000000000, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17370597174637581, -0.50000000000000000, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34278139158591414, -0.50000000000000000, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50401419439302719, -0.50000000000000000, 0.59999999999999998, + 0.52359877559829882 }, + { 0.65618938076167221, -0.50000000000000000, 0.59999999999999998, + 0.69813170079773179 }, + { 0.79977959248855424, -0.50000000000000000, 0.59999999999999998, + 0.87266462599716477 }, + { 0.93625925190753545, -0.50000000000000000, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0674905658379710, -0.50000000000000000, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1953481298023048, -0.50000000000000000, 0.59999999999999998, + 1.3962634015954636 }, + { 1.3215740290190876, -0.50000000000000000, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.59999999999999998. +template <typename Tp> +void test047() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data047) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data047[i].k), Tp(data047[i].nu), + Tp(data047[i].phi)); + const Tp f0 = data047[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.69999999999999996. +testcase_ellint_3<double> data048[] = { + { -0.0000000000000000, -0.50000000000000000, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17353350383131641, -0.50000000000000000, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34150410405436771, -0.50000000000000000, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50017589696443487, -0.50000000000000000, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64829398188419962, -0.50000000000000000, 0.69999999999999996, + 0.69813170079773179 }, + { 0.78658270782402073, -0.50000000000000000, 0.69999999999999996, + 0.87266462599716477 }, + { 0.91684738336675053, -0.50000000000000000, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0412486789555937, -0.50000000000000000, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1619021847612001, -0.50000000000000000, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2807475181182502, -0.50000000000000000, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.69999999999999996. +template <typename Tp> +void test048() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data048) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data048[i].k), Tp(data048[i].nu), + Tp(data048[i].phi)); + const Tp f0 = data048[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.80000000000000004. +testcase_ellint_3<double> data049[] = { + { -0.0000000000000000, -0.50000000000000000, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17336164805979126, -0.50000000000000000, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34024350132086773, -0.50000000000000000, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49643719555734084, -0.50000000000000000, 0.80000000000000004, + 0.52359877559829882 }, + { 0.64071162456976150, -0.50000000000000000, 0.80000000000000004, + 0.69813170079773179 }, + { 0.77407836177211908, -0.50000000000000000, 0.80000000000000004, + 0.87266462599716477 }, + { 0.89867058251905652, -0.50000000000000000, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0169181822134912, -0.50000000000000000, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1311363312779448, -0.50000000000000000, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2434165408189539, -0.50000000000000000, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.80000000000000004. +template <typename Tp> +void test049() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data049) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data049[i].k), Tp(data049[i].nu), + Tp(data049[i].phi)); + const Tp f0 = data049[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.50000000000000000, nu=0.90000000000000002. +testcase_ellint_3<double> data050[] = { + { -0.0000000000000000, -0.50000000000000000, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17319040056865681, -0.50000000000000000, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33899920036578557, -0.50000000000000000, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49279362182695186, -0.50000000000000000, 0.90000000000000002, + 0.52359877559829882 }, + { 0.63342123379746151, -0.50000000000000000, 0.90000000000000002, + 0.69813170079773179 }, + { 0.76220595179550321, -0.50000000000000000, 0.90000000000000002, + 0.87266462599716477 }, + { 0.88160004743532294, -0.50000000000000000, 0.90000000000000002, + 1.0471975511965976 }, + { 0.99427448642310134, -0.50000000000000000, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1027091512470093, -0.50000000000000000, 0.90000000000000002, + 1.3962634015954636 }, + { 1.2091116095504744, -0.50000000000000000, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.90000000000000002. +template <typename Tp> +void test050() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data050) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data050[i].k), Tp(data050[i].nu), + Tp(data050[i].phi)); + const Tp f0 = data050[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.0000000000000000. +testcase_ellint_3<double> data051[] = { + { -0.0000000000000000, -0.40000000000000002, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17467414669441531, -0.40000000000000002, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35018222772483443, -0.40000000000000002, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52729015917508748, -0.40000000000000002, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70662374407341255, -0.40000000000000002, 0.0000000000000000, + 0.69813170079773179 }, + { 0.88859210497602170, -0.40000000000000002, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0733136290471379, -0.40000000000000002, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2605612170157061, -0.40000000000000002, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4497513956433437, -0.40000000000000002, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6399998658645112, -0.40000000000000002, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.0000000000000000. +template <typename Tp> +void test051() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data051) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data051[i].k), Tp(data051[i].nu), + Tp(data051[i].phi)); + const Tp f0 = data051[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.10000000000000001. +testcase_ellint_3<double> data052[] = { + { -0.0000000000000000, -0.40000000000000002, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17449806706684673, -0.40000000000000002, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34880048623856075, -0.40000000000000002, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52277322065757403, -0.40000000000000002, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69638072056918376, -0.40000000000000002, 0.10000000000000001, + 0.69813170079773179 }, + { 0.86968426619831540, -0.40000000000000002, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0428044206578095, -0.40000000000000002, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2158651158274378, -0.40000000000000002, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3889447129893322, -0.40000000000000002, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5620566886683604, -0.40000000000000002, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.10000000000000001. +template <typename Tp> +void test052() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data052) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data052[i].k), Tp(data052[i].nu), + Tp(data052[i].phi)); + const Tp f0 = data052[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.20000000000000001. +testcase_ellint_3<double> data053[] = { + { -0.0000000000000000, -0.40000000000000002, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17432262290723399, -0.40000000000000002, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34743795258968596, -0.40000000000000002, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51838919472805123, -0.40000000000000002, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68663134739057918, -0.40000000000000002, 0.20000000000000001, + 0.69813170079773179 }, + { 0.85206432981833979, -0.40000000000000002, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0149595349004430, -0.40000000000000002, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1758349405464676, -0.40000000000000002, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3353337673882635, -0.40000000000000002, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4941414344266770, -0.40000000000000002, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.20000000000000001. +template <typename Tp> +void test053() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data053) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data053[i].k), Tp(data053[i].nu), + Tp(data053[i].phi)); + const Tp f0 = data053[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.29999999999999999. +testcase_ellint_3<double> data054[] = { + { -0.0000000000000000, -0.40000000000000002, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17414781013591543, -0.40000000000000002, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34609415696777285, -0.40000000000000002, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51413131295862546, -0.40000000000000002, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67733527622935630, -0.40000000000000002, 0.29999999999999999, + 0.69813170079773179 }, + { 0.83558675182733266, -0.40000000000000002, 0.29999999999999999, + 0.87266462599716477 }, + { 0.98940140808865906, -0.40000000000000002, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1396968797728058, -0.40000000000000002, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2875920037865087, -0.40000000000000002, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4342789859950078, -0.40000000000000002, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.29999999999999999. +template <typename Tp> +void test054() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data054) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data054[i].k), Tp(data054[i].nu), + Tp(data054[i].phi)); + const Tp f0 = data054[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.40000000000000002. +testcase_ellint_3<double> data055[] = { + { -0.0000000000000000, -0.40000000000000002, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17397362471112710, -0.40000000000000002, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34476864603333196, -0.40000000000000002, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50999329415379357, -0.40000000000000002, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66845674551396017, -0.40000000000000002, 0.40000000000000002, + 0.69813170079773179 }, + { 0.82012848346231748, -0.40000000000000002, 0.40000000000000002, + 0.87266462599716477 }, + { 0.96582449258349057, -0.40000000000000002, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1068473749476286, -0.40000000000000002, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2447132729159986, -0.40000000000000002, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3809986210732901, -0.40000000000000002, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.40000000000000002. +template <typename Tp> +void test055() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data055) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data055[i].k), Tp(data055[i].nu), + Tp(data055[i].phi)); + const Tp f0 = data055[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.50000000000000000. +testcase_ellint_3<double> data056[] = { + { -0.0000000000000000, -0.40000000000000002, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17380006262854139, -0.40000000000000002, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34346098216756610, -0.40000000000000002, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50596929935059420, -0.40000000000000002, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65996392089131262, -0.40000000000000002, 0.50000000000000000, + 0.69813170079773179 }, + { 0.80558463511364786, -0.40000000000000002, 0.50000000000000000, + 0.87266462599716477 }, + { 0.94397834522857704, -0.40000000000000002, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0768075114108115, -0.40000000000000002, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2059184624251329, -0.40000000000000002, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3331797176377398, -0.40000000000000002, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.50000000000000000. +template <typename Tp> +void test056() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data056) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data056[i].k), Tp(data056[i].nu), + Tp(data056[i].phi)); + const Tp f0 = data056[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.59999999999999998. +testcase_ellint_3<double> data057[] = { + { -0.0000000000000000, -0.40000000000000002, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17362711992081248, -0.40000000000000002, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34217074276403953, -0.40000000000000002, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50205389185761617, -0.40000000000000002, 0.59999999999999998, + 0.52359877559829882 }, + { 0.65182834920372745, -0.40000000000000002, 0.59999999999999998, + 0.69813170079773179 }, + { 0.79186512820565136, -0.40000000000000002, 0.59999999999999998, + 0.87266462599716477 }, + { 0.92365535916287134, -0.40000000000000002, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0491915663957907, -0.40000000000000002, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1705934291745104, -0.40000000000000002, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2899514672527024, -0.40000000000000002, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.59999999999999998. +template <typename Tp> +void test057() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data057) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data057[i].k), Tp(data057[i].nu), + Tp(data057[i].phi)); + const Tp f0 = data057[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.69999999999999996. +testcase_ellint_3<double> data058[] = { + { -0.0000000000000000, -0.40000000000000002, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17345479265712871, -0.40000000000000002, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34089751955950354, -0.40000000000000002, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49824200167361343, -0.40000000000000002, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64402450341199413, -0.40000000000000002, 0.69999999999999996, + 0.69813170079773179 }, + { 0.77889207804122873, -0.40000000000000002, 0.69999999999999996, + 0.87266462599716477 }, + { 0.90468169720957992, -0.40000000000000002, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0236847823692916, -0.40000000000000002, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1382465247425164, -0.40000000000000002, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2506255923253344, -0.40000000000000002, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.69999999999999996. +template <typename Tp> +void test058() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data058) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data058[i].k), Tp(data058[i].nu), + Tp(data058[i].phi)); + const Tp f0 = data058[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.80000000000000004. +testcase_ellint_3<double> data059[] = { + { -0.0000000000000000, -0.40000000000000002, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17328307694277156, -0.40000000000000002, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33964091800132007, -0.40000000000000002, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49452889372467451, -0.40000000000000002, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63652940095937327, -0.40000000000000002, 0.80000000000000004, + 0.69813170079773179 }, + { 0.76659772511159097, -0.40000000000000002, 0.80000000000000004, + 0.87266462599716477 }, + { 0.88691047977338111, -0.40000000000000002, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0000273200611638, -0.40000000000000002, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1084787902188007, -0.40000000000000002, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2146499565727209, -0.40000000000000002, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.80000000000000004. +template <typename Tp> +void test059() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data059) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data059[i].k), Tp(data059[i].nu), + Tp(data059[i].phi)); + const Tp f0 = data059[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.40000000000000002, nu=0.90000000000000002. +testcase_ellint_3<double> data060[] = { + { -0.0000000000000000, -0.40000000000000002, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17311196891868130, -0.40000000000000002, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33840055664911906, -0.40000000000000002, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49091013944075340, -0.40000000000000002, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62932228186809591, -0.40000000000000002, 0.90000000000000002, + 0.69813170079773179 }, + { 0.75492278323019801, -0.40000000000000002, 0.90000000000000002, + 0.87266462599716477 }, + { 0.87021659043854294, -0.40000000000000002, 0.90000000000000002, + 1.0471975511965976 }, + { 0.97800245228239246, -0.40000000000000002, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0809625773173694, -0.40000000000000002, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1815758115929846, -0.40000000000000002, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.90000000000000002. +template <typename Tp> +void test060() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data060) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data060[i].k), Tp(data060[i].nu), + Tp(data060[i].phi)); + const Tp f0 = data060[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.0000000000000000. +testcase_ellint_3<double> data061[] = { + { -0.0000000000000000, -0.30000000000000004, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17461228653000102, -0.30000000000000004, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34969146102798415, -0.30000000000000004, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52565822873726320, -0.30000000000000004, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70284226512408532, -0.30000000000000004, 0.0000000000000000, + 0.69813170079773179 }, + { 0.88144139195111182, -0.30000000000000004, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0614897067260523, -0.30000000000000004, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2428416824174218, -0.30000000000000004, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4251795877015925, -0.30000000000000004, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6080486199305126, -0.30000000000000004, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.0000000000000000. +template <typename Tp> +void test061() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data061) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data061[i].k), Tp(data061[i].nu), + Tp(data061[i].phi)); + const Tp f0 = data061[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.10000000000000001. +testcase_ellint_3<double> data062[] = { + { -0.0000000000000000, -0.30000000000000004, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17443631884814378, -0.30000000000000004, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34831316835124926, -0.30000000000000004, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52116586276523857, -0.30000000000000004, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69269385837910036, -0.30000000000000004, 0.10000000000000001, + 0.69813170079773179 }, + { 0.86279023163070856, -0.30000000000000004, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0315321461438265, -0.30000000000000004, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1991449111869024, -0.30000000000000004, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3659561780923211, -0.30000000000000004, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5323534693557526, -0.30000000000000004, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.10000000000000001. +template <typename Tp> +void test062() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data062) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data062[i].k), Tp(data062[i].nu), + Tp(data062[i].phi)); + const Tp f0 = data062[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.20000000000000001. +testcase_ellint_3<double> data063[] = { + { -0.0000000000000000, -0.30000000000000004, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17426098615372090, -0.30000000000000004, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34695402664689923, -0.30000000000000004, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51680555567038933, -0.30000000000000004, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68303375225260210, -0.30000000000000004, 0.20000000000000001, + 0.69813170079773179 }, + { 0.84540662891295026, -0.30000000000000004, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0041834051646927, -0.30000000000000004, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1599952702345711, -0.30000000000000004, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3137179520499163, -0.30000000000000004, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4663658145259875, -0.30000000000000004, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.20000000000000001. +template <typename Tp> +void test063() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data063) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data063[i].k), Tp(data063[i].nu), + Tp(data063[i].phi)); + const Tp f0 = data063[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.29999999999999999. +testcase_ellint_3<double> data064[] = { + { -0.0000000000000000, -0.30000000000000004, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17408628437042845, -0.30000000000000004, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34561356761638401, -0.30000000000000004, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51257058617875850, -0.30000000000000004, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67382207124602866, -0.30000000000000004, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82914751587825131, -0.30000000000000004, 0.29999999999999999, + 0.87266462599716477 }, + { 0.97907434814374950, -0.30000000000000004, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1246399297351584, -0.30000000000000004, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2671793970398146, -0.30000000000000004, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4081767433479089, -0.30000000000000004, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.29999999999999999. +template <typename Tp> +void test064() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data064) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data064[i].k), Tp(data064[i].nu), + Tp(data064[i].phi)); + const Tp f0 = data064[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.40000000000000002. +testcase_ellint_3<double> data065[] = { + { -0.0000000000000000, -0.30000000000000004, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17391220945982730, -0.30000000000000004, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34429133937639689, -0.30000000000000004, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50845471668581632, -0.30000000000000004, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66502347027873854, -0.30000000000000004, 0.40000000000000002, + 0.69813170079773179 }, + { 0.81389191978012254, -0.30000000000000004, 0.40000000000000002, + 0.87266462599716477 }, + { 0.95590618002140593, -0.30000000000000004, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0924915195213121, -0.30000000000000004, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2253651604038058, -0.30000000000000004, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3563643538969761, -0.30000000000000004, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.40000000000000002. +template <typename Tp> +void test065() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data065) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data065[i].k), Tp(data065[i].nu), + Tp(data065[i].phi)); + const Tp f0 = data065[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.50000000000000000. +testcase_ellint_3<double> data066[] = { + { -0.0000000000000000, -0.30000000000000004, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17373875742088235, -0.30000000000000004, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34298690571124157, -0.30000000000000004, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50445214859646936, -0.30000000000000004, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65660648352418516, -0.30000000000000004, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79953670639287289, -0.30000000000000004, 0.50000000000000000, + 0.87266462599716477 }, + { 0.93443393926588558, -0.30000000000000004, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0630838369016911, -0.30000000000000004, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1875197325653026, -0.30000000000000004, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3098448759814960, -0.30000000000000004, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.50000000000000000. +template <typename Tp> +void test066() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data066) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data066[i].k), Tp(data066[i].nu), + Tp(data066[i].phi)); + const Tp f0 = data066[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.59999999999999998. +testcase_ellint_3<double> data067[] = { + { -0.0000000000000000, -0.30000000000000004, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17356592428950826, -0.30000000000000004, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34169984536697379, -0.30000000000000004, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50055748266498457, -0.30000000000000004, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64854298527106768, -0.30000000000000004, 0.59999999999999998, + 0.69813170079773179 }, + { 0.78599329284207431, -0.30000000000000004, 0.59999999999999998, + 0.87266462599716477 }, + { 0.91445452089128221, -0.30000000000000004, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0360412952290587, -0.30000000000000004, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1530473919778639, -0.30000000000000004, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2677758800420666, -0.30000000000000004, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.59999999999999998. +template <typename Tp> +void test067() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data067) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data067[i].k), Tp(data067[i].nu), + Tp(data067[i].phi)); + const Tp f0 = data067[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.69999999999999996. +testcase_ellint_3<double> data068[] = { + { -0.0000000000000000, -0.30000000000000004, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17339370613812227, -0.30000000000000004, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34042975138455933, -0.30000000000000004, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49676568368075985, -0.30000000000000004, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64080774055753720, -0.30000000000000004, 0.69999999999999996, + 0.69813170079773179 }, + { 0.77318507779667278, -0.30000000000000004, 0.69999999999999996, + 0.87266462599716477 }, + { 0.89579782346548631, -0.30000000000000004, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0110573286052202, -0.30000000000000004, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1214710972949633, -0.30000000000000004, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2294913236274980, -0.30000000000000004, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.69999999999999996. +template <typename Tp> +void test068() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data068) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data068[i].k), Tp(data068[i].nu), + Tp(data068[i].phi)); + const Tp f0 = data068[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.80000000000000004. +testcase_ellint_3<double> data069[] = { + { -0.0000000000000000, -0.30000000000000004, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17322209907520361, -0.30000000000000004, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33917623046949996, -0.30000000000000004, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49307204894329176, -0.30000000000000004, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63337802830291723, -0.30000000000000004, 0.80000000000000004, + 0.69813170079773179 }, + { 0.76104540997689407, -0.30000000000000004, 0.80000000000000004, + 0.87266462599716477 }, + { 0.87832009635450736, -0.30000000000000004, 0.80000000000000004, + 1.0471975511965976 }, + { 0.98787879723171790, -0.30000000000000004, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0924036340069336, -0.30000000000000004, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1944567571590046, -0.30000000000000004, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.80000000000000004. +template <typename Tp> +void test069() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data069) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data069[i].k), Tp(data069[i].nu), + Tp(data069[i].phi)); + const Tp f0 = data069[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.30000000000000004, nu=0.90000000000000002. +testcase_ellint_3<double> data070[] = { + { -0.0000000000000000, -0.30000000000000004, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17305109924485948, -0.30000000000000004, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33793890239556984, -0.30000000000000004, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48947218005089738, -0.30000000000000004, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62623332340775151, -0.30000000000000004, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74951596581511148, -0.30000000000000004, 0.90000000000000002, + 0.87266462599716477 }, + { 0.86189886597756005, -0.30000000000000004, 0.90000000000000002, + 1.0471975511965976 }, + { 0.96629451153092005, -0.30000000000000004, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0655269133492680, -0.30000000000000004, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1622376896064912, -0.30000000000000004, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.90000000000000002. +template <typename Tp> +void test070() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data070) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data070[i].k), Tp(data070[i].nu), + Tp(data070[i].phi)); + const Tp f0 = data070[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.0000000000000000. +testcase_ellint_3<double> data071[] = { + { -0.0000000000000000, -0.19999999999999996, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17456817290292811, -0.19999999999999996, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34934315932086801, -0.19999999999999996, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52450880529443988, -0.19999999999999996, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70020491009844910, -0.19999999999999996, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87651006649967955, -0.19999999999999996, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0534305870298994, -0.19999999999999996, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2308975521670784, -0.19999999999999996, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4087733584990738, -0.19999999999999996, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5868678474541664, -0.19999999999999996, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.0000000000000000. +template <typename Tp> +void test071() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data071) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data071[i].k), Tp(data071[i].nu), + Tp(data071[i].phi)); + const Tp f0 = data071[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.10000000000000001. +testcase_ellint_3<double> data072[] = { + { -0.0000000000000000, -0.19999999999999996, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17439228502691750, -0.19999999999999996, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34796731137565740, -0.19999999999999996, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52003370294544848, -0.19999999999999996, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69012222258631495, -0.19999999999999996, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85803491465566772, -0.19999999999999996, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0238463961099364, -0.19999999999999996, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1878691059202153, -0.19999999999999996, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3505985031831940, -0.19999999999999996, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5126513474261092, -0.19999999999999996, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.10000000000000001. +template <typename Tp> +void test072() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data072) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data072[i].k), Tp(data072[i].nu), + Tp(data072[i].phi)); + const Tp f0 = data072[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.20000000000000001. +testcase_ellint_3<double> data073[] = { + { -0.0000000000000000, -0.19999999999999996, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17421703179583750, -0.19999999999999996, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34661057411998791, -0.19999999999999996, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51569006052647393, -0.19999999999999996, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68052412821107278, -0.19999999999999996, 0.20000000000000001, + 0.69813170079773179 }, + { 0.84081341263313825, -0.19999999999999996, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99683359988842890, -0.19999999999999996, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1493086715118852, -0.19999999999999996, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2992699693957541, -0.19999999999999996, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4479323932249568, -0.19999999999999996, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.20000000000000001. +template <typename Tp> +void test073() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data073) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data073[i].k), Tp(data073[i].nu), + Tp(data073[i].phi)); + const Tp f0 = data073[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.29999999999999999. +testcase_ellint_3<double> data074[] = { + { -0.0000000000000000, -0.19999999999999996, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17404240913577707, -0.19999999999999996, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34527248032587193, -0.19999999999999996, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51147118981668416, -0.19999999999999996, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67137107867777635, -0.19999999999999996, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82470418188668893, -0.19999999999999996, 0.29999999999999999, + 0.87266462599716477 }, + { 0.97202873223594299, -0.19999999999999996, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1144773569375266, -0.19999999999999996, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2535292433701000, -0.19999999999999996, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3908453514752481, -0.19999999999999996, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.29999999999999999. +template <typename Tp> +void test074() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data074) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data074[i].k), Tp(data074[i].nu), + Tp(data074[i].phi)); + const Tp f0 = data074[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.40000000000000002. +testcase_ellint_3<double> data075[] = { + { -0.0000000000000000, -0.19999999999999996, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17386841301066677, -0.19999999999999996, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34395257914113253, -0.19999999999999996, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50737088376869466, -0.19999999999999996, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66262801717277664, -0.19999999999999996, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80958766645079094, -0.19999999999999996, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94913754236162040, -0.19999999999999996, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0827985514223000, -0.19999999999999996, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2124212429050478, -0.19999999999999996, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3400002519661010, -0.19999999999999996, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.40000000000000002. +template <typename Tp> +void test075() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data075) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data075[i].k), Tp(data075[i].nu), + Tp(data075[i].phi)); + const Tp f0 = data075[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.50000000000000000. +testcase_ellint_3<double> data076[] = { + { -0.0000000000000000, -0.19999999999999996, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17369503942181802, -0.19999999999999996, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34265043534362660, -0.19999999999999996, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50338337208655415, -0.19999999999999996, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65426373297163642, -0.19999999999999996, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79536193036145808, -0.19999999999999996, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92791875910061605, -0.19999999999999996, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0538145052725829, -0.19999999999999996, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1752060022875899, -0.19999999999999996, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2943374404397376, -0.19999999999999996, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.50000000000000000. +template <typename Tp> +void test076() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data076) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data076[i].k), Tp(data076[i].nu), + Tp(data076[i].phi)); + const Tp f0 = data076[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.59999999999999998. +testcase_ellint_3<double> data077[] = { + { -0.0000000000000000, -0.19999999999999996, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17352228440746928, -0.19999999999999996, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34136562863713626, -0.19999999999999996, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49950328177638481, -0.19999999999999996, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64625032705690832, -0.19999999999999996, 0.59999999999999998, + 0.69813170079773179 }, + { 0.78193941198403094, -0.19999999999999996, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90817230934317128, -0.19999999999999996, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0271563751276462, -0.19999999999999996, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1412999379040518, -0.19999999999999996, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2530330675914561, -0.19999999999999996, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.59999999999999998. +template <typename Tp> +void test077() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data077) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data077[i].k), Tp(data077[i].nu), + Tp(data077[i].phi)); + const Tp f0 = data077[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.69999999999999996. +testcase_ellint_3<double> data078[] = { + { -0.0000000000000000, -0.19999999999999996, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17335014404233898, -0.19999999999999996, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34009775298617811, -0.19999999999999996, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49572560201923810, -0.19999999999999996, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63856276669886525, -0.19999999999999996, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76924438644867565, -0.19999999999999996, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88973060843856466, -0.19999999999999996, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0025230471636377, -0.19999999999999996, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1102356376093103, -0.19999999999999996, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2154356555075867, -0.19999999999999996, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.69999999999999996. +template <typename Tp> +void test078() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data078) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data078[i].k), Tp(data078[i].nu), + Tp(data078[i].phi)); + const Tp f0 = data078[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.80000000000000004. +testcase_ellint_3<double> data079[] = { + { -0.0000000000000000, -0.19999999999999996, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17317861443718541, -0.19999999999999996, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33884641598718701, -0.19999999999999996, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49204565281259494, -0.19999999999999996, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63117851188220353, -0.19999999999999996, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75721095949544170, -0.19999999999999996, 0.80000000000000004, + 0.87266462599716477 }, + { 0.87245201443919118, -0.19999999999999996, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97966584238831089, -0.19999999999999996, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0816336325174360, -0.19999999999999996, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1810223448909913, -0.19999999999999996, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.80000000000000004. +template <typename Tp> +void test079() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data079) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data079[i].k), Tp(data079[i].nu), + Tp(data079[i].phi)); + const Tp f0 = data079[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.19999999999999996, nu=0.90000000000000002. +testcase_ellint_3<double> data080[] = { + { -0.0000000000000000, -0.19999999999999996, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17300769173837280, -0.19999999999999996, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33761123827372508, -0.19999999999999996, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48845905690769426, -0.19999999999999996, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62407720017324986, -0.19999999999999996, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74578146525124289, -0.19999999999999996, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85621583540073076, -0.19999999999999996, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95837725988001199, -0.19999999999999996, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0551821412633928, -0.19999999999999996, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1493679916141863, -0.19999999999999996, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.90000000000000002. +template <typename Tp> +void test080() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data080) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data080[i].k), Tp(data080[i].nu), + Tp(data080[i].phi)); + const Tp f0 = data080[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.0000000000000000. +testcase_ellint_3<double> data081[] = { + { -0.0000000000000000, -0.099999999999999978, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17454173353063665, -0.099999999999999978, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34913506721468085, -0.099999999999999978, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52382550016538953, -0.099999999999999978, 0.0000000000000000, + 0.52359877559829882 }, + { 0.69864700854177031, -0.099999999999999978, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87361792586964870, -0.099999999999999978, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0487386319621685, -0.099999999999999978, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2239913752078757, -0.099999999999999978, 0.0000000000000000, + 1.2217304763960306 }, + { 1.3993423113684049, -0.099999999999999978, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5747455615173562, -0.099999999999999978, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.0000000000000000. +template <typename Tp> +void test081() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data081) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data081[i].k), Tp(data081[i].nu), + Tp(data081[i].phi)); + const Tp f0 = data081[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.10000000000000001. +testcase_ellint_3<double> data082[] = { + { -0.0000000000000000, -0.099999999999999978, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17436589347616618, -0.099999999999999978, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34776067871237354, -0.099999999999999978, 0.10000000000000001, + 0.34906585039886590 }, + { 0.51936064354727807, -0.099999999999999978, 0.10000000000000001, + 0.52359877559829882 }, + { 0.68860303749364360, -0.099999999999999978, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85524561882332051, -0.099999999999999978, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0193708301908337, -0.099999999999999978, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1813474067123044, -0.099999999999999978, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3417670770424983, -0.099999999999999978, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5013711111199950, -0.099999999999999978, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.10000000000000001. +template <typename Tp> +void test082() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data082) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data082[i].k), Tp(data082[i].nu), + Tp(data082[i].phi)); + const Tp f0 = data082[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.20000000000000001. +testcase_ellint_3<double> data083[] = { + { -0.0000000000000000, -0.099999999999999978, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17419068786141345, -0.099999999999999978, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34640537686230127, -0.099999999999999978, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51502689171753957, -0.099999999999999978, 0.20000000000000001, + 0.52359877559829882 }, + { 0.67904147863672726, -0.099999999999999978, 0.20000000000000001, + 0.69813170079773179 }, + { 0.83811885126105179, -0.099999999999999978, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99255278555742810, -0.099999999999999978, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1431260546194930, -0.099999999999999978, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2909589656532101, -0.099999999999999978, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4373749386463430, -0.099999999999999978, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.20000000000000001. +template <typename Tp> +void test083() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data083) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data083[i].k), Tp(data083[i].nu), + Tp(data083[i].phi)); + const Tp f0 = data083[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.29999999999999999. +testcase_ellint_3<double> data084[] = { + { -0.0000000000000000, -0.099999999999999978, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17401611261390110, -0.099999999999999978, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34506869507511767, -0.099999999999999978, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51081757604259870, -0.099999999999999978, 0.29999999999999999, + 0.52359877559829882 }, + { 0.66992297597712303, -0.099999999999999978, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82209722856174228, -0.099999999999999978, 0.29999999999999999, + 0.87266462599716477 }, + { 0.96792430487669612, -0.099999999999999978, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1085964108954092, -0.099999999999999978, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2456748370836999, -0.099999999999999978, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3809159606704959, -0.099999999999999978, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.29999999999999999. +template <typename Tp> +void test084() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data084) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data084[i].k), Tp(data084[i].nu), + Tp(data084[i].phi)); + const Tp f0 = data084[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.40000000000000002. +testcase_ellint_3<double> data085[] = { + { -0.0000000000000000, -0.099999999999999978, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17384216369897937, -0.099999999999999978, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34375018311376782, -0.099999999999999978, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50672650758380455, -0.099999999999999978, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66121264213337616, -0.099999999999999978, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80706202005774441, -0.099999999999999978, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94519376138245892, -0.099999999999999978, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0771880300759584, -0.099999999999999978, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2049711557188272, -0.099999999999999978, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3306223265207477, -0.099999999999999978, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.40000000000000002. +template <typename Tp> +void test085() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data085) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data085[i].k), Tp(data085[i].nu), + Tp(data085[i].phi)); + const Tp f0 = data085[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.50000000000000000. +testcase_ellint_3<double> data086[] = { + { -0.0000000000000000, -0.099999999999999978, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17366883711936554, -0.099999999999999978, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34244940634881876, -0.099999999999999978, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50274793281634378, -0.099999999999999978, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65287941633275093, -0.099999999999999978, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79291198790315398, -0.099999999999999978, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92412201537880345, -0.099999999999999978, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0484480076799370, -0.099999999999999978, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1681168130475206, -0.099999999999999978, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2854480708580160, -0.099999999999999978, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.50000000000000000. +template <typename Tp> +void test086() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data086) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data086[i].k), Tp(data086[i].nu), + Tp(data086[i].phi)); + const Tp f0 = data086[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.59999999999999998. +testcase_ellint_3<double> data087[] = { + { -0.0000000000000000, -0.099999999999999978, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17349612891469018, -0.099999999999999978, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34116594505539438, -0.099999999999999978, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49887649430466685, -0.099999999999999978, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64489553282165157, -0.099999999999999978, 0.59999999999999998, + 0.69813170079773179 }, + { 0.77956016553782437, -0.099999999999999978, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90451074530096309, -0.099999999999999978, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0220113666961632, -0.099999999999999978, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1345351441065563, -0.099999999999999978, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2445798942989255, -0.099999999999999978, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.59999999999999998. +template <typename Tp> +void test087() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data087) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data087[i].k), Tp(data087[i].nu), + Tp(data087[i].phi)); + const Tp f0 = data087[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.69999999999999996. +testcase_ellint_3<double> data088[] = { + { -0.0000000000000000, -0.099999999999999978, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17332403516105052, -0.099999999999999978, 0.69999999999999996, + 0.17453292519943295 }, + { 0.33989939374896877, -0.099999999999999978, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49510719568614081, -0.099999999999999978, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63723607776354974, -0.099999999999999978, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76693133887935327, -0.099999999999999978, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88619382078823827, -0.099999999999999978, 0.69999999999999996, + 1.0471975511965976 }, + { 0.99758012018676490, -0.099999999999999978, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1037642270814410, -0.099999999999999978, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2073745911083187, -0.099999999999999978, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.69999999999999996. +template <typename Tp> +void test088() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data088) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data088[i].k), Tp(data088[i].nu), + Tp(data088[i].phi)); + const Tp f0 = data088[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.80000000000000004. +testcase_ellint_3<double> data089[] = { + { -0.0000000000000000, -0.099999999999999978, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17315255197057020, -0.099999999999999978, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33864936055747985, -0.099999999999999978, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49143537041117619, -0.099999999999999978, 0.80000000000000004, + 0.52359877559829882 }, + { 0.62987861760047492, -0.099999999999999978, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75496005490917517, -0.099999999999999978, 0.80000000000000004, + 0.87266462599716477 }, + { 0.86903081862701903, -0.099999999999999978, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97490814820725591, -0.099999999999999978, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0754290107171083, -0.099999999999999978, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1733158866987732, -0.099999999999999978, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.80000000000000004. +template <typename Tp> +void test089() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data089) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data089[i].k), Tp(data089[i].nu), + Tp(data089[i].phi)); + const Tp f0 = data089[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=-0.099999999999999978, nu=0.90000000000000002. +testcase_ellint_3<double> data090[] = { + { -0.0000000000000000, -0.099999999999999978, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17298167549096569, -0.099999999999999978, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33741546662741584, -0.099999999999999978, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48785665376856879, -0.099999999999999978, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62280288554518959, -0.099999999999999978, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74358903115455199, -0.099999999999999978, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85290207679298358, -0.099999999999999978, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95379006645397379, -0.099999999999999978, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0492213119872327, -0.099999999999999978, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1419839485283374, -0.099999999999999978, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.90000000000000002. +template <typename Tp> +void test090() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data090) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data090[i].k), Tp(data090[i].nu), + Tp(data090[i].phi)); + const Tp f0 = data090[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.0000000000000000. +testcase_ellint_3<double> data091[] = { + { -0.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17453292519943295, 0.0000000000000000, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34906585039886584, 0.0000000000000000, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52359877559829882, 0.0000000000000000, 0.0000000000000000, + 0.52359877559829882 }, + { 0.69813170079773179, 0.0000000000000000, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87266462599716477, 0.0000000000000000, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0471975511965976, 0.0000000000000000, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2217304763960304, 0.0000000000000000, 0.0000000000000000, + 1.2217304763960306 }, + { 1.3962634015954631, 0.0000000000000000, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5707963267948966, 0.0000000000000000, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.0000000000000000. +template <typename Tp> +void test091() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data091) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data091[i].k), Tp(data091[i].nu), + Tp(data091[i].phi)); + const Tp f0 = data091[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.10000000000000001. +testcase_ellint_3<double> data092[] = { + { -0.0000000000000000, 0.0000000000000000, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17435710107516608, 0.0000000000000000, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34769194715329604, 0.0000000000000000, 0.10000000000000001, + 0.34906585039886590 }, + { 0.51913731575866118, 0.0000000000000000, 0.10000000000000001, + 0.52359877559829882 }, + { 0.68810051897078461, 0.0000000000000000, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85432615661706823, 0.0000000000000000, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0179006647340796, 0.0000000000000000, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1792120640746322, 0.0000000000000000, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3388834245070498, 0.0000000000000000, 0.10000000000000001, + 1.3962634015954636 }, + { 1.4976955329233277, 0.0000000000000000, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.10000000000000001. +template <typename Tp> +void test092() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data092) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data092[i].k), Tp(data092[i].nu), + Tp(data092[i].phi)); + const Tp f0 = data092[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.20000000000000001. +testcase_ellint_3<double> data093[] = { + { -0.0000000000000000, 0.0000000000000000, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17418191132226077, 0.0000000000000000, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34633712256943405, 0.0000000000000000, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51480684302043711, 0.0000000000000000, 0.20000000000000001, + 0.52359877559829882 }, + { 0.67855102942481949, 0.0000000000000000, 0.20000000000000001, + 0.69813170079773179 }, + { 0.83723056090326253, 0.0000000000000000, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99114645269578183, 0.0000000000000000, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1411014627915537, 0.0000000000000000, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2882448138013969, 0.0000000000000000, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4339343023863691, 0.0000000000000000, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.20000000000000001. +template <typename Tp> +void test093() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data093) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data093[i].k), Tp(data093[i].nu), + Tp(data093[i].phi)); + const Tp f0 = data093[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.29999999999999999. +testcase_ellint_3<double> data094[] = { + { -0.0000000000000000, 0.0000000000000000, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17400735186871727, 0.0000000000000000, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34500091027020219, 0.0000000000000000, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51060069523901541, 0.0000000000000000, 0.29999999999999999, + 0.52359877559829882 }, + { 0.66944393961375459, 0.0000000000000000, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82123776744538157, 0.0000000000000000, 0.29999999999999999, + 0.87266462599716477 }, + { 0.96657579245516523, 0.0000000000000000, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1066703663542414, 0.0000000000000000, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2431094251944901, 0.0000000000000000, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3776795151134889, 0.0000000000000000, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.29999999999999999. +template <typename Tp> +void test094() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data094) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data094[i].k), Tp(data094[i].nu), + Tp(data094[i].phi)); + const Tp f0 = data094[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.40000000000000002. +testcase_ellint_3<double> data095[] = { + { -0.0000000000000000, 0.0000000000000000, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17383341868035865, 0.0000000000000000, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34368286022299821, 0.0000000000000000, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50651268947499406, 0.0000000000000000, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66074441806097550, 0.0000000000000000, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80622931670113485, 0.0000000000000000, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94389791565435233, 0.0000000000000000, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0753503387899728, 0.0000000000000000, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2025374759127518, 0.0000000000000000, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3275651989026322, 0.0000000000000000, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.40000000000000002. +template <typename Tp> +void test095() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data095) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data095[i].k), Tp(data095[i].nu), + Tp(data095[i].phi)); + const Tp f0 = data095[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.50000000000000000. +testcase_ellint_3<double> data096[] = { + { -0.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17366010776037047, 0.0000000000000000, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34238253799539309, 0.0000000000000000, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50253707775976408, 0.0000000000000000, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65242145347295766, 0.0000000000000000, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79210420018698058, 0.0000000000000000, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92287437995632193, 0.0000000000000000, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0466900550798661, 0.0000000000000000, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1658007366618623, 0.0000000000000000, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2825498301618641, 0.0000000000000000, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.50000000000000000. +template <typename Tp> +void test096() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data096) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data096[i].k), Tp(data096[i].nu), + Tp(data096[i].phi)); + const Tp f0 = data096[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.59999999999999998. +testcase_ellint_3<double> data097[] = { + { -0.0000000000000000, 0.0000000000000000, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17348741514884702, 0.0000000000000000, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34109952405241289, 0.0000000000000000, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49866850781226296, 0.0000000000000000, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64444732407062510, 0.0000000000000000, 0.59999999999999998, + 0.69813170079773179 }, + { 0.77877564686544720, 0.0000000000000000, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90330743691883497, 0.0000000000000000, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0203257987604104, 0.0000000000000000, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1323247918768631, 0.0000000000000000, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2418235332245127, 0.0000000000000000, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.59999999999999998. +template <typename Tp> +void test097() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data097) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data097[i].k), Tp(data097[i].nu), + Tp(data097[i].phi)); + const Tp f0 = data097[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.69999999999999996. +testcase_ellint_3<double> data098[] = { + { -0.0000000000000000, 0.0000000000000000, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17331533692234477, 0.0000000000000000, 0.69999999999999996, + 0.17453292519943295 }, + { 0.33983341309265941, 0.0000000000000000, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49490198805931990, 0.0000000000000000, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63679715525145308, 0.0000000000000000, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76616861049481944, 0.0000000000000000, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88503143209004220, 0.0000000000000000, 0.69999999999999996, + 1.0471975511965976 }, + { 0.99596060249112173, 0.0000000000000000, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1016495050260424, 0.0000000000000000, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2047457872617382, 0.0000000000000000, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.69999999999999996. +template <typename Tp> +void test098() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data098) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data098[i].k), Tp(data098[i].nu), + Tp(data098[i].phi)); + const Tp f0 = data098[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.80000000000000004. +testcase_ellint_3<double> data099[] = { + { -0.0000000000000000, 0.0000000000000000, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17314386919344213, 0.0000000000000000, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33858381342073240, 0.0000000000000000, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49123285640844738, 0.0000000000000000, 0.80000000000000004, + 0.52359877559829882 }, + { 0.62944854858904520, 0.0000000000000000, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75421778305499343, 0.0000000000000000, 0.80000000000000004, + 0.87266462599716477 }, + { 0.86790634112156639, 0.0000000000000000, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97334918087427558, 0.0000000000000000, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0734012615283985, 0.0000000000000000, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1708024551734544, 0.0000000000000000, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.80000000000000004. +template <typename Tp> +void test099() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data099) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data099[i].k), Tp(data099[i].nu), + Tp(data099[i].phi)); + const Tp f0 = data099[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.0000000000000000, nu=0.90000000000000002. +testcase_ellint_3<double> data100[] = { + { -0.0000000000000000, 0.0000000000000000, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17297300811030600, 0.0000000000000000, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33735034635360817, 0.0000000000000000, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48765675230233141, 0.0000000000000000, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62238126886123568, 0.0000000000000000, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74286600807269243, 0.0000000000000000, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85181283909264971, 0.0000000000000000, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95228683995371122, 0.0000000000000000, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0472730487412552, 0.0000000000000000, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1395754288497419, 0.0000000000000000, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.90000000000000002. +template <typename Tp> +void test100() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data100) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data100[i].k), Tp(data100[i].nu), + Tp(data100[i].phi)); + const Tp f0 = data100[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.0000000000000000. +testcase_ellint_3<double> data101[] = { + { -0.0000000000000000, 0.10000000000000009, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17454173353063665, 0.10000000000000009, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34913506721468085, 0.10000000000000009, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52382550016538953, 0.10000000000000009, 0.0000000000000000, + 0.52359877559829882 }, + { 0.69864700854177031, 0.10000000000000009, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87361792586964870, 0.10000000000000009, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0487386319621685, 0.10000000000000009, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2239913752078757, 0.10000000000000009, 0.0000000000000000, + 1.2217304763960306 }, + { 1.3993423113684049, 0.10000000000000009, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5747455615173562, 0.10000000000000009, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.0000000000000000. +template <typename Tp> +void test101() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data101) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data101[i].k), Tp(data101[i].nu), + Tp(data101[i].phi)); + const Tp f0 = data101[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.10000000000000001. +testcase_ellint_3<double> data102[] = { + { -0.0000000000000000, 0.10000000000000009, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17436589347616618, 0.10000000000000009, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34776067871237354, 0.10000000000000009, 0.10000000000000001, + 0.34906585039886590 }, + { 0.51936064354727807, 0.10000000000000009, 0.10000000000000001, + 0.52359877559829882 }, + { 0.68860303749364360, 0.10000000000000009, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85524561882332051, 0.10000000000000009, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0193708301908337, 0.10000000000000009, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1813474067123044, 0.10000000000000009, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3417670770424983, 0.10000000000000009, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5013711111199950, 0.10000000000000009, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.10000000000000001. +template <typename Tp> +void test102() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data102) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data102[i].k), Tp(data102[i].nu), + Tp(data102[i].phi)); + const Tp f0 = data102[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.20000000000000001. +testcase_ellint_3<double> data103[] = { + { -0.0000000000000000, 0.10000000000000009, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17419068786141345, 0.10000000000000009, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34640537686230127, 0.10000000000000009, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51502689171753957, 0.10000000000000009, 0.20000000000000001, + 0.52359877559829882 }, + { 0.67904147863672726, 0.10000000000000009, 0.20000000000000001, + 0.69813170079773179 }, + { 0.83811885126105179, 0.10000000000000009, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99255278555742810, 0.10000000000000009, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1431260546194930, 0.10000000000000009, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2909589656532101, 0.10000000000000009, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4373749386463430, 0.10000000000000009, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.20000000000000001. +template <typename Tp> +void test103() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data103) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data103[i].k), Tp(data103[i].nu), + Tp(data103[i].phi)); + const Tp f0 = data103[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.29999999999999999. +testcase_ellint_3<double> data104[] = { + { -0.0000000000000000, 0.10000000000000009, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17401611261390110, 0.10000000000000009, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34506869507511767, 0.10000000000000009, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51081757604259870, 0.10000000000000009, 0.29999999999999999, + 0.52359877559829882 }, + { 0.66992297597712303, 0.10000000000000009, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82209722856174228, 0.10000000000000009, 0.29999999999999999, + 0.87266462599716477 }, + { 0.96792430487669612, 0.10000000000000009, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1085964108954092, 0.10000000000000009, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2456748370836999, 0.10000000000000009, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3809159606704959, 0.10000000000000009, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.29999999999999999. +template <typename Tp> +void test104() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data104) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data104[i].k), Tp(data104[i].nu), + Tp(data104[i].phi)); + const Tp f0 = data104[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.40000000000000002. +testcase_ellint_3<double> data105[] = { + { -0.0000000000000000, 0.10000000000000009, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17384216369897937, 0.10000000000000009, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34375018311376782, 0.10000000000000009, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50672650758380455, 0.10000000000000009, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66121264213337616, 0.10000000000000009, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80706202005774441, 0.10000000000000009, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94519376138245892, 0.10000000000000009, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0771880300759584, 0.10000000000000009, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2049711557188272, 0.10000000000000009, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3306223265207477, 0.10000000000000009, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.40000000000000002. +template <typename Tp> +void test105() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data105) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data105[i].k), Tp(data105[i].nu), + Tp(data105[i].phi)); + const Tp f0 = data105[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.50000000000000000. +testcase_ellint_3<double> data106[] = { + { -0.0000000000000000, 0.10000000000000009, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17366883711936554, 0.10000000000000009, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34244940634881876, 0.10000000000000009, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50274793281634378, 0.10000000000000009, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65287941633275093, 0.10000000000000009, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79291198790315398, 0.10000000000000009, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92412201537880345, 0.10000000000000009, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0484480076799370, 0.10000000000000009, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1681168130475206, 0.10000000000000009, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2854480708580160, 0.10000000000000009, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.50000000000000000. +template <typename Tp> +void test106() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data106) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data106[i].k), Tp(data106[i].nu), + Tp(data106[i].phi)); + const Tp f0 = data106[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.59999999999999998. +testcase_ellint_3<double> data107[] = { + { -0.0000000000000000, 0.10000000000000009, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17349612891469018, 0.10000000000000009, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34116594505539438, 0.10000000000000009, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49887649430466685, 0.10000000000000009, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64489553282165157, 0.10000000000000009, 0.59999999999999998, + 0.69813170079773179 }, + { 0.77956016553782437, 0.10000000000000009, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90451074530096309, 0.10000000000000009, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0220113666961632, 0.10000000000000009, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1345351441065563, 0.10000000000000009, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2445798942989255, 0.10000000000000009, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.59999999999999998. +template <typename Tp> +void test107() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data107) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data107[i].k), Tp(data107[i].nu), + Tp(data107[i].phi)); + const Tp f0 = data107[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.69999999999999996. +testcase_ellint_3<double> data108[] = { + { -0.0000000000000000, 0.10000000000000009, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17332403516105052, 0.10000000000000009, 0.69999999999999996, + 0.17453292519943295 }, + { 0.33989939374896877, 0.10000000000000009, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49510719568614081, 0.10000000000000009, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63723607776354974, 0.10000000000000009, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76693133887935327, 0.10000000000000009, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88619382078823827, 0.10000000000000009, 0.69999999999999996, + 1.0471975511965976 }, + { 0.99758012018676490, 0.10000000000000009, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1037642270814410, 0.10000000000000009, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2073745911083187, 0.10000000000000009, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.69999999999999996. +template <typename Tp> +void test108() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data108) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data108[i].k), Tp(data108[i].nu), + Tp(data108[i].phi)); + const Tp f0 = data108[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.80000000000000004. +testcase_ellint_3<double> data109[] = { + { -0.0000000000000000, 0.10000000000000009, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17315255197057020, 0.10000000000000009, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33864936055747985, 0.10000000000000009, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49143537041117619, 0.10000000000000009, 0.80000000000000004, + 0.52359877559829882 }, + { 0.62987861760047492, 0.10000000000000009, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75496005490917517, 0.10000000000000009, 0.80000000000000004, + 0.87266462599716477 }, + { 0.86903081862701903, 0.10000000000000009, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97490814820725591, 0.10000000000000009, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0754290107171083, 0.10000000000000009, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1733158866987732, 0.10000000000000009, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.80000000000000004. +template <typename Tp> +void test109() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data109) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data109[i].k), Tp(data109[i].nu), + Tp(data109[i].phi)); + const Tp f0 = data109[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.10000000000000009, nu=0.90000000000000002. +testcase_ellint_3<double> data110[] = { + { -0.0000000000000000, 0.10000000000000009, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17298167549096569, 0.10000000000000009, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33741546662741584, 0.10000000000000009, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48785665376856879, 0.10000000000000009, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62280288554518959, 0.10000000000000009, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74358903115455199, 0.10000000000000009, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85290207679298358, 0.10000000000000009, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95379006645397379, 0.10000000000000009, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0492213119872327, 0.10000000000000009, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1419839485283374, 0.10000000000000009, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.90000000000000002. +template <typename Tp> +void test110() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data110) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data110[i].k), Tp(data110[i].nu), + Tp(data110[i].phi)); + const Tp f0 = data110[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.0000000000000000. +testcase_ellint_3<double> data111[] = { + { -0.0000000000000000, 0.19999999999999996, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17456817290292811, 0.19999999999999996, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34934315932086801, 0.19999999999999996, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52450880529443988, 0.19999999999999996, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70020491009844910, 0.19999999999999996, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87651006649967955, 0.19999999999999996, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0534305870298994, 0.19999999999999996, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2308975521670784, 0.19999999999999996, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4087733584990738, 0.19999999999999996, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5868678474541664, 0.19999999999999996, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.0000000000000000. +template <typename Tp> +void test111() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data111) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data111[i].k), Tp(data111[i].nu), + Tp(data111[i].phi)); + const Tp f0 = data111[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.10000000000000001. +testcase_ellint_3<double> data112[] = { + { -0.0000000000000000, 0.19999999999999996, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17439228502691750, 0.19999999999999996, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34796731137565740, 0.19999999999999996, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52003370294544848, 0.19999999999999996, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69012222258631495, 0.19999999999999996, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85803491465566772, 0.19999999999999996, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0238463961099364, 0.19999999999999996, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1878691059202153, 0.19999999999999996, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3505985031831940, 0.19999999999999996, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5126513474261092, 0.19999999999999996, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.10000000000000001. +template <typename Tp> +void test112() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data112) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data112[i].k), Tp(data112[i].nu), + Tp(data112[i].phi)); + const Tp f0 = data112[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.20000000000000001. +testcase_ellint_3<double> data113[] = { + { -0.0000000000000000, 0.19999999999999996, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17421703179583750, 0.19999999999999996, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34661057411998791, 0.19999999999999996, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51569006052647393, 0.19999999999999996, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68052412821107278, 0.19999999999999996, 0.20000000000000001, + 0.69813170079773179 }, + { 0.84081341263313825, 0.19999999999999996, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99683359988842890, 0.19999999999999996, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1493086715118852, 0.19999999999999996, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2992699693957541, 0.19999999999999996, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4479323932249568, 0.19999999999999996, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.20000000000000001. +template <typename Tp> +void test113() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data113) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data113[i].k), Tp(data113[i].nu), + Tp(data113[i].phi)); + const Tp f0 = data113[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.29999999999999999. +testcase_ellint_3<double> data114[] = { + { -0.0000000000000000, 0.19999999999999996, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17404240913577707, 0.19999999999999996, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34527248032587193, 0.19999999999999996, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51147118981668416, 0.19999999999999996, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67137107867777635, 0.19999999999999996, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82470418188668893, 0.19999999999999996, 0.29999999999999999, + 0.87266462599716477 }, + { 0.97202873223594299, 0.19999999999999996, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1144773569375266, 0.19999999999999996, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2535292433701000, 0.19999999999999996, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3908453514752481, 0.19999999999999996, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.29999999999999999. +template <typename Tp> +void test114() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data114) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data114[i].k), Tp(data114[i].nu), + Tp(data114[i].phi)); + const Tp f0 = data114[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.40000000000000002. +testcase_ellint_3<double> data115[] = { + { -0.0000000000000000, 0.19999999999999996, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17386841301066677, 0.19999999999999996, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34395257914113253, 0.19999999999999996, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50737088376869466, 0.19999999999999996, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66262801717277664, 0.19999999999999996, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80958766645079094, 0.19999999999999996, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94913754236162040, 0.19999999999999996, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0827985514223000, 0.19999999999999996, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2124212429050478, 0.19999999999999996, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3400002519661010, 0.19999999999999996, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.40000000000000002. +template <typename Tp> +void test115() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data115) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data115[i].k), Tp(data115[i].nu), + Tp(data115[i].phi)); + const Tp f0 = data115[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.50000000000000000. +testcase_ellint_3<double> data116[] = { + { -0.0000000000000000, 0.19999999999999996, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17369503942181802, 0.19999999999999996, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34265043534362660, 0.19999999999999996, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50338337208655415, 0.19999999999999996, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65426373297163642, 0.19999999999999996, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79536193036145808, 0.19999999999999996, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92791875910061605, 0.19999999999999996, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0538145052725829, 0.19999999999999996, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1752060022875899, 0.19999999999999996, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2943374404397376, 0.19999999999999996, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.50000000000000000. +template <typename Tp> +void test116() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data116) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data116[i].k), Tp(data116[i].nu), + Tp(data116[i].phi)); + const Tp f0 = data116[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.59999999999999998. +testcase_ellint_3<double> data117[] = { + { -0.0000000000000000, 0.19999999999999996, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17352228440746928, 0.19999999999999996, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34136562863713626, 0.19999999999999996, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49950328177638481, 0.19999999999999996, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64625032705690832, 0.19999999999999996, 0.59999999999999998, + 0.69813170079773179 }, + { 0.78193941198403094, 0.19999999999999996, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90817230934317128, 0.19999999999999996, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0271563751276462, 0.19999999999999996, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1412999379040518, 0.19999999999999996, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2530330675914561, 0.19999999999999996, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.59999999999999998. +template <typename Tp> +void test117() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data117) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data117[i].k), Tp(data117[i].nu), + Tp(data117[i].phi)); + const Tp f0 = data117[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.69999999999999996. +testcase_ellint_3<double> data118[] = { + { -0.0000000000000000, 0.19999999999999996, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17335014404233898, 0.19999999999999996, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34009775298617811, 0.19999999999999996, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49572560201923810, 0.19999999999999996, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63856276669886525, 0.19999999999999996, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76924438644867565, 0.19999999999999996, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88973060843856466, 0.19999999999999996, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0025230471636377, 0.19999999999999996, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1102356376093103, 0.19999999999999996, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2154356555075867, 0.19999999999999996, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.69999999999999996. +template <typename Tp> +void test118() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data118) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data118[i].k), Tp(data118[i].nu), + Tp(data118[i].phi)); + const Tp f0 = data118[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.80000000000000004. +testcase_ellint_3<double> data119[] = { + { -0.0000000000000000, 0.19999999999999996, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17317861443718541, 0.19999999999999996, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33884641598718701, 0.19999999999999996, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49204565281259494, 0.19999999999999996, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63117851188220353, 0.19999999999999996, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75721095949544170, 0.19999999999999996, 0.80000000000000004, + 0.87266462599716477 }, + { 0.87245201443919118, 0.19999999999999996, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97966584238831089, 0.19999999999999996, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0816336325174360, 0.19999999999999996, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1810223448909913, 0.19999999999999996, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.80000000000000004. +template <typename Tp> +void test119() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data119) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data119[i].k), Tp(data119[i].nu), + Tp(data119[i].phi)); + const Tp f0 = data119[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.19999999999999996, nu=0.90000000000000002. +testcase_ellint_3<double> data120[] = { + { -0.0000000000000000, 0.19999999999999996, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17300769173837280, 0.19999999999999996, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33761123827372508, 0.19999999999999996, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48845905690769426, 0.19999999999999996, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62407720017324986, 0.19999999999999996, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74578146525124289, 0.19999999999999996, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85621583540073076, 0.19999999999999996, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95837725988001199, 0.19999999999999996, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0551821412633928, 0.19999999999999996, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1493679916141863, 0.19999999999999996, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.90000000000000002. +template <typename Tp> +void test120() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data120) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data120[i].k), Tp(data120[i].nu), + Tp(data120[i].phi)); + const Tp f0 = data120[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.0000000000000000. +testcase_ellint_3<double> data121[] = { + { -0.0000000000000000, 0.30000000000000004, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17461228653000102, 0.30000000000000004, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34969146102798415, 0.30000000000000004, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52565822873726320, 0.30000000000000004, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70284226512408532, 0.30000000000000004, 0.0000000000000000, + 0.69813170079773179 }, + { 0.88144139195111182, 0.30000000000000004, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0614897067260523, 0.30000000000000004, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2428416824174218, 0.30000000000000004, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4251795877015925, 0.30000000000000004, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6080486199305126, 0.30000000000000004, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.0000000000000000. +template <typename Tp> +void test121() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data121) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data121[i].k), Tp(data121[i].nu), + Tp(data121[i].phi)); + const Tp f0 = data121[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.10000000000000001. +testcase_ellint_3<double> data122[] = { + { -0.0000000000000000, 0.30000000000000004, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17443631884814378, 0.30000000000000004, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34831316835124926, 0.30000000000000004, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52116586276523857, 0.30000000000000004, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69269385837910036, 0.30000000000000004, 0.10000000000000001, + 0.69813170079773179 }, + { 0.86279023163070856, 0.30000000000000004, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0315321461438265, 0.30000000000000004, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1991449111869024, 0.30000000000000004, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3659561780923211, 0.30000000000000004, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5323534693557526, 0.30000000000000004, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.10000000000000001. +template <typename Tp> +void test122() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data122) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data122[i].k), Tp(data122[i].nu), + Tp(data122[i].phi)); + const Tp f0 = data122[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.20000000000000001. +testcase_ellint_3<double> data123[] = { + { -0.0000000000000000, 0.30000000000000004, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17426098615372090, 0.30000000000000004, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34695402664689923, 0.30000000000000004, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51680555567038933, 0.30000000000000004, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68303375225260210, 0.30000000000000004, 0.20000000000000001, + 0.69813170079773179 }, + { 0.84540662891295026, 0.30000000000000004, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0041834051646927, 0.30000000000000004, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1599952702345711, 0.30000000000000004, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3137179520499163, 0.30000000000000004, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4663658145259875, 0.30000000000000004, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.20000000000000001. +template <typename Tp> +void test123() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data123) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data123[i].k), Tp(data123[i].nu), + Tp(data123[i].phi)); + const Tp f0 = data123[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.29999999999999999. +testcase_ellint_3<double> data124[] = { + { -0.0000000000000000, 0.30000000000000004, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17408628437042845, 0.30000000000000004, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34561356761638401, 0.30000000000000004, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51257058617875850, 0.30000000000000004, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67382207124602866, 0.30000000000000004, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82914751587825131, 0.30000000000000004, 0.29999999999999999, + 0.87266462599716477 }, + { 0.97907434814374950, 0.30000000000000004, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1246399297351584, 0.30000000000000004, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2671793970398146, 0.30000000000000004, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4081767433479089, 0.30000000000000004, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.29999999999999999. +template <typename Tp> +void test124() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data124) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data124[i].k), Tp(data124[i].nu), + Tp(data124[i].phi)); + const Tp f0 = data124[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.40000000000000002. +testcase_ellint_3<double> data125[] = { + { -0.0000000000000000, 0.30000000000000004, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17391220945982730, 0.30000000000000004, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34429133937639689, 0.30000000000000004, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50845471668581632, 0.30000000000000004, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66502347027873854, 0.30000000000000004, 0.40000000000000002, + 0.69813170079773179 }, + { 0.81389191978012254, 0.30000000000000004, 0.40000000000000002, + 0.87266462599716477 }, + { 0.95590618002140593, 0.30000000000000004, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0924915195213121, 0.30000000000000004, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2253651604038058, 0.30000000000000004, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3563643538969761, 0.30000000000000004, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.40000000000000002. +template <typename Tp> +void test125() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data125) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data125[i].k), Tp(data125[i].nu), + Tp(data125[i].phi)); + const Tp f0 = data125[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.50000000000000000. +testcase_ellint_3<double> data126[] = { + { -0.0000000000000000, 0.30000000000000004, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17373875742088235, 0.30000000000000004, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34298690571124157, 0.30000000000000004, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50445214859646936, 0.30000000000000004, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65660648352418516, 0.30000000000000004, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79953670639287289, 0.30000000000000004, 0.50000000000000000, + 0.87266462599716477 }, + { 0.93443393926588558, 0.30000000000000004, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0630838369016911, 0.30000000000000004, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1875197325653026, 0.30000000000000004, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3098448759814960, 0.30000000000000004, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.50000000000000000. +template <typename Tp> +void test126() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data126) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data126[i].k), Tp(data126[i].nu), + Tp(data126[i].phi)); + const Tp f0 = data126[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.59999999999999998. +testcase_ellint_3<double> data127[] = { + { -0.0000000000000000, 0.30000000000000004, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17356592428950826, 0.30000000000000004, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34169984536697379, 0.30000000000000004, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50055748266498457, 0.30000000000000004, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64854298527106768, 0.30000000000000004, 0.59999999999999998, + 0.69813170079773179 }, + { 0.78599329284207431, 0.30000000000000004, 0.59999999999999998, + 0.87266462599716477 }, + { 0.91445452089128221, 0.30000000000000004, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0360412952290587, 0.30000000000000004, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1530473919778639, 0.30000000000000004, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2677758800420666, 0.30000000000000004, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.59999999999999998. +template <typename Tp> +void test127() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data127) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data127[i].k), Tp(data127[i].nu), + Tp(data127[i].phi)); + const Tp f0 = data127[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.69999999999999996. +testcase_ellint_3<double> data128[] = { + { -0.0000000000000000, 0.30000000000000004, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17339370613812227, 0.30000000000000004, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34042975138455933, 0.30000000000000004, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49676568368075985, 0.30000000000000004, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64080774055753720, 0.30000000000000004, 0.69999999999999996, + 0.69813170079773179 }, + { 0.77318507779667278, 0.30000000000000004, 0.69999999999999996, + 0.87266462599716477 }, + { 0.89579782346548631, 0.30000000000000004, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0110573286052202, 0.30000000000000004, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1214710972949633, 0.30000000000000004, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2294913236274980, 0.30000000000000004, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.69999999999999996. +template <typename Tp> +void test128() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data128) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data128[i].k), Tp(data128[i].nu), + Tp(data128[i].phi)); + const Tp f0 = data128[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.80000000000000004. +testcase_ellint_3<double> data129[] = { + { -0.0000000000000000, 0.30000000000000004, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17322209907520361, 0.30000000000000004, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33917623046949996, 0.30000000000000004, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49307204894329176, 0.30000000000000004, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63337802830291723, 0.30000000000000004, 0.80000000000000004, + 0.69813170079773179 }, + { 0.76104540997689407, 0.30000000000000004, 0.80000000000000004, + 0.87266462599716477 }, + { 0.87832009635450736, 0.30000000000000004, 0.80000000000000004, + 1.0471975511965976 }, + { 0.98787879723171790, 0.30000000000000004, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0924036340069336, 0.30000000000000004, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1944567571590046, 0.30000000000000004, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.80000000000000004. +template <typename Tp> +void test129() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data129) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data129[i].k), Tp(data129[i].nu), + Tp(data129[i].phi)); + const Tp f0 = data129[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.30000000000000004, nu=0.90000000000000002. +testcase_ellint_3<double> data130[] = { + { -0.0000000000000000, 0.30000000000000004, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17305109924485948, 0.30000000000000004, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33793890239556984, 0.30000000000000004, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48947218005089738, 0.30000000000000004, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62623332340775151, 0.30000000000000004, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74951596581511148, 0.30000000000000004, 0.90000000000000002, + 0.87266462599716477 }, + { 0.86189886597756005, 0.30000000000000004, 0.90000000000000002, + 1.0471975511965976 }, + { 0.96629451153092005, 0.30000000000000004, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0655269133492680, 0.30000000000000004, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1622376896064912, 0.30000000000000004, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.90000000000000002. +template <typename Tp> +void test130() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data130) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data130[i].k), Tp(data130[i].nu), + Tp(data130[i].phi)); + const Tp f0 = data130[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.0000000000000000. +testcase_ellint_3<double> data131[] = { + { -0.0000000000000000, 0.39999999999999991, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17467414669441531, 0.39999999999999991, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35018222772483443, 0.39999999999999991, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52729015917508748, 0.39999999999999991, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70662374407341255, 0.39999999999999991, 0.0000000000000000, + 0.69813170079773179 }, + { 0.88859210497602170, 0.39999999999999991, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0733136290471379, 0.39999999999999991, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2605612170157061, 0.39999999999999991, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4497513956433437, 0.39999999999999991, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6399998658645112, 0.39999999999999991, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.0000000000000000. +template <typename Tp> +void test131() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data131) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data131[i].k), Tp(data131[i].nu), + Tp(data131[i].phi)); + const Tp f0 = data131[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.10000000000000001. +testcase_ellint_3<double> data132[] = { + { -0.0000000000000000, 0.39999999999999991, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17449806706684673, 0.39999999999999991, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34880048623856075, 0.39999999999999991, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52277322065757403, 0.39999999999999991, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69638072056918376, 0.39999999999999991, 0.10000000000000001, + 0.69813170079773179 }, + { 0.86968426619831540, 0.39999999999999991, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0428044206578095, 0.39999999999999991, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2158651158274378, 0.39999999999999991, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3889447129893322, 0.39999999999999991, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5620566886683604, 0.39999999999999991, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.10000000000000001. +template <typename Tp> +void test132() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data132) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data132[i].k), Tp(data132[i].nu), + Tp(data132[i].phi)); + const Tp f0 = data132[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.20000000000000001. +testcase_ellint_3<double> data133[] = { + { -0.0000000000000000, 0.39999999999999991, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17432262290723399, 0.39999999999999991, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34743795258968596, 0.39999999999999991, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51838919472805123, 0.39999999999999991, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68663134739057918, 0.39999999999999991, 0.20000000000000001, + 0.69813170079773179 }, + { 0.85206432981833979, 0.39999999999999991, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0149595349004430, 0.39999999999999991, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1758349405464676, 0.39999999999999991, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3353337673882635, 0.39999999999999991, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4941414344266770, 0.39999999999999991, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.20000000000000001. +template <typename Tp> +void test133() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data133) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data133[i].k), Tp(data133[i].nu), + Tp(data133[i].phi)); + const Tp f0 = data133[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.29999999999999999. +testcase_ellint_3<double> data134[] = { + { -0.0000000000000000, 0.39999999999999991, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17414781013591543, 0.39999999999999991, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34609415696777285, 0.39999999999999991, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51413131295862546, 0.39999999999999991, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67733527622935630, 0.39999999999999991, 0.29999999999999999, + 0.69813170079773179 }, + { 0.83558675182733266, 0.39999999999999991, 0.29999999999999999, + 0.87266462599716477 }, + { 0.98940140808865906, 0.39999999999999991, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1396968797728058, 0.39999999999999991, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2875920037865087, 0.39999999999999991, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4342789859950078, 0.39999999999999991, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.29999999999999999. +template <typename Tp> +void test134() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data134) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data134[i].k), Tp(data134[i].nu), + Tp(data134[i].phi)); + const Tp f0 = data134[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.40000000000000002. +testcase_ellint_3<double> data135[] = { + { -0.0000000000000000, 0.39999999999999991, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17397362471112710, 0.39999999999999991, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34476864603333196, 0.39999999999999991, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50999329415379357, 0.39999999999999991, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66845674551396017, 0.39999999999999991, 0.40000000000000002, + 0.69813170079773179 }, + { 0.82012848346231748, 0.39999999999999991, 0.40000000000000002, + 0.87266462599716477 }, + { 0.96582449258349057, 0.39999999999999991, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1068473749476286, 0.39999999999999991, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2447132729159986, 0.39999999999999991, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3809986210732901, 0.39999999999999991, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.40000000000000002. +template <typename Tp> +void test135() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data135) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data135[i].k), Tp(data135[i].nu), + Tp(data135[i].phi)); + const Tp f0 = data135[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.50000000000000000. +testcase_ellint_3<double> data136[] = { + { -0.0000000000000000, 0.39999999999999991, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17380006262854139, 0.39999999999999991, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34346098216756610, 0.39999999999999991, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50596929935059420, 0.39999999999999991, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65996392089131262, 0.39999999999999991, 0.50000000000000000, + 0.69813170079773179 }, + { 0.80558463511364786, 0.39999999999999991, 0.50000000000000000, + 0.87266462599716477 }, + { 0.94397834522857704, 0.39999999999999991, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0768075114108115, 0.39999999999999991, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2059184624251329, 0.39999999999999991, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3331797176377398, 0.39999999999999991, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.50000000000000000. +template <typename Tp> +void test136() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data136) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data136[i].k), Tp(data136[i].nu), + Tp(data136[i].phi)); + const Tp f0 = data136[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.59999999999999998. +testcase_ellint_3<double> data137[] = { + { -0.0000000000000000, 0.39999999999999991, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17362711992081248, 0.39999999999999991, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34217074276403953, 0.39999999999999991, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50205389185761617, 0.39999999999999991, 0.59999999999999998, + 0.52359877559829882 }, + { 0.65182834920372745, 0.39999999999999991, 0.59999999999999998, + 0.69813170079773179 }, + { 0.79186512820565136, 0.39999999999999991, 0.59999999999999998, + 0.87266462599716477 }, + { 0.92365535916287134, 0.39999999999999991, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0491915663957907, 0.39999999999999991, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1705934291745104, 0.39999999999999991, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2899514672527024, 0.39999999999999991, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.59999999999999998. +template <typename Tp> +void test137() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data137) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data137[i].k), Tp(data137[i].nu), + Tp(data137[i].phi)); + const Tp f0 = data137[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.69999999999999996. +testcase_ellint_3<double> data138[] = { + { -0.0000000000000000, 0.39999999999999991, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17345479265712871, 0.39999999999999991, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34089751955950354, 0.39999999999999991, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49824200167361343, 0.39999999999999991, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64402450341199413, 0.39999999999999991, 0.69999999999999996, + 0.69813170079773179 }, + { 0.77889207804122873, 0.39999999999999991, 0.69999999999999996, + 0.87266462599716477 }, + { 0.90468169720957992, 0.39999999999999991, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0236847823692916, 0.39999999999999991, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1382465247425164, 0.39999999999999991, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2506255923253344, 0.39999999999999991, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.69999999999999996. +template <typename Tp> +void test138() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data138) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data138[i].k), Tp(data138[i].nu), + Tp(data138[i].phi)); + const Tp f0 = data138[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.80000000000000004. +testcase_ellint_3<double> data139[] = { + { -0.0000000000000000, 0.39999999999999991, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17328307694277156, 0.39999999999999991, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33964091800132007, 0.39999999999999991, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49452889372467451, 0.39999999999999991, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63652940095937327, 0.39999999999999991, 0.80000000000000004, + 0.69813170079773179 }, + { 0.76659772511159097, 0.39999999999999991, 0.80000000000000004, + 0.87266462599716477 }, + { 0.88691047977338111, 0.39999999999999991, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0000273200611640, 0.39999999999999991, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1084787902188007, 0.39999999999999991, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2146499565727209, 0.39999999999999991, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.80000000000000004. +template <typename Tp> +void test139() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data139) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data139[i].k), Tp(data139[i].nu), + Tp(data139[i].phi)); + const Tp f0 = data139[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.39999999999999991, nu=0.90000000000000002. +testcase_ellint_3<double> data140[] = { + { -0.0000000000000000, 0.39999999999999991, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17311196891868130, 0.39999999999999991, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33840055664911906, 0.39999999999999991, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49091013944075340, 0.39999999999999991, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62932228186809591, 0.39999999999999991, 0.90000000000000002, + 0.69813170079773179 }, + { 0.75492278323019801, 0.39999999999999991, 0.90000000000000002, + 0.87266462599716477 }, + { 0.87021659043854294, 0.39999999999999991, 0.90000000000000002, + 1.0471975511965976 }, + { 0.97800245228239246, 0.39999999999999991, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0809625773173694, 0.39999999999999991, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1815758115929846, 0.39999999999999991, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.90000000000000002. +template <typename Tp> +void test140() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data140) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data140[i].k), Tp(data140[i].nu), + Tp(data140[i].phi)); + const Tp f0 = data140[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.0000000000000000. +testcase_ellint_3<double> data141[] = { + { -0.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17475385514035785, 0.50000000000000000, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35081868470101585, 0.50000000000000000, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52942862705190585, 0.50000000000000000, 0.0000000000000000, + 0.52359877559829882 }, + { 0.71164727562630326, 0.50000000000000000, 0.0000000000000000, + 0.69813170079773179 }, + { 0.89824523594227768, 0.50000000000000000, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0895506700518851, 0.50000000000000000, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2853005857432933, 0.50000000000000000, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4845545520549484, 0.50000000000000000, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6857503548125963, 0.50000000000000000, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.0000000000000000. +template <typename Tp> +void test141() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data141) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data141[i].k), Tp(data141[i].nu), + Tp(data141[i].phi)); + const Tp f0 = data141[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.10000000000000001. +testcase_ellint_3<double> data142[] = { + { -0.0000000000000000, 0.50000000000000000, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17457763120814676, 0.50000000000000000, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34943246340849154, 0.50000000000000000, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52487937869610801, 0.50000000000000000, 0.10000000000000001, + 0.52359877559829882 }, + { 0.70127785096388395, 0.50000000000000000, 0.10000000000000001, + 0.69813170079773179 }, + { 0.87898815988624479, 0.50000000000000000, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0582764576094172, 0.50000000000000000, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2391936844060207, 0.50000000000000000, 0.10000000000000001, + 1.2217304763960306 }, + { 1.4214793542995841, 0.50000000000000000, 0.10000000000000001, + 1.3962634015954636 }, + { 1.6045524936084892, 0.50000000000000000, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.10000000000000001. +template <typename Tp> +void test142() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data142) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data142[i].k), Tp(data142[i].nu), + Tp(data142[i].phi)); + const Tp f0 = data142[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.20000000000000001. +testcase_ellint_3<double> data143[] = { + { -0.0000000000000000, 0.50000000000000000, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17440204336345433, 0.50000000000000000, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34806552388338824, 0.50000000000000000, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52046416757129821, 0.50000000000000000, 0.20000000000000001, + 0.52359877559829882 }, + { 0.69140924550993876, 0.50000000000000000, 0.20000000000000001, + 0.69813170079773179 }, + { 0.86104678636125520, 0.50000000000000000, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0297439459053981, 0.50000000000000000, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1979214112912036, 0.50000000000000000, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3659033858648930, 0.50000000000000000, 0.20000000000000001, + 1.3962634015954636 }, + { 1.5338490483665983, 0.50000000000000000, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.20000000000000001. +template <typename Tp> +void test143() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data143) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data143[i].k), Tp(data143[i].nu), + Tp(data143[i].phi)); + const Tp f0 = data143[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.29999999999999999. +testcase_ellint_3<double> data144[] = { + { -0.0000000000000000, 0.50000000000000000, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17422708752228896, 0.50000000000000000, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34671739434855858, 0.50000000000000000, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51617616305641889, 0.50000000000000000, 0.29999999999999999, + 0.52359877559829882 }, + { 0.68200047612545178, 0.50000000000000000, 0.29999999999999999, + 0.69813170079773179 }, + { 0.84427217869498372, 0.50000000000000000, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0035637821389782, 0.50000000000000000, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1606800483933113, 0.50000000000000000, 0.29999999999999999, + 1.2217304763960306 }, + { 1.3164407134643459, 0.50000000000000000, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4715681939859637, 0.50000000000000000, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.29999999999999999. +template <typename Tp> +void test144() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data144) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data144[i].k), Tp(data144[i].nu), + Tp(data144[i].phi)); + const Tp f0 = data144[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.40000000000000002. +testcase_ellint_3<double> data145[] = { + { -0.0000000000000000, 0.50000000000000000, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17405275963859917, 0.50000000000000000, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34538761957029329, 0.50000000000000000, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51200902646603919, 0.50000000000000000, 0.40000000000000002, + 0.52359877559829882 }, + { 0.67301522212868792, 0.50000000000000000, 0.40000000000000002, + 0.69813170079773179 }, + { 0.82853844466313320, 0.50000000000000000, 0.40000000000000002, + 0.87266462599716477 }, + { 0.97942097862681488, 0.50000000000000000, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1268429801220616, 0.50000000000000000, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2720406704533922, 0.50000000000000000, 0.40000000000000002, + 1.3962634015954636 }, + { 1.4161679518465340, 0.50000000000000000, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.40000000000000002. +template <typename Tp> +void test145() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data145) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data145[i].k), Tp(data145[i].nu), + Tp(data145[i].phi)); + const Tp f0 = data145[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.50000000000000000. +testcase_ellint_3<double> data146[] = { + { -0.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17387905570381157, 0.50000000000000000, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34407576010465207, 0.50000000000000000, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50795686560160835, 0.50000000000000000, 0.50000000000000000, + 0.52359877559829882 }, + { 0.66442115453330175, 0.50000000000000000, 0.50000000000000000, + 0.69813170079773179 }, + { 0.81373829119355345, 0.50000000000000000, 0.50000000000000000, + 0.87266462599716477 }, + { 0.95705743313235825, 0.50000000000000000, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0959131991362556, 0.50000000000000000, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2318900529754597, 0.50000000000000000, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3664739530045971, 0.50000000000000000, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.50000000000000000. +template <typename Tp> +void test146() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data146) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data146[i].k), Tp(data146[i].nu), + Tp(data146[i].phi)); + const Tp f0 = data146[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.59999999999999998. +testcase_ellint_3<double> data147[] = { + { -0.0000000000000000, 0.50000000000000000, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17370597174637581, 0.50000000000000000, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34278139158591414, 0.50000000000000000, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50401419439302719, 0.50000000000000000, 0.59999999999999998, + 0.52359877559829882 }, + { 0.65618938076167221, 0.50000000000000000, 0.59999999999999998, + 0.69813170079773179 }, + { 0.79977959248855424, 0.50000000000000000, 0.59999999999999998, + 0.87266462599716477 }, + { 0.93625925190753545, 0.50000000000000000, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0674905658379710, 0.50000000000000000, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1953481298023048, 0.50000000000000000, 0.59999999999999998, + 1.3962634015954636 }, + { 1.3215740290190876, 0.50000000000000000, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.59999999999999998. +template <typename Tp> +void test147() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data147) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data147[i].k), Tp(data147[i].nu), + Tp(data147[i].phi)); + const Tp f0 = data147[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.69999999999999996. +testcase_ellint_3<double> data148[] = { + { -0.0000000000000000, 0.50000000000000000, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17353350383131641, 0.50000000000000000, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34150410405436771, 0.50000000000000000, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50017589696443487, 0.50000000000000000, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64829398188419962, 0.50000000000000000, 0.69999999999999996, + 0.69813170079773179 }, + { 0.78658270782402073, 0.50000000000000000, 0.69999999999999996, + 0.87266462599716477 }, + { 0.91684738336675053, 0.50000000000000000, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0412486789555937, 0.50000000000000000, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1619021847612001, 0.50000000000000000, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2807475181182502, 0.50000000000000000, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.69999999999999996. +template <typename Tp> +void test148() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data148) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data148[i].k), Tp(data148[i].nu), + Tp(data148[i].phi)); + const Tp f0 = data148[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.80000000000000004. +testcase_ellint_3<double> data149[] = { + { -0.0000000000000000, 0.50000000000000000, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17336164805979126, 0.50000000000000000, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34024350132086773, 0.50000000000000000, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49643719555734084, 0.50000000000000000, 0.80000000000000004, + 0.52359877559829882 }, + { 0.64071162456976150, 0.50000000000000000, 0.80000000000000004, + 0.69813170079773179 }, + { 0.77407836177211908, 0.50000000000000000, 0.80000000000000004, + 0.87266462599716477 }, + { 0.89867058251905652, 0.50000000000000000, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0169181822134912, 0.50000000000000000, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1311363312779448, 0.50000000000000000, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2434165408189539, 0.50000000000000000, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.80000000000000004. +template <typename Tp> +void test149() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data149) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data149[i].k), Tp(data149[i].nu), + Tp(data149[i].phi)); + const Tp f0 = data149[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.50000000000000000, nu=0.90000000000000002. +testcase_ellint_3<double> data150[] = { + { -0.0000000000000000, 0.50000000000000000, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17319040056865681, 0.50000000000000000, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33899920036578557, 0.50000000000000000, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49279362182695186, 0.50000000000000000, 0.90000000000000002, + 0.52359877559829882 }, + { 0.63342123379746151, 0.50000000000000000, 0.90000000000000002, + 0.69813170079773179 }, + { 0.76220595179550321, 0.50000000000000000, 0.90000000000000002, + 0.87266462599716477 }, + { 0.88160004743532294, 0.50000000000000000, 0.90000000000000002, + 1.0471975511965976 }, + { 0.99427448642310134, 0.50000000000000000, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1027091512470093, 0.50000000000000000, 0.90000000000000002, + 1.3962634015954636 }, + { 1.2091116095504744, 0.50000000000000000, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.90000000000000002. +template <typename Tp> +void test150() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data150) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data150[i].k), Tp(data150[i].nu), + Tp(data150[i].phi)); + const Tp f0 = data150[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.0000000000000000. +testcase_ellint_3<double> data151[] = { + { -0.0000000000000000, 0.60000000000000009, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17485154362988362, 0.60000000000000009, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35160509865544326, 0.60000000000000009, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53210652578446160, 0.60000000000000009, 0.0000000000000000, + 0.52359877559829882 }, + { 0.71805304664485670, 0.60000000000000009, 0.0000000000000000, + 0.69813170079773179 }, + { 0.91082759030195970, 0.60000000000000009, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1112333229323366, 0.60000000000000009, 0.0000000000000000, + 1.0471975511965976 }, + { 1.3191461190365270, 0.60000000000000009, 0.0000000000000000, + 1.2217304763960306 }, + { 1.5332022105084775, 0.60000000000000009, 0.0000000000000000, + 1.3962634015954636 }, + { 1.7507538029157526, 0.60000000000000009, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.0000000000000000. +template <typename Tp> +void test151() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data151) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data151[i].k), Tp(data151[i].nu), + Tp(data151[i].phi)); + const Tp f0 = data151[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.10000000000000001. +testcase_ellint_3<double> data152[] = { + { -0.0000000000000000, 0.60000000000000009, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17467514275022014, 0.60000000000000009, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35021333086258255, 0.60000000000000009, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52751664092962713, 0.60000000000000009, 0.10000000000000001, + 0.52359877559829882 }, + { 0.70752126971957885, 0.60000000000000009, 0.10000000000000001, + 0.69813170079773179 }, + { 0.89111058756112871, 0.60000000000000009, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0789241202877773, 0.60000000000000009, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2710800210399946, 0.60000000000000009, 0.10000000000000001, + 1.2217304763960306 }, + { 1.4669060574440278, 0.60000000000000009, 0.10000000000000001, + 1.3962634015954636 }, + { 1.6648615773343014, 0.60000000000000009, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.10000000000000001. +template <typename Tp> +void test152() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data152) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data152[i].k), Tp(data152[i].nu), + Tp(data152[i].phi)); + const Tp f0 = data152[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.20000000000000001. +testcase_ellint_3<double> data153[] = { + { -0.0000000000000000, 0.60000000000000009, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17449937871800653, 0.60000000000000009, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34884093647346553, 0.60000000000000009, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52306221119844110, 0.60000000000000009, 0.20000000000000001, + 0.52359877559829882 }, + { 0.69749955678982223, 0.60000000000000009, 0.20000000000000001, + 0.69813170079773179 }, + { 0.87274610682416853, 0.60000000000000009, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0494620540750796, 0.60000000000000009, 0.20000000000000001, + 1.0471975511965976 }, + { 1.2280847305507339, 0.60000000000000009, 0.20000000000000001, + 1.2217304763960306 }, + { 1.4085436279696888, 0.60000000000000009, 0.20000000000000001, + 1.3962634015954636 }, + { 1.5901418016279374, 0.60000000000000009, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.20000000000000001. +template <typename Tp> +void test153() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data153) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data153[i].k), Tp(data153[i].nu), + Tp(data153[i].phi)); + const Tp f0 = data153[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.29999999999999999. +testcase_ellint_3<double> data154[] = { + { -0.0000000000000000, 0.60000000000000009, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17432424744393935, 0.60000000000000009, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34748744127146447, 0.60000000000000009, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51873632743924847, 0.60000000000000009, 0.29999999999999999, + 0.52359877559829882 }, + { 0.68794610396313127, 0.60000000000000009, 0.29999999999999999, + 0.69813170079773179 }, + { 0.85558070175468726, 0.60000000000000009, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0224416343605658, 0.60000000000000009, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1893144457936788, 0.60000000000000009, 0.29999999999999999, + 1.2217304763960306 }, + { 1.3566435377982575, 0.60000000000000009, 0.29999999999999999, + 1.3962634015954636 }, + { 1.5243814243493585, 0.60000000000000009, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.29999999999999999. +template <typename Tp> +void test154() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data154) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data154[i].k), Tp(data154[i].nu), + Tp(data154[i].phi)); + const Tp f0 = data154[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.40000000000000002. +testcase_ellint_3<double> data155[] = { + { -0.0000000000000000, 0.60000000000000009, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17414974487670720, 0.60000000000000009, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34615238767335027, 0.60000000000000009, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51453257838108579, 0.60000000000000009, 0.40000000000000002, + 0.52359877559829882 }, + { 0.67882386787534410, 0.60000000000000009, 0.40000000000000002, + 0.69813170079773179 }, + { 0.83948470233173578, 0.60000000000000009, 0.40000000000000002, + 0.87266462599716477 }, + { 0.99753496200074021, 0.60000000000000009, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1541101404388487, 0.60000000000000009, 0.40000000000000002, + 1.2217304763960306 }, + { 1.3100911323398816, 0.60000000000000009, 0.40000000000000002, + 1.3962634015954636 }, + { 1.4659345278069984, 0.60000000000000009, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.40000000000000002. +template <typename Tp> +void test155() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data155) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data155[i].k), Tp(data155[i].nu), + Tp(data155[i].phi)); + const Tp f0 = data155[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.50000000000000000. +testcase_ellint_3<double> data156[] = { + { -0.0000000000000000, 0.60000000000000009, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17397586700252810, 0.60000000000000009, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34483533397138516, 0.60000000000000009, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51044500461706499, 0.60000000000000009, 0.50000000000000000, + 0.52359877559829882 }, + { 0.67009988034712675, 0.60000000000000009, 0.50000000000000000, + 0.69813170079773179 }, + { 0.82434762375735193, 0.60000000000000009, 0.50000000000000000, + 0.87266462599716477 }, + { 0.97447346702799043, 0.60000000000000009, 0.50000000000000000, + 1.0471975511965976 }, + { 1.1219494000522143, 0.60000000000000009, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2680242605954488, 0.60000000000000009, 0.50000000000000000, + 1.3962634015954636 }, + { 1.4135484285693078, 0.60000000000000009, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.50000000000000000. +template <typename Tp> +void test156() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data156) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data156[i].k), Tp(data156[i].nu), + Tp(data156[i].phi)); + const Tp f0 = data156[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.59999999999999998. +testcase_ellint_3<double> data157[] = { + { -0.0000000000000000, 0.60000000000000009, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17380260984469356, 0.60000000000000009, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34353585361777839, 0.60000000000000009, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50646805774321402, 0.60000000000000009, 0.59999999999999998, + 0.52359877559829882 }, + { 0.66174468108625517, 0.60000000000000009, 0.59999999999999998, + 0.69813170079773179 }, + { 0.81007462280278408, 0.60000000000000009, 0.59999999999999998, + 0.87266462599716477 }, + { 0.95303466945718773, 0.60000000000000009, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0924118588677503, 0.60000000000000009, 0.59999999999999998, + 1.2217304763960306 }, + { 1.2297640574847937, 0.60000000000000009, 0.59999999999999998, + 1.3962634015954636 }, + { 1.3662507535812816, 0.60000000000000009, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.59999999999999998. +template <typename Tp> +void test157() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data157) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data157[i].k), Tp(data157[i].nu), + Tp(data157[i].phi)); + const Tp f0 = data157[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.69999999999999996. +testcase_ellint_3<double> data158[] = { + { -0.0000000000000000, 0.60000000000000009, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17362996946312009, 0.60000000000000009, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34225353454870588, 0.60000000000000009, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50259656397799546, 0.60000000000000009, 0.69999999999999996, + 0.52359877559829882 }, + { 0.65373184496628944, 0.60000000000000009, 0.69999999999999996, + 0.69813170079773179 }, + { 0.79658372884056439, 0.60000000000000009, 0.69999999999999996, + 0.87266462599716477 }, + { 0.93303240100245466, 0.60000000000000009, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0651547944716557, 0.60000000000000009, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1947676204853441, 0.60000000000000009, 0.69999999999999996, + 1.3962634015954636 }, + { 1.3232737468822811, 0.60000000000000009, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.69999999999999996. +template <typename Tp> +void test158() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data158) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data158[i].k), Tp(data158[i].nu), + Tp(data158[i].phi)); + const Tp f0 = data158[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.80000000000000004. +testcase_ellint_3<double> data159[] = { + { -0.0000000000000000, 0.60000000000000009, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17345794195390687, 0.60000000000000009, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34098797854531027, 0.60000000000000009, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49882569168826230, 0.60000000000000009, 0.80000000000000004, + 0.52359877559829882 }, + { 0.64603758566475511, 0.60000000000000009, 0.80000000000000004, + 0.69813170079773179 }, + { 0.78380365594769730, 0.60000000000000009, 0.80000000000000004, + 0.87266462599716477 }, + { 0.91430946255611223, 0.60000000000000009, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0398955217270607, 0.60000000000000009, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1625948314277679, 0.60000000000000009, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2840021261752192, 0.60000000000000009, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.80000000000000004. +template <typename Tp> +void test159() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data159) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data159[i].k), Tp(data159[i].nu), + Tp(data159[i].phi)); + const Tp f0 = data159[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.60000000000000009, nu=0.90000000000000002. +testcase_ellint_3<double> data160[] = { + { -0.0000000000000000, 0.60000000000000009, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17328652344890033, 0.60000000000000009, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33973880062929018, 0.60000000000000009, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49515092233122765, 0.60000000000000009, 0.90000000000000002, + 0.52359877559829882 }, + { 0.63864042139737043, 0.60000000000000009, 0.90000000000000002, + 0.69813170079773179 }, + { 0.77167205646538850, 0.60000000000000009, 0.90000000000000002, + 0.87266462599716477 }, + { 0.89673202848034428, 0.60000000000000009, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0163984492661304, 0.60000000000000009, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1328845785162431, 0.60000000000000009, 0.90000000000000002, + 1.3962634015954636 }, + { 1.2479362973851875, 0.60000000000000009, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.90000000000000002. +template <typename Tp> +void test160() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data160) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data160[i].k), Tp(data160[i].nu), + Tp(data160[i].phi)); + const Tp f0 = data160[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.0000000000000000. +testcase_ellint_3<double> data161[] = { + { -0.0000000000000000, 0.69999999999999996, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17496737466916720, 0.69999999999999996, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35254687535677925, 0.69999999999999996, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53536740275997130, 0.69999999999999996, 0.0000000000000000, + 0.52359877559829882 }, + { 0.72603797651684465, 0.69999999999999996, 0.0000000000000000, + 0.69813170079773179 }, + { 0.92698296348313458, 0.69999999999999996, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1400447527693316, 0.69999999999999996, 0.0000000000000000, + 1.0471975511965976 }, + { 1.3657668117194071, 0.69999999999999996, 0.0000000000000000, + 1.2217304763960306 }, + { 1.6024686895959159, 0.69999999999999996, 0.0000000000000000, + 1.3962634015954636 }, + { 1.8456939983747236, 0.69999999999999996, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.0000000000000000. +template <typename Tp> +void test161() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data161) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data161[i].k), Tp(data161[i].nu), + Tp(data161[i].phi)); + const Tp f0 = data161[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.10000000000000001. +testcase_ellint_3<double> data162[] = { + { -0.0000000000000000, 0.69999999999999996, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17479076384884681, 0.69999999999999996, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35114844900396364, 0.69999999999999996, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53072776947527012, 0.69999999999999996, 0.10000000000000001, + 0.52359877559829882 }, + { 0.71530198262386246, 0.69999999999999996, 0.10000000000000001, + 0.69813170079773179 }, + { 0.90666760677828306, 0.69999999999999996, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1063366517438080, 0.69999999999999996, 0.10000000000000001, + 1.0471975511965976 }, + { 1.3149477243092147, 0.69999999999999996, 0.10000000000000001, + 1.2217304763960306 }, + { 1.5314886725038925, 0.69999999999999996, 0.10000000000000001, + 1.3962634015954636 }, + { 1.7528050171757608, 0.69999999999999996, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.10000000000000001. +template <typename Tp> +void test162() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data162) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data162[i].k), Tp(data162[i].nu), + Tp(data162[i].phi)); + const Tp f0 = data162[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.20000000000000001. +testcase_ellint_3<double> data163[] = { + { -0.0000000000000000, 0.69999999999999996, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17461479077791472, 0.69999999999999996, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34976950621407538, 0.69999999999999996, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52622533231350188, 0.69999999999999996, 0.20000000000000001, + 0.52359877559829882 }, + { 0.70508774017895226, 0.69999999999999996, 0.20000000000000001, + 0.69813170079773179 }, + { 0.88775302531730294, 0.69999999999999996, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0756195476149006, 0.69999999999999996, 0.20000000000000001, + 1.0471975511965976 }, + { 1.2695349716654372, 0.69999999999999996, 0.20000000000000001, + 1.2217304763960306 }, + { 1.4690814617070540, 0.69999999999999996, 0.20000000000000001, + 1.3962634015954636 }, + { 1.6721098780092147, 0.69999999999999996, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.20000000000000001. +template <typename Tp> +void test163() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data163) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data163[i].k), Tp(data163[i].nu), + Tp(data163[i].phi)); + const Tp f0 = data163[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.29999999999999999. +testcase_ellint_3<double> data164[] = { + { -0.0000000000000000, 0.69999999999999996, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17443945136076172, 0.69999999999999996, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34840956983535287, 0.69999999999999996, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52185308551329179, 0.69999999999999996, 0.29999999999999999, + 0.52359877559829882 }, + { 0.69535240431168266, 0.69999999999999996, 0.29999999999999999, + 0.69813170079773179 }, + { 0.87007983473964923, 0.69999999999999996, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0474657975577066, 0.69999999999999996, 0.29999999999999999, + 1.0471975511965976 }, + { 1.2286225419931889, 0.69999999999999996, 0.29999999999999999, + 1.2217304763960306 }, + { 1.4136490671013271, 0.69999999999999996, 0.29999999999999999, + 1.3962634015954636 }, + { 1.6011813647733213, 0.69999999999999996, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.29999999999999999. +template <typename Tp> +void test164() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data164) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data164[i].k), Tp(data164[i].nu), + Tp(data164[i].phi)); + const Tp f0 = data164[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.40000000000000002. +testcase_ellint_3<double> data165[] = { + { -0.0000000000000000, 0.69999999999999996, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17426474153983226, 0.69999999999999996, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34706817945773732, 0.69999999999999996, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51760452851738159, 0.69999999999999996, 0.40000000000000002, + 0.52359877559829882 }, + { 0.68605801534722766, 0.69999999999999996, 0.40000000000000002, + 0.69813170079773179 }, + { 0.85351339387296532, 0.69999999999999996, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0215297967969537, 0.69999999999999996, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1915051074460528, 0.69999999999999996, 0.40000000000000002, + 1.2217304763960306 }, + { 1.3639821911744707, 0.69999999999999996, 0.40000000000000002, + 1.3962634015954636 }, + { 1.5382162002954762, 0.69999999999999996, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.40000000000000002. +template <typename Tp> +void test165() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data165) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data165[i].k), Tp(data165[i].nu), + Tp(data165[i].phi)); + const Tp f0 = data165[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.50000000000000000. +testcase_ellint_3<double> data166[] = { + { -0.0000000000000000, 0.69999999999999996, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17409065729516093, 0.69999999999999996, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34574489064986091, 0.69999999999999996, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51347361925579793, 0.69999999999999996, 0.50000000000000000, + 0.52359877559829882 }, + { 0.67717079489579290, 0.69999999999999996, 0.50000000000000000, + 0.69813170079773179 }, + { 0.83793902055292280, 0.69999999999999996, 0.50000000000000000, + 0.87266462599716477 }, + { 0.99752863545289705, 0.69999999999999996, 0.50000000000000000, + 1.0471975511965976 }, + { 1.1576240080401499, 0.69999999999999996, 0.50000000000000000, + 1.2217304763960306 }, + { 1.3191464023923762, 0.69999999999999996, 0.50000000000000000, + 1.3962634015954636 }, + { 1.4818433192178544, 0.69999999999999996, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.50000000000000000. +template <typename Tp> +void test166() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data166) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data166[i].k), Tp(data166[i].nu), + Tp(data166[i].phi)); + const Tp f0 = data166[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.59999999999999998. +testcase_ellint_3<double> data167[] = { + { -0.0000000000000000, 0.69999999999999996, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17391719464391611, 0.69999999999999996, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34443927423869031, 0.69999999999999996, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50945473266486074, 0.69999999999999996, 0.59999999999999998, + 0.52359877559829882 }, + { 0.66866056326513823, 0.69999999999999996, 0.59999999999999998, + 0.69813170079773179 }, + { 0.82325830002337352, 0.69999999999999996, 0.59999999999999998, + 0.87266462599716477 }, + { 0.97522808245669357, 0.69999999999999996, 0.59999999999999998, + 1.0471975511965976 }, + { 1.1265300613705282, 0.69999999999999996, 0.59999999999999998, + 1.2217304763960306 }, + { 1.2784066076152003, 0.69999999999999996, 0.59999999999999998, + 1.3962634015954636 }, + { 1.4309994736080540, 0.69999999999999996, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.59999999999999998. +template <typename Tp> +void test167() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data167) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data167[i].k), Tp(data167[i].nu), + Tp(data167[i].phi)); + const Tp f0 = data167[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.69999999999999996. +testcase_ellint_3<double> data168[] = { + { -0.0000000000000000, 0.69999999999999996, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17374434963995028, 0.69999999999999996, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34315091562900674, 0.69999999999999996, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50554262375653358, 0.69999999999999996, 0.69999999999999996, + 0.52359877559829882 }, + { 0.66050025406305812, 0.69999999999999996, 0.69999999999999996, + 0.69813170079773179 }, + { 0.80938620118847404, 0.69999999999999996, 0.69999999999999996, + 0.87266462599716477 }, + { 0.95443223855852144, 0.69999999999999996, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0978573207128302, 0.69999999999999996, 0.69999999999999996, + 1.2217304763960306 }, + { 1.2411754575007123, 0.69999999999999996, 0.69999999999999996, + 1.3962634015954636 }, + { 1.3848459188329196, 0.69999999999999996, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.69999999999999996. +template <typename Tp> +void test168() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data168) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data168[i].k), Tp(data168[i].nu), + Tp(data168[i].phi)); + const Tp f0 = data168[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.80000000000000004. +testcase_ellint_3<double> data169[] = { + { -0.0000000000000000, 0.69999999999999996, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17357211837335737, 0.69999999999999996, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34187941416012108, 0.69999999999999996, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50173239465478270, 0.69999999999999996, 0.80000000000000004, + 0.52359877559829882 }, + { 0.65266550725988315, 0.69999999999999996, 0.80000000000000004, + 0.69813170079773179 }, + { 0.79624879865249298, 0.69999999999999996, 0.80000000000000004, + 0.87266462599716477 }, + { 0.93497577043296920, 0.69999999999999996, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0713041566930748, 0.69999999999999996, 0.80000000000000004, + 1.2217304763960306 }, + { 1.2069772023255652, 0.69999999999999996, 0.80000000000000004, + 1.3962634015954636 }, + { 1.3427110650397533, 0.69999999999999996, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.80000000000000004. +template <typename Tp> +void test169() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data169) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data169[i].k), Tp(data169[i].nu), + Tp(data169[i].phi)); + const Tp f0 = data169[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.69999999999999996, nu=0.90000000000000002. +testcase_ellint_3<double> data170[] = { + { -0.0000000000000000, 0.69999999999999996, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17340049697003634, 0.69999999999999996, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34062438249741556, 0.69999999999999996, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49801946510076878, 0.69999999999999996, 0.90000000000000002, + 0.52359877559829882 }, + { 0.64513432604750487, 0.69999999999999996, 0.90000000000000002, + 0.69813170079773179 }, + { 0.78378145487573758, 0.69999999999999996, 0.90000000000000002, + 0.87266462599716477 }, + { 0.91671799500854634, 0.69999999999999996, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0466193579463123, 0.69999999999999996, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1754218079199146, 0.69999999999999996, 0.90000000000000002, + 1.3962634015954636 }, + { 1.3040500499695911, 0.69999999999999996, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.90000000000000002. +template <typename Tp> +void test170() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data170) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data170[i].k), Tp(data170[i].nu), + Tp(data170[i].phi)); + const Tp f0 = data170[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.0000000000000000. +testcase_ellint_3<double> data171[] = { + { -0.0000000000000000, 0.80000000000000004, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17510154241338902, 0.80000000000000004, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35365068839779390, 0.80000000000000004, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53926804409084561, 0.80000000000000004, 0.0000000000000000, + 0.52359877559829882 }, + { 0.73587926028070383, 0.80000000000000004, 0.0000000000000000, + 0.69813170079773179 }, + { 0.94770942970071170, 0.80000000000000004, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1789022995388239, 0.80000000000000004, 0.0000000000000000, + 1.0471975511965976 }, + { 1.4323027881876009, 0.80000000000000004, 0.0000000000000000, + 1.2217304763960306 }, + { 1.7069629739121674, 0.80000000000000004, 0.0000000000000000, + 1.3962634015954636 }, + { 1.9953027776647296, 0.80000000000000004, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.0000000000000000. +template <typename Tp> +void test171() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data171) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data171[i].k), Tp(data171[i].nu), + Tp(data171[i].phi)); + const Tp f0 = data171[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.10000000000000001. +testcase_ellint_3<double> data172[] = { + { -0.0000000000000000, 0.80000000000000004, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17492468824017166, 0.80000000000000004, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35224443521476911, 0.80000000000000004, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53456851853226961, 0.80000000000000004, 0.10000000000000001, + 0.52359877559829882 }, + { 0.72488875602364944, 0.80000000000000004, 0.10000000000000001, + 0.69813170079773179 }, + { 0.92661354274638952, 0.80000000000000004, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1432651144499077, 0.80000000000000004, 0.10000000000000001, + 1.0471975511965976 }, + { 1.3774479927211429, 0.80000000000000004, 0.10000000000000001, + 1.2217304763960306 }, + { 1.6287092337196041, 0.80000000000000004, 0.10000000000000001, + 1.3962634015954636 }, + { 1.8910755418379521, 0.80000000000000004, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.10000000000000001. +template <typename Tp> +void test172() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data172) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data172[i].k), Tp(data172[i].nu), + Tp(data172[i].phi)); + const Tp f0 = data172[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.20000000000000001. +testcase_ellint_3<double> data173[] = { + { -0.0000000000000000, 0.80000000000000004, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17474847286224943, 0.80000000000000004, 0.20000000000000001, + 0.17453292519943295 }, + { 0.35085779529084682, 0.80000000000000004, 0.20000000000000001, + 0.34906585039886590 }, + { 0.53000829263059157, 0.80000000000000004, 0.20000000000000001, + 0.52359877559829882 }, + { 0.71443466027453406, 0.80000000000000004, 0.20000000000000001, + 0.69813170079773179 }, + { 0.90698196872715420, 0.80000000000000004, 0.20000000000000001, + 0.87266462599716477 }, + { 1.1108198200558581, 0.80000000000000004, 0.20000000000000001, + 1.0471975511965976 }, + { 1.3284988909963957, 0.80000000000000004, 0.20000000000000001, + 1.2217304763960306 }, + { 1.5600369318140328, 0.80000000000000004, 0.20000000000000001, + 1.3962634015954636 }, + { 1.8007226661734588, 0.80000000000000004, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.20000000000000001. +template <typename Tp> +void test173() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data173) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data173[i].k), Tp(data173[i].nu), + Tp(data173[i].phi)); + const Tp f0 = data173[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.29999999999999999. +testcase_ellint_3<double> data174[] = { + { -0.0000000000000000, 0.80000000000000004, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17457289217669891, 0.80000000000000004, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34949028801501258, 0.80000000000000004, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52558024362769318, 0.80000000000000004, 0.29999999999999999, + 0.52359877559829882 }, + { 0.70447281740094914, 0.80000000000000004, 0.29999999999999999, + 0.69813170079773179 }, + { 0.88864745641528986, 0.80000000000000004, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0811075819341465, 0.80000000000000004, 0.29999999999999999, + 1.0471975511965976 }, + { 1.2844589654082377, 0.80000000000000004, 0.29999999999999999, + 1.2217304763960306 }, + { 1.4991461361277849, 0.80000000000000004, 0.29999999999999999, + 1.3962634015954636 }, + { 1.7214611048717301, 0.80000000000000004, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.29999999999999999. +template <typename Tp> +void test174() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data174) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data174[i].k), Tp(data174[i].nu), + Tp(data174[i].phi)); + const Tp f0 = data174[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.40000000000000002. +testcase_ellint_3<double> data175[] = { + { -0.0000000000000000, 0.80000000000000004, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17439794211872178, 0.80000000000000004, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34814144964568972, 0.80000000000000004, 0.40000000000000002, + 0.34906585039886590 }, + { 0.52127776285273075, 0.80000000000000004, 0.40000000000000002, + 0.52359877559829882 }, + { 0.69496411438966599, 0.80000000000000004, 0.40000000000000002, + 0.69813170079773179 }, + { 0.87146878427509589, 0.80000000000000004, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0537579024937762, 0.80000000000000004, 0.40000000000000002, + 1.0471975511965976 }, + { 1.2445534387922637, 0.80000000000000004, 0.40000000000000002, + 1.2217304763960306 }, + { 1.4446769766361993, 0.80000000000000004, 0.40000000000000002, + 1.3962634015954636 }, + { 1.6512267838651289, 0.80000000000000004, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.40000000000000002. +template <typename Tp> +void test175() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data175) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data175[i].k), Tp(data175[i].nu), + Tp(data175[i].phi)); + const Tp f0 = data175[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.50000000000000000. +testcase_ellint_3<double> data176[] = { + { -0.0000000000000000, 0.80000000000000004, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17422361866118047, 0.80000000000000004, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34681083254170475, 0.80000000000000004, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51709470815494440, 0.80000000000000004, 0.50000000000000000, + 0.52359877559829882 }, + { 0.68587375344080259, 0.80000000000000004, 0.50000000000000000, + 0.69813170079773179 }, + { 0.85532571852810624, 0.80000000000000004, 0.50000000000000000, + 0.87266462599716477 }, + { 1.0284677391874906, 0.80000000000000004, 0.50000000000000000, + 1.0471975511965976 }, + { 1.2081693942686225, 0.80000000000000004, 0.50000000000000000, + 1.2217304763960306 }, + { 1.3955803006426311, 0.80000000000000004, 0.50000000000000000, + 1.3962634015954636 }, + { 1.5884528947755532, 0.80000000000000004, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.50000000000000000. +template <typename Tp> +void test176() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data176) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data176[i].k), Tp(data176[i].nu), + Tp(data176[i].phi)); + const Tp f0 = data176[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.59999999999999998. +testcase_ellint_3<double> data177[] = { + { -0.0000000000000000, 0.80000000000000004, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17404991781414092, 0.80000000000000004, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34549800443625167, 0.80000000000000004, 0.59999999999999998, + 0.34906585039886590 }, + { 0.51302536167001556, 0.80000000000000004, 0.59999999999999998, + 0.52359877559829882 }, + { 0.67717065003912258, 0.80000000000000004, 0.59999999999999998, + 0.69813170079773179 }, + { 0.84011512421134416, 0.80000000000000004, 0.59999999999999998, + 0.87266462599716477 }, + { 1.0049863847088742, 0.80000000000000004, 0.59999999999999998, + 1.0471975511965976 }, + { 1.1748145941898918, 0.80000000000000004, 0.59999999999999998, + 1.2217304763960306 }, + { 1.3510319699755071, 0.80000000000000004, 0.59999999999999998, + 1.3962634015954636 }, + { 1.5319262547427865, 0.80000000000000004, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.59999999999999998. +template <typename Tp> +void test177() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data177) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data177[i].k), Tp(data177[i].nu), + Tp(data177[i].phi)); + const Tp f0 = data177[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.69999999999999996. +testcase_ellint_3<double> data178[] = { + { -0.0000000000000000, 0.80000000000000004, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17387683562442202, 0.80000000000000004, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34420254775101611, 0.80000000000000004, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50906439222143685, 0.80000000000000004, 0.69999999999999996, + 0.52359877559829882 }, + { 0.66882693152688433, 0.80000000000000004, 0.69999999999999996, + 0.69813170079773179 }, + { 0.82574792844091316, 0.80000000000000004, 0.69999999999999996, + 0.87266462599716477 }, + { 0.98310431309490953, 0.80000000000000004, 0.69999999999999996, + 1.0471975511965976 }, + { 1.1440884535113258, 0.80000000000000004, 0.69999999999999996, + 1.2217304763960306 }, + { 1.3103743938952537, 0.80000000000000004, 0.69999999999999996, + 1.3962634015954636 }, + { 1.4806912324625332, 0.80000000000000004, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.69999999999999996. +template <typename Tp> +void test178() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data178) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data178[i].k), Tp(data178[i].nu), + Tp(data178[i].phi)); + const Tp f0 = data178[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.80000000000000004. +testcase_ellint_3<double> data179[] = { + { -0.0000000000000000, 0.80000000000000004, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17370436817515206, 0.80000000000000004, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34292405894783395, 0.80000000000000004, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50520682176250087, 0.80000000000000004, 0.80000000000000004, + 0.52359877559829882 }, + { 0.66081751679736189, 0.80000000000000004, 0.80000000000000004, + 0.69813170079773179 }, + { 0.81214672249355102, 0.80000000000000004, 0.80000000000000004, + 0.87266462599716477 }, + { 0.96264481387685574, 0.80000000000000004, 0.80000000000000004, + 1.0471975511965976 }, + { 1.1156611352656258, 0.80000000000000004, 0.80000000000000004, + 1.2217304763960306 }, + { 1.2730756225143889, 0.80000000000000004, 0.80000000000000004, + 1.3962634015954636 }, + { 1.4339837018309474, 0.80000000000000004, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.80000000000000004. +template <typename Tp> +void test179() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data179) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data179[i].k), Tp(data179[i].nu), + Tp(data179[i].phi)); + const Tp f0 = data179[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.80000000000000004, nu=0.90000000000000002. +testcase_ellint_3<double> data180[] = { + { -0.0000000000000000, 0.80000000000000004, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17353251158533153, 0.80000000000000004, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34166214791545768, 0.80000000000000004, 0.90000000000000002, + 0.34906585039886590 }, + { 0.50144799535130580, 0.80000000000000004, 0.90000000000000002, + 0.52359877559829882 }, + { 0.65311976193814447, 0.80000000000000004, 0.90000000000000002, + 0.69813170079773179 }, + { 0.79924384892320866, 0.80000000000000004, 0.90000000000000002, + 0.87266462599716477 }, + { 0.94345762353365625, 0.80000000000000004, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0892582069219159, 0.80000000000000004, 0.90000000000000002, + 1.2217304763960306 }, + { 1.2387000876610268, 0.80000000000000004, 0.90000000000000002, + 1.3962634015954636 }, + { 1.3911845406776222, 0.80000000000000004, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.90000000000000002. +template <typename Tp> +void test180() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data180) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data180[i].k), Tp(data180[i].nu), + Tp(data180[i].phi)); + const Tp f0 = data180[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.0000000000000000. +testcase_ellint_3<double> data181[] = { + { -0.0000000000000000, 0.89999999999999991, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17525427376115027, 0.89999999999999991, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35492464591297446, 0.89999999999999991, 0.0000000000000000, + 0.34906585039886590 }, + { 0.54388221416157123, 0.89999999999999991, 0.0000000000000000, + 0.52359877559829882 }, + { 0.74797400423532501, 0.89999999999999991, 0.0000000000000000, + 0.69813170079773179 }, + { 0.97463898451966458, 0.89999999999999991, 0.0000000000000000, + 0.87266462599716477 }, + { 1.2334463254523438, 0.89999999999999991, 0.0000000000000000, + 1.0471975511965976 }, + { 1.5355247765594910, 0.89999999999999991, 0.0000000000000000, + 1.2217304763960306 }, + { 1.8882928567775117, 0.89999999999999991, 0.0000000000000000, + 1.3962634015954636 }, + { 2.2805491384227699, 0.89999999999999991, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.0000000000000000. +template <typename Tp> +void test181() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data181) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data181[i].k), Tp(data181[i].nu), + Tp(data181[i].phi)); + const Tp f0 = data181[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.10000000000000001. +testcase_ellint_3<double> data182[] = { + { -0.0000000000000000, 0.89999999999999991, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17507714233254659, 0.89999999999999991, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35350932904326521, 0.89999999999999991, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53911129989870987, 0.89999999999999991, 0.10000000000000001, + 0.52359877559829882 }, + { 0.73666644254508407, 0.89999999999999991, 0.10000000000000001, + 0.69813170079773179 }, + { 0.95250736612100184, 0.89999999999999991, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1950199550905591, 0.89999999999999991, 0.10000000000000001, + 1.0471975511965976 }, + { 1.4741687286340848, 0.89999999999999991, 0.10000000000000001, + 1.2217304763960306 }, + { 1.7968678183506053, 0.89999999999999991, 0.10000000000000001, + 1.3962634015954636 }, + { 2.1537868513875282, 0.89999999999999991, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.10000000000000001. +template <typename Tp> +void test182() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data182) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data182[i].k), Tp(data182[i].nu), + Tp(data182[i].phi)); + const Tp f0 = data182[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.20000000000000001. +testcase_ellint_3<double> data183[] = { + { -0.0000000000000000, 0.89999999999999991, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17490065089140930, 0.89999999999999991, 0.20000000000000001, + 0.17453292519943295 }, + { 0.35211377590661436, 0.89999999999999991, 0.20000000000000001, + 0.34906585039886590 }, + { 0.53448220334204111, 0.89999999999999991, 0.20000000000000001, + 0.52359877559829882 }, + { 0.72591368943179591, 0.89999999999999991, 0.20000000000000001, + 0.69813170079773179 }, + { 0.93192539780038763, 0.89999999999999991, 0.20000000000000001, + 0.87266462599716477 }, + { 1.1600809679692681, 0.89999999999999991, 0.20000000000000001, + 1.0471975511965976 }, + { 1.4195407225882508, 0.89999999999999991, 0.20000000000000001, + 1.2217304763960306 }, + { 1.7168966476424521, 0.89999999999999991, 0.20000000000000001, + 1.3962634015954636 }, + { 2.0443194576468890, 0.89999999999999991, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.20000000000000001. +template <typename Tp> +void test183() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data183) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data183[i].k), Tp(data183[i].nu), + Tp(data183[i].phi)); + const Tp f0 = data183[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.29999999999999999. +testcase_ellint_3<double> data184[] = { + { -0.0000000000000000, 0.89999999999999991, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17472479532647534, 0.89999999999999991, 0.29999999999999999, + 0.17453292519943295 }, + { 0.35073750187374114, 0.89999999999999991, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52998766129466968, 0.89999999999999991, 0.29999999999999999, + 0.52359877559829882 }, + { 0.71566993548699565, 0.89999999999999991, 0.29999999999999999, + 0.69813170079773179 }, + { 0.91271517762560195, 0.89999999999999991, 0.29999999999999999, + 0.87266462599716477 }, + { 1.1281241199843368, 0.89999999999999991, 0.29999999999999999, + 1.0471975511965976 }, + { 1.3704929576917448, 0.89999999999999991, 0.29999999999999999, + 1.2217304763960306 }, + { 1.6461981511487711, 0.89999999999999991, 0.29999999999999999, + 1.3962634015954636 }, + { 1.9486280260314424, 0.89999999999999991, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.29999999999999999. +template <typename Tp> +void test184() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data184) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data184[i].k), Tp(data184[i].nu), + Tp(data184[i].phi)); + const Tp f0 = data184[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.40000000000000002. +testcase_ellint_3<double> data185[] = { + { -0.0000000000000000, 0.89999999999999991, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17454957156468839, 0.89999999999999991, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34938003933330430, 0.89999999999999991, 0.40000000000000002, + 0.34906585039886590 }, + { 0.52562093533067444, 0.89999999999999991, 0.40000000000000002, + 0.52359877559829882 }, + { 0.70589461324915681, 0.89999999999999991, 0.40000000000000002, + 0.69813170079773179 }, + { 0.89472658511942849, 0.89999999999999991, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0987419542323438, 0.89999999999999991, 0.40000000000000002, + 1.0471975511965976 }, + { 1.3261349565496301, 0.89999999999999991, 0.40000000000000002, + 1.2217304763960306 }, + { 1.5831293909853761, 0.89999999999999991, 0.40000000000000002, + 1.3962634015954636 }, + { 1.8641114227238347, 0.89999999999999991, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.40000000000000002. +template <typename Tp> +void test185() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data185) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data185[i].k), Tp(data185[i].nu), + Tp(data185[i].phi)); + const Tp f0 = data185[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.50000000000000000. +testcase_ellint_3<double> data186[] = { + { -0.0000000000000000, 0.89999999999999991, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17437497557073336, 0.89999999999999991, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34804093691586013, 0.89999999999999991, 0.50000000000000000, + 0.34906585039886590 }, + { 0.52137576320372903, 0.89999999999999991, 0.50000000000000000, + 0.52359877559829882 }, + { 0.69655163996912262, 0.89999999999999991, 0.50000000000000000, + 0.69813170079773179 }, + { 0.87783188683054236, 0.89999999999999991, 0.50000000000000000, + 0.87266462599716477 }, + { 1.0716015959755183, 0.89999999999999991, 0.50000000000000000, + 1.0471975511965976 }, + { 1.2857636916026749, 0.89999999999999991, 0.50000000000000000, + 1.2217304763960306 }, + { 1.5264263913252358, 0.89999999999999991, 0.50000000000000000, + 1.3962634015954636 }, + { 1.7888013241937859, 0.89999999999999991, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.50000000000000000. +template <typename Tp> +void test186() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data186) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data186[i].k), Tp(data186[i].nu), + Tp(data186[i].phi)); + const Tp f0 = data186[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.59999999999999998. +testcase_ellint_3<double> data187[] = { + { -0.0000000000000000, 0.89999999999999991, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17420100334657815, 0.89999999999999991, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34671975876122157, 0.89999999999999991, 0.59999999999999998, + 0.34906585039886590 }, + { 0.51724631570707957, 0.89999999999999991, 0.59999999999999998, + 0.52359877559829882 }, + { 0.68760879113743034, 0.89999999999999991, 0.59999999999999998, + 0.69813170079773179 }, + { 0.86192157779698364, 0.89999999999999991, 0.59999999999999998, + 0.87266462599716477 }, + { 1.0464279696166352, 0.89999999999999991, 0.59999999999999998, + 1.0471975511965976 }, + { 1.2488156247094004, 0.89999999999999991, 0.59999999999999998, + 1.2217304763960306 }, + { 1.4750988777188470, 0.89999999999999991, 0.59999999999999998, + 1.3962634015954636 }, + { 1.7211781128919521, 0.89999999999999991, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.59999999999999998. +template <typename Tp> +void test187() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data187) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data187[i].k), Tp(data187[i].nu), + Tp(data187[i].phi)); + const Tp f0 = data187[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.69999999999999996. +testcase_ellint_3<double> data188[] = { + { -0.0000000000000000, 0.89999999999999991, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17402765093102210, 0.89999999999999991, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34541608382635131, 0.89999999999999991, 0.69999999999999996, + 0.34906585039886590 }, + { 0.51322715827061693, 0.89999999999999991, 0.69999999999999996, + 0.52359877559829882 }, + { 0.67903717872440283, 0.89999999999999991, 0.69999999999999996, + 0.69813170079773179 }, + { 0.84690113601682671, 0.89999999999999991, 0.69999999999999996, + 0.87266462599716477 }, + { 1.0229914311548416, 0.89999999999999991, 0.69999999999999996, + 1.0471975511965976 }, + { 1.2148329639709381, 0.89999999999999991, 0.69999999999999996, + 1.2217304763960306 }, + { 1.4283586501307799, 0.89999999999999991, 0.69999999999999996, + 1.3962634015954636 }, + { 1.6600480747670936, 0.89999999999999991, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.69999999999999996. +template <typename Tp> +void test188() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data188) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data188[i].k), Tp(data188[i].nu), + Tp(data188[i].phi)); + const Tp f0 = data188[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.80000000000000004. +testcase_ellint_3<double> data189[] = { + { -0.0000000000000000, 0.89999999999999991, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17385491439925149, 0.89999999999999991, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34412950523113928, 0.89999999999999991, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50931321668729601, 0.89999999999999991, 0.80000000000000004, + 0.52359877559829882 }, + { 0.67081081392296327, 0.89999999999999991, 0.80000000000000004, + 0.69813170079773179 }, + { 0.83268846097293259, 0.89999999999999991, 0.80000000000000004, + 0.87266462599716477 }, + { 1.0010985015814025, 0.89999999999999991, 0.80000000000000004, + 1.0471975511965976 }, + { 1.1834394045489678, 0.89999999999999991, 0.80000000000000004, + 1.2217304763960306 }, + { 1.3855695891683182, 0.89999999999999991, 0.80000000000000004, + 1.3962634015954636 }, + { 1.6044591960982200, 0.89999999999999991, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.80000000000000004. +template <typename Tp> +void test189() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data189) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data189[i].k), Tp(data189[i].nu), + Tp(data189[i].phi)); + const Tp f0 = data189[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for k=0.89999999999999991, nu=0.90000000000000002. +testcase_ellint_3<double> data190[] = { + { -0.0000000000000000, 0.89999999999999991, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17368278986240138, 0.89999999999999991, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34285962963961397, 0.89999999999999991, 0.90000000000000002, + 0.34906585039886590 }, + { 0.50549974644993312, 0.89999999999999991, 0.90000000000000002, + 0.52359877559829882 }, + { 0.66290623857720876, 0.89999999999999991, 0.90000000000000002, + 0.69813170079773179 }, + { 0.81921183128847164, 0.89999999999999991, 0.90000000000000002, + 0.87266462599716477 }, + { 0.98058481956066368, 0.89999999999999991, 0.90000000000000002, + 1.0471975511965976 }, + { 1.1543223520473569, 0.89999999999999991, 0.90000000000000002, + 1.2217304763960306 }, + { 1.3462119782292934, 0.89999999999999991, 0.90000000000000002, + 1.3962634015954636 }, + { 1.5536420236310944, 0.89999999999999991, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.90000000000000002. +template <typename Tp> +void test190() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data190) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data190[i].k), Tp(data190[i].nu), + Tp(data190[i].phi)); + const Tp f0 = data190[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + test037<double>(); + test038<double>(); + test039<double>(); + test040<double>(); + test041<double>(); + test042<double>(); + test043<double>(); + test044<double>(); + test045<double>(); + test046<double>(); + test047<double>(); + test048<double>(); + test049<double>(); + test050<double>(); + test051<double>(); + test052<double>(); + test053<double>(); + test054<double>(); + test055<double>(); + test056<double>(); + test057<double>(); + test058<double>(); + test059<double>(); + test060<double>(); + test061<double>(); + test062<double>(); + test063<double>(); + test064<double>(); + test065<double>(); + test066<double>(); + test067<double>(); + test068<double>(); + test069<double>(); + test070<double>(); + test071<double>(); + test072<double>(); + test073<double>(); + test074<double>(); + test075<double>(); + test076<double>(); + test077<double>(); + test078<double>(); + test079<double>(); + test080<double>(); + test081<double>(); + test082<double>(); + test083<double>(); + test084<double>(); + test085<double>(); + test086<double>(); + test087<double>(); + test088<double>(); + test089<double>(); + test090<double>(); + test091<double>(); + test092<double>(); + test093<double>(); + test094<double>(); + test095<double>(); + test096<double>(); + test097<double>(); + test098<double>(); + test099<double>(); + test100<double>(); + test101<double>(); + test102<double>(); + test103<double>(); + test104<double>(); + test105<double>(); + test106<double>(); + test107<double>(); + test108<double>(); + test109<double>(); + test110<double>(); + test111<double>(); + test112<double>(); + test113<double>(); + test114<double>(); + test115<double>(); + test116<double>(); + test117<double>(); + test118<double>(); + test119<double>(); + test120<double>(); + test121<double>(); + test122<double>(); + test123<double>(); + test124<double>(); + test125<double>(); + test126<double>(); + test127<double>(); + test128<double>(); + test129<double>(); + test130<double>(); + test131<double>(); + test132<double>(); + test133<double>(); + test134<double>(); + test135<double>(); + test136<double>(); + test137<double>(); + test138<double>(); + test139<double>(); + test140<double>(); + test141<double>(); + test142<double>(); + test143<double>(); + test144<double>(); + test145<double>(); + test146<double>(); + test147<double>(); + test148<double>(); + test149<double>(); + test150<double>(); + test151<double>(); + test152<double>(); + test153<double>(); + test154<double>(); + test155<double>(); + test156<double>(); + test157<double>(); + test158<double>(); + test159<double>(); + test160<double>(); + test161<double>(); + test162<double>(); + test163<double>(); + test164<double>(); + test165<double>(); + test166<double>(); + test167<double>(); + test168<double>(); + test169<double>(); + test170<double>(); + test171<double>(); + test172<double>(); + test173<double>(); + test174<double>(); + test175<double>(); + test176<double>(); + test177<double>(); + test178<double>(); + test179<double>(); + test180<double>(); + test181<double>(); + test182<double>(); + test183<double>(); + test184<double>(); + test185<double>(); + test186<double>(); + test187<double>(); + test188<double>(); + test189<double>(); + test190<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile.cc new file mode 100644 index 000000000..69ddf658c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.14 ellint_3 + +#include <tr1/cmath> + +void +test01() +{ + float kf = 0.5F, nuf = 0.2F, phif = std::atan2(1.0F, 1.0F); + double kd = 0.5, nud = 0.2, phid = std::atan2(1.0, 1.0); + long double kl = 0.5L, nul = 0.2L, phil = std::atan2(1.0L, 1.0L); + + std::tr1::ellint_3(kf, nuf, phif); + std::tr1::ellint_3f(kf, nuf, phif); + std::tr1::ellint_3(kd, nud, phid); + std::tr1::ellint_3(kl, nul, phil); + std::tr1::ellint_3l(kl, nul, phil); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile_2.cc new file mode 100644 index 000000000..42647bb1e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.14 ellint_3 + +#include <tr1/math.h> + +void +test01() +{ + float kf = 0.5F, nuf = 0.2F, phif = std::atan2(1.0F, 1.0F); + double kd = 0.5, nud = 0.2, phid = std::atan2(1.0, 1.0); + long double kl = 0.5L, nul = 0.2L, phil = std::atan2(1.0L, 1.0L); + + ellint_3(kf, nuf, phif); + ellint_3f(kf, nuf, phif); + ellint_3(kd, nud, phid); + ellint_3(kl, nul, phil); + ellint_3l(kl, nul, phil); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_nan.cc new file mode 100644 index 000000000..977f3c55e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_nan.cc @@ -0,0 +1,57 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.15 expint + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::expint(xf); + float b = std::tr1::expintf(xf); + double c = std::tr1::expint(xd); + long double d = std::tr1::expint(xl); + long double e = std::tr1::expintl(xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_neg.cc new file mode 100644 index 000000000..acb51a430 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_neg.cc @@ -0,0 +1,127 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// expint + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data. +testcase_expint<double> data001[] = { + { -3.7832640295504591e-24, -50.000000000000000 }, + { -1.0489811642368024e-23, -49.000000000000000 }, + { -2.9096641904058423e-23, -48.000000000000000 }, + { -8.0741978427258127e-23, -47.000000000000000 }, + { -2.2415317597442998e-22, -46.000000000000000 }, + { -6.2256908094623838e-22, -45.000000000000000 }, + { -1.7299598742816476e-21, -44.000000000000000 }, + { -4.8094965569500181e-21, -43.000000000000000 }, + { -1.3377908810011775e-20, -42.000000000000000 }, + { -3.7231667764599780e-20, -41.000000000000000 }, + { -1.0367732614516570e-19, -40.000000000000000 }, + { -2.8887793015227007e-19, -39.000000000000000 }, + { -8.0541069142907499e-19, -38.000000000000000 }, + { -2.2470206975885714e-18, -37.000000000000000 }, + { -6.2733390097622421e-18, -36.000000000000000 }, + { -1.7527059389947371e-17, -35.000000000000000 }, + { -4.9006761183927874e-17, -34.000000000000000 }, + { -1.3713843484487468e-16, -33.000000000000000 }, + { -3.8409618012250666e-16, -32.000000000000000 }, + { -1.0767670386162383e-15, -31.000000000000000 }, + { -3.0215520106888128e-15, -30.000000000000000 }, + { -8.4877597783535618e-15, -29.000000000000000 }, + { -2.3869415119337330e-14, -28.000000000000000 }, + { -6.7206374352620390e-14, -27.000000000000000 }, + { -1.8946858856749785e-13, -26.000000000000000 }, + { -5.3488997553402167e-13, -25.000000000000000 }, + { -1.5123058939997059e-12, -24.000000000000000 }, + { -4.2826847956656722e-12, -23.000000000000000 }, + { -1.2149378956204371e-11, -22.000000000000000 }, + { -3.4532012671467559e-11, -21.000000000000000 }, + { -9.8355252906498815e-11, -20.000000000000000 }, + { -2.8078290970607954e-10, -19.000000000000000 }, + { -8.0360903448286769e-10, -18.000000000000000 }, + { -2.3064319898216547e-09, -17.000000000000000 }, + { -6.6404872494410427e-09, -16.000000000000000 }, + { -1.9186278921478670e-08, -15.000000000000000 }, + { -5.5656311111451816e-08, -14.000000000000000 }, + { -1.6218662188014328e-07, -13.000000000000000 }, + { -4.7510818246724931e-07, -12.000000000000000 }, + { -1.4003003042474418e-06, -11.000000000000000 }, + { -4.1569689296853246e-06, -10.000000000000000 }, + { -1.2447354178006272e-05, -9.0000000000000000 }, + { -3.7665622843924906e-05, -8.0000000000000000 }, + { -0.00011548173161033820, -7.0000000000000000 }, + { -0.00036008245216265867, -6.0000000000000000 }, + { -0.0011482955912753257, -5.0000000000000000 }, + { -0.0037793524098489058, -4.0000000000000000 }, + { -0.013048381094197037, -3.0000000000000000 }, + { -0.048900510708061125, -2.0000000000000000 }, + { -0.21938393439552029, -1.0000000000000000 }, +}; + +// Test function. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_expint<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::expint(Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_pos.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_pos.cc new file mode 100644 index 000000000..249a3f092 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_pos.cc @@ -0,0 +1,127 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// expint + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data. +testcase_expint<double> data001[] = { + { 1.8951178163559366, 1.0000000000000000 }, + { 4.9542343560018907, 2.0000000000000000 }, + { 9.9338325706254160, 3.0000000000000000 }, + { 19.630874470056217, 4.0000000000000000 }, + { 40.185275355803178, 5.0000000000000000 }, + { 85.989762142439204, 6.0000000000000000 }, + { 191.50474333550139, 7.0000000000000000 }, + { 440.37989953483827, 8.0000000000000000 }, + { 1037.8782907170896, 9.0000000000000000 }, + { 2492.2289762418782, 10.000000000000000 }, + { 6071.4063740986112, 11.000000000000000 }, + { 14959.532666397527, 12.000000000000000 }, + { 37197.688490689041, 13.000000000000000 }, + { 93192.513633965369, 14.000000000000000 }, + { 234955.85249076830, 15.000000000000000 }, + { 595560.99867083703, 16.000000000000000 }, + { 1516637.8940425171, 17.000000000000000 }, + { 3877904.3305974435, 18.000000000000000 }, + { 9950907.2510468438, 19.000000000000000 }, + { 25615652.664056588, 20.000000000000000 }, + { 66127186.355484918, 21.000000000000000 }, + { 171144671.30036369, 22.000000000000000 }, + { 443966369.83027118, 23.000000000000000 }, + { 1154115391.8491828, 24.000000000000000 }, + { 3005950906.5255489, 25.000000000000000 }, + { 7842940991.8981876, 26.000000000000000 }, + { 20496497119.880810, 27.000000000000000 }, + { 53645118592.314682, 28.000000000000000 }, + { 140599195758.40689, 29.000000000000000 }, + { 368973209407.27423, 30.000000000000000 }, + { 969455575968.39392, 31.000000000000000 }, + { 2550043566357.7866, 32.000000000000000 }, + { 6714640184076.4980, 33.000000000000000 }, + { 17698037244116.266, 34.000000000000000 }, + { 46690550144661.594, 35.000000000000000 }, + { 123285207991209.75, 36.000000000000000 }, + { 325798899867226.44, 37.000000000000000 }, + { 861638819996578.62, 38.000000000000000 }, + { 2280446200301902.5, 39.000000000000000 }, + { 6039718263611242.0, 40.000000000000000 }, + { 16006649143245042., 41.000000000000000 }, + { 42447960921368504., 42.000000000000000 }, + { 1.1263482901669667e+17, 43.000000000000000 }, + { 2.9904447186323366e+17, 44.000000000000000 }, + { 7.9439160357044531e+17, 45.000000000000000 }, + { 2.1113423886478239e+18, 46.000000000000000 }, + { 5.6143296808103434e+18, 47.000000000000000 }, + { 1.4936302131129930e+19, 48.000000000000000 }, + { 3.9754427479037444e+19, 49.000000000000000 }, + { 1.0585636897131690e+20, 50.000000000000000 }, +}; + +// Test function. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_expint<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::expint(Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile.cc new file mode 100644 index 000000000..c241aca73 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.15 expint + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + std::tr1::expint(xf); + std::tr1::expintf(xf); + std::tr1::expint(xd); + std::tr1::expint(xl); + std::tr1::expintl(xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile_2.cc new file mode 100644 index 000000000..6a3238d20 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.15 expint + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + expint(xf); + expintf(xf); + expint(xd); + expint(xl); + expintl(xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/check_nan.cc new file mode 100644 index 000000000..f6a920d7d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/check_nan.cc @@ -0,0 +1,59 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.4 hermite + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + unsigned int n = 5; + + float a = std::tr1::hermite(n, xf); + float b = std::tr1::hermitef(n, xf); + double c = std::tr1::hermite(n, xd); + long double d = std::tr1::hermite(n, xl); + long double e = std::tr1::hermitel(n, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile.cc new file mode 100644 index 000000000..0d1fc5eae --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.16 hermite + +#include <tr1/cmath> + +void +test01() +{ + float xf = 2.5F; + double xd = 2.5; + long double xl = 2.5L; + + unsigned int n = 5; + + std::tr1::hermite(n, xf); + std::tr1::hermitef(n, xf); + std::tr1::hermite(n, xd); + std::tr1::hermite(n, xl); + std::tr1::hermitel(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile_2.cc new file mode 100644 index 000000000..01e78d569 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.16 hermite + +#include <tr1/math.h> + +void +test01() +{ + float xf = 2.5F; + double xd = 2.5; + long double xl = 2.5L; + unsigned int n = 5; + + hermite(n, xf); + hermitef(n, xf); + hermite(n, xd); + hermite(n, xl); + hermitel(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc new file mode 100644 index 000000000..598d93144 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc @@ -0,0 +1,173 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.17 hyperg + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float af = std::numeric_limits<float>::quiet_NaN(); + double ad = std::numeric_limits<double>::quiet_NaN(); + long double al = std::numeric_limits<long double>::quiet_NaN(); + + float bf = 10.0F; + double bd = 10.0; + long double bl = 10.0L; + + float cf = 3.0F; + double cd = 3.0; + long double cl = 3.0L; + + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + float a = std::tr1::hyperg(af, bf, cf, xf); + float b = std::tr1::hypergf(af, bf, cf, xf); + double c = std::tr1::hyperg(ad, bd, cd, xd); + long double d = std::tr1::hyperg(al, bl, cl, xl); + long double e = std::tr1::hypergl(al, bl, cl, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test02() +{ + float af = 2.0F; + double ad = 2.0; + long double al = 2.0L; + + float bf = std::numeric_limits<float>::quiet_NaN(); + double bd = std::numeric_limits<double>::quiet_NaN(); + long double bl = std::numeric_limits<long double>::quiet_NaN(); + + float cf = 3.0F; + double cd = 3.0; + long double cl = 3.0L; + + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + float a = std::tr1::hyperg(af, bf, cf, xf); + float b = std::tr1::hypergf(af, bf, cf, xf); + double c = std::tr1::hyperg(ad, bd, cd, xd); + long double d = std::tr1::hyperg(al, bl, cl, xl); + long double e = std::tr1::hypergl(al, bl, cl, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test03() +{ + float af = 2.0F; + double ad = 2.0; + long double al = 2.0L; + + float bf = 10.0F; + double bd = 10.0; + long double bl = 10.0L; + + float cf = std::numeric_limits<float>::quiet_NaN(); + double cd = std::numeric_limits<double>::quiet_NaN(); + long double cl = std::numeric_limits<long double>::quiet_NaN(); + + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + float a = std::tr1::hyperg(af, bf, cf, xf); + float b = std::tr1::hypergf(af, bf, cf, xf); + double c = std::tr1::hyperg(ad, bd, cd, xd); + long double d = std::tr1::hyperg(al, bl, cl, xl); + long double e = std::tr1::hypergl(al, bl, cl, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +void +test04() +{ + float af = 2.0F; + double ad = 2.0; + long double al = 2.0L; + + float bf = 10.0F; + double bd = 10.0; + long double bl = 10.0L; + + float cf = 3.0F; + double cd = 3.0; + long double cl = 3.0L; + + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::hyperg(af, bf, cf, xf); + float b = std::tr1::hypergf(af, bf, cf, xf); + double c = std::tr1::hyperg(ad, bd, cd, xd); + long double d = std::tr1::hyperg(al, bl, cl, xl); + long double e = std::tr1::hypergl(al, bl, cl, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + test02(); + test03(); + test04(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_value.cc new file mode 100644 index 000000000..d7d0580f0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_value.cc @@ -0,0 +1,17195 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// hyperg + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data001[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data001[i].a), Tp(data001[i].b), + Tp(data001[i].c), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data002[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data002[i].a), Tp(data002[i].b), + Tp(data002[i].c), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data003[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data003[i].a), Tp(data003[i].b), + Tp(data003[i].c), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data004[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data004[i].a), Tp(data004[i].b), + Tp(data004[i].c), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data005[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data005[i].a), Tp(data005[i].b), + Tp(data005[i].c), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data006[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data006[i].a), Tp(data006[i].b), + Tp(data006[i].c), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data007[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data007[i].a), Tp(data007[i].b), + Tp(data007[i].c), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data008[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data008[i].a), Tp(data008[i].b), + Tp(data008[i].c), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data009[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data009[i].a), Tp(data009[i].b), + Tp(data009[i].c), Tp(data009[i].x)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data010[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data010[i].a), Tp(data010[i].b), + Tp(data010[i].c), Tp(data010[i].x)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data011[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data011[i].a), Tp(data011[i].b), + Tp(data011[i].c), Tp(data011[i].x)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data012[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data012[i].a), Tp(data012[i].b), + Tp(data012[i].c), Tp(data012[i].x)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data013[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data013[i].a), Tp(data013[i].b), + Tp(data013[i].c), Tp(data013[i].x)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data014[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data014[i].a), Tp(data014[i].b), + Tp(data014[i].c), Tp(data014[i].x)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data015[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data015[i].a), Tp(data015[i].b), + Tp(data015[i].c), Tp(data015[i].x)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data016[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data016[i].a), Tp(data016[i].b), + Tp(data016[i].c), Tp(data016[i].x)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data017[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data017[i].a), Tp(data017[i].b), + Tp(data017[i].c), Tp(data017[i].x)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data018[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data018[i].a), Tp(data018[i].b), + Tp(data018[i].c), Tp(data018[i].x)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data019[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data019[i].a), Tp(data019[i].b), + Tp(data019[i].c), Tp(data019[i].x)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data020[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test020() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data020) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data020[i].a), Tp(data020[i].b), + Tp(data020[i].c), Tp(data020[i].x)); + const Tp f0 = data020[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data021[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test021() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data021) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data021[i].a), Tp(data021[i].b), + Tp(data021[i].c), Tp(data021[i].x)); + const Tp f0 = data021[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data022[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test022() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data022) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data022[i].a), Tp(data022[i].b), + Tp(data022[i].c), Tp(data022[i].x)); + const Tp f0 = data022[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data023[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test023() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data023) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data023[i].a), Tp(data023[i].b), + Tp(data023[i].c), Tp(data023[i].x)); + const Tp f0 = data023[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data024[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test024() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data024) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data024[i].a), Tp(data024[i].b), + Tp(data024[i].c), Tp(data024[i].x)); + const Tp f0 = data024[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data025[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test025() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data025) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data025[i].a), Tp(data025[i].b), + Tp(data025[i].c), Tp(data025[i].x)); + const Tp f0 = data025[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data026[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test026() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data026) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data026[i].a), Tp(data026[i].b), + Tp(data026[i].c), Tp(data026[i].x)); + const Tp f0 = data026[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data027[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test027() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data027) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data027[i].a), Tp(data027[i].b), + Tp(data027[i].c), Tp(data027[i].x)); + const Tp f0 = data027[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data028[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test028() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data028) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data028[i].a), Tp(data028[i].b), + Tp(data028[i].c), Tp(data028[i].x)); + const Tp f0 = data028[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data029[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test029() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data029) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data029[i].a), Tp(data029[i].b), + Tp(data029[i].c), Tp(data029[i].x)); + const Tp f0 = data029[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data030[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test030() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data030) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data030[i].a), Tp(data030[i].b), + Tp(data030[i].c), Tp(data030[i].x)); + const Tp f0 = data030[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data031[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test031() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data031) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data031[i].a), Tp(data031[i].b), + Tp(data031[i].c), Tp(data031[i].x)); + const Tp f0 = data031[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data032[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test032() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data032) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data032[i].a), Tp(data032[i].b), + Tp(data032[i].c), Tp(data032[i].x)); + const Tp f0 = data032[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data033[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test033() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data033) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data033[i].a), Tp(data033[i].b), + Tp(data033[i].c), Tp(data033[i].x)); + const Tp f0 = data033[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data034[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test034() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data034) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data034[i].a), Tp(data034[i].b), + Tp(data034[i].c), Tp(data034[i].x)); + const Tp f0 = data034[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data035[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test035() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data035) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data035[i].a), Tp(data035[i].b), + Tp(data035[i].c), Tp(data035[i].x)); + const Tp f0 = data035[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data036[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test036() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data036) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data036[i].a), Tp(data036[i].b), + Tp(data036[i].c), Tp(data036[i].x)); + const Tp f0 = data036[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data037[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test037() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data037) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data037[i].a), Tp(data037[i].b), + Tp(data037[i].c), Tp(data037[i].x)); + const Tp f0 = data037[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data038[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test038() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data038) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data038[i].a), Tp(data038[i].b), + Tp(data038[i].c), Tp(data038[i].x)); + const Tp f0 = data038[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data039[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test039() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data039) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data039[i].a), Tp(data039[i].b), + Tp(data039[i].c), Tp(data039[i].x)); + const Tp f0 = data039[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data040[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test040() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data040) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data040[i].a), Tp(data040[i].b), + Tp(data040[i].c), Tp(data040[i].x)); + const Tp f0 = data040[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data041[] = { + { 0.91383715388743758, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.92151232618202283, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.92955086110354823, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.93798900119104844, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.94686887307107304, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.95623987262143295, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.96616049387450154, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.97670078782187519, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.98794573712298384, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0129947682256604, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0270980168168973, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0425304520063581, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0595915916161471, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0787052023767585, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.1005053642285867, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.1260196351148746, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.1571341977338991, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.1982111053717450, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test041() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data041) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data041[i].a), Tp(data041[i].b), + Tp(data041[i].c), Tp(data041[i].x)); + const Tp f0 = data041[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data042[] = { + { 0.95255425675562733, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.95712841850078245, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.96184734120034532, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.96672141255196242, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.97176228710138646, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.97698311668286286, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.98239883902556069, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.98802654401961032, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.99388594556732701, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0063957328951061, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0131053706824598, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0201679332118803, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0276315524377497, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0355569942816882, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0440233080381554, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0531375808028993, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0630536689840200, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0740149570414563, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test042() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data042) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data042[i].a), Tp(data042[i].b), + Tp(data042[i].c), Tp(data042[i].x)); + const Tp f0 = data042[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data043[] = { + { 0.96694084713323891, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.97024454918852587, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.97362815600391461, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.97709622064205115, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.98065374770570624, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.98430626119885489, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.98805988669621037, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.99192145185739655, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.99589861079880937, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0042354366729904, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0086161755545404, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0131552481403503, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0178679218284707, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0227723400312978, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0278904483717863, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0332494012993472, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0388838453357794, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0448400142331342, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test043() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data043) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data043[i].a), Tp(data043[i].b), + Tp(data043[i].c), Tp(data043[i].x)); + const Tp f0 = data043[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data044[] = { + { 0.97456073259047449, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.97715689327833344, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.97980416868943099, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.98250498942832509, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.98526199049760832, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.98807803762902813, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.99095625840920332, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.99390007937387959, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.99691327061866730, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0031648997547440, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0064131494767281, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0097505810668461, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0131838138968663, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0167204326938339, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0203692279382193, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0241405318057402, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0280467087844301, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0321029179180026, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test044() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data044) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data044[i].a), Tp(data044[i].b), + Tp(data044[i].c), Tp(data044[i].x)); + const Tp f0 = data044[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data045[] = { + { 0.97930223035212161, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.98144406855076416, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.98362155940297302, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.98583616201745805, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.98808944235385077, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.99038308530635433, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.99271890872975732, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.99509887982916734, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99752513445413604, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0025260228440118, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0051060015613384, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0077430276253163, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0104405359789990, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0132023689128868, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0160328583559475, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0189369344885053, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0219202735809589, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0249895076611382, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test045() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data045) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data045[i].a), Tp(data045[i].b), + Tp(data045[i].c), Tp(data045[i].x)); + const Tp f0 = data045[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data046[] = { + { 0.84089972268671609, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.85410196624968437, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.86811566011579933, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.88303688022450544, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.89897948556635565, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.91607978309961580, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.93450283399425305, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.95445115010332193, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.97617696340303095, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0263340389897240, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0557280900008410, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0889331564394962, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.1270166537925830, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.1715728752538095, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.2251482265544145, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.2922212642709541, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.3819660112501042, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.5194938532959119, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test046() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data046) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data046[i].a), Tp(data046[i].b), + Tp(data046[i].c), Tp(data046[i].x)); + const Tp f0 = data046[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data047[] = { + { 0.90992197313391499, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.91822592662244507, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.92687104566419531, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.93588628166548815, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.94530459215552909, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.95516374875247467, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.96550736800511827, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.97638624595136270, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.98786011482678993, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0128914530682316, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0266391040215350, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0413732738729464, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0572599536532992, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0745166004060953, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0934387388831386, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.1144486980714641, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.1381966011250106, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.1658171625342397, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test047() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data047) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data047[i].a), Tp(data047[i].b), + Tp(data047[i].c), Tp(data047[i].x)); + const Tp f0 = data047[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data048[] = { + { 0.93641908369732885, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.94256349654111315, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.94890138508461319, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.95544578858430007, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.96221121193620718, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.96921386948293542, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.97647198488394704, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.98400616412578656, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.99183986544963032, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0085177124149158, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0174294150407122, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0267781897388850, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0366157405967285, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0470052068648839, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0580253905513313, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0697774741209765, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0823965556448414, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0960739512057103, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test048() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data048) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data048[i].a), Tp(data048[i].b), + Tp(data048[i].c), Tp(data048[i].x)); + const Tp f0 = data048[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data049[] = { + { 0.95069883346936235, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.95559618047704165, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.96061938755931653, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.96577553912851344, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.97107239473807716, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.97651848528588503, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.98212322830227139, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.98789706736195781, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.99385164237825074, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0063568569383123, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0129389344715818, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0197653907773940, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0268583912277143, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0342438793937092, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0419526514766855, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0500219124976327, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0584976491907043, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0674385240268101, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test049() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data049) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data049[i].a), Tp(data049[i].b), + Tp(data049[i].c), Tp(data049[i].x)); + const Tp f0 = data049[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data050[] = { + { 0.95968319138913893, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.96376169072755768, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.96792900082729316, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.97218942798115737, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.97654763592586857, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.98100869054353856, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.98557811238699278, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.99026193885795544, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99506679842072221, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0050696417919618, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0102847452747090, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0156554225057022, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0211930882963096, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0269107343740711, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0328232917216298, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0389481230247195, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0453057164134614, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0519207114461246, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test050() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data050) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data050[i].a), Tp(data050[i].b), + Tp(data050[i].c), Tp(data050[i].x)); + const Tp f0 = data050[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data051[] = { + { 0.72547625011001171, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.74535599249992990, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.76696498884737041, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.79056941504209477, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.81649658092772603, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.84515425472851657, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.87705801930702920, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.91287092917527690, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.95346258924559224, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0540925533894598, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.1180339887498949, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.1952286093343938, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.2909944487358056, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.4142135623730949, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.5811388300841900, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.8257418583505536, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.2360679774997898, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 3.1622776601683782, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test051() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data051) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data051[i].a), Tp(data051[i].b), + Tp(data051[i].c), Tp(data051[i].x)); + const Tp f0 = data051[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data052[] = { + { 0.83664260086443798, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.85046584300227146, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.86509574979651593, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.88062082573041867, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.89714464248521586, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.91478946588967558, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.93370105322348573, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.95405511057700887, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.97606616007978142, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0261916902334731, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0550723519434702, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0872106588188091, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.1233801699379020, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.1646752981725688, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.2127272514219511, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.2701518651068637, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3416407864998725, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.4374795179111102, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test052() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data052) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data052[i].a), Tp(data052[i].b), + Tp(data052[i].c), Tp(data052[i].x)); + const Tp f0 = data052[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data053[] = { + { 0.88195381730235833, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.89265078469555093, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.90382937908303707, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.91553161389880577, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.92780530349281576, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.94070521140346042, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.95429450630523349, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.96864663325785849, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.98384775588541795, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0172258496884334, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0356742479163459, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0555293036908924, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0770231491562379, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.1004557416484888, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.1262270515731978, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.1548932919125086, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.1872757758134724, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.2247091713458949, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test053() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data053) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data053[i].a), Tp(data053[i].b), + Tp(data053[i].c), Tp(data053[i].x)); + const Tp f0 = data053[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data054[] = { + { 0.90716919697107301, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.91592299407142519, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.92500027075874236, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.93442464185467167, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.94422248683737009, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.95442341810133347, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.96506085725516400, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.97617275213704069, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.98780247986309799, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0128233505813447, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0263406246541855, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0406326381700366, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0557966239802845, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0719515075786321, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0892457392422055, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.1078695188000958, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.1280752258974340, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.1502152002706476, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test054() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data054) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data054[i].a), Tp(data054[i].b), + Tp(data054[i].c), Tp(data054[i].x)); + const Tp f0 = data054[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data055[] = { + { 0.92336416053263093, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.93078397248364519, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.93843714333600226, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.94633837784068076, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.95450388104967909, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.96295158125742764, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.97170139827854296, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.98077556918512687, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99019904777750845, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0102104261941198, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0208669540935695, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0320118665407505, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0436944599504387, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0559728828278145, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0689166967761712, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0826105758119842, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0971599106346146, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.1126998828023964, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test055() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data055) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data055[i].a), Tp(data055[i].b), + Tp(data055[i].c), Tp(data055[i].x)); + const Tp f0 = data055[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data056[] = { + { 0.52275983209457511, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.54700336898142965, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.57468955512601971, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.60665490543315015, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.64403057859056123, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.68838183648623719, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.74193265039311085, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.80794095908995300, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.89135275749639320, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.1469266219310688, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.3552340708357489, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.6690840478838305, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2.1815415453174483, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 3.1156892546032235, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 5.1109077417760416, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 10.560352936466296, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 33.541019662496815, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 300.66343065819501, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test056() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data056) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data056[i].a), Tp(data056[i].b), + Tp(data056[i].c), Tp(data056[i].x)); + const Tp f0 = data056[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data057[] = { + { 0.68252041951139264, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.70394732624993395, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.72748884971552041, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.75351147371199689, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.78247589005573748, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.81497017420249818, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.85175826875009564, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.89385278481745867, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.94262778709507411, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0687327277420910, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.1529725508983291, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.2592587134058799, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.3985773194637892, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.5909902576697317, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.8776023607249752, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2.3582499003694646, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 3.3541019662496838, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6.7198400278577859, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test057() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data057) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data057[i].a), Tp(data057[i].b), + Tp(data057[i].c), Tp(data057[i].x)); + const Tp f0 = data057[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data058[] = { + { 0.75755211927082589, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.77603550233010998, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.79596241913438492, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.81753360792105201, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.84099165409805521, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.86663303852180873, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.89482475828629970, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.92602774279590350, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.96083064727087386, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0445570841313008, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0959004638926031, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.1560106261370562, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.2278121770678145, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.3158640214709998, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.4278095344155000, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.5778700502946612, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.7972173289196469, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.1789970569269732, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test058() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data058) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data058[i].a), Tp(data058[i].b), + Tp(data058[i].c), Tp(data058[i].x)); + const Tp f0 = data058[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data059[] = { + { 0.80270093579329471, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.81884974572462788, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.83605266330015271, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.85443340762795972, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.87413762182790655, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.89533826626907331, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.91824276674115268, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.94310265050720576, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.97022678857609712, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0329098673199812, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0695865684573389, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.1108642103944570, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.1578795055970506, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.2122394794169442, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.2763274721556934, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.3539179650251021, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.4515986118197148, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.5829284571614219, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test059() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data059) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data059[i].a), Tp(data059[i].b), + Tp(data059[i].c), Tp(data059[i].x)); + const Tp f0 = data059[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data060[] = { + { 0.83322694172301959, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.84753931604765664, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.86265784532195022, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.87866479300707079, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.89565516540263501, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.91373946207610557, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.93304721345881891, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.95373159512905148, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.97597554238828121, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0260752851887982, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0545371197996178, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0858099017045830, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.1204416568688709, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.1591587835964847, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.2029564720303347, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.2532588722007874, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.3122319926925459, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.3834948587364100, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test060() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data060) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data060[i].a), Tp(data060[i].b), + Tp(data060[i].c), Tp(data060[i].x)); + const Tp f0 = data060[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data061[] = { + { 0.37727530159464628, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.39816010922169010, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.42283703041362453, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.45255640448730505, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.48919507154431141, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.53569358917731880, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.59689778897029566, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.68128587569875731, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.80478739308790359, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.3408664196153621, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 2.0175364359923860, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 3.6011214553736646, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 8.1799429939495312, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 25.644834637536000, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 123.13738891597615, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1088.7122410321333, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 27358.291704709951, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 8174369.0266731177, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test061() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data061) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data061[i].a), Tp(data061[i].b), + Tp(data061[i].c), Tp(data061[i].x)); + const Tp f0 = data061[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data062[] = { + { 0.53905528308450834, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.56235533974376162, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.58887657983263575, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.61941227047262915, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.65504896640793853, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.69731666644529999, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.74844073299399128, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.81178446800105752, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.89266981277598023, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1497248473106778, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.3729717112654571, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.7374982340374392, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 2.4134479340960580, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3.9191255240471192, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 8.3316373077761270, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 28.323020339843335, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 225.84286572747891, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 12757.127591286655, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test062() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data062) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data062[i].a), Tp(data062[i].b), + Tp(data062[i].c), Tp(data062[i].x)); + const Tp f0 = data062[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data063[] = { + { 0.62672622092226071, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.64931010269769829, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.67448067519076316, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.70276306239803676, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.73484179773087555, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.77162761412743897, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.81436116844816531, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.86477994787944557, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.92539820516603888, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0945599448210315, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.2190897395597264, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.3916844336856475, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.6484497630432013, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 2.0717772717131155, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2.8893613630810924, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 4.9459404075413529, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 13.487394149998716, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 136.57616044013972, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test063() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data063) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data063[i].a), Tp(data063[i].b), + Tp(data063[i].c), Tp(data063[i].x)); + const Tp f0 = data063[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data064[] = { + { 0.68421604440344341, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.70548098055548891, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.72884342311710348, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.75466953437856243, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.78342090924662600, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.81568884278645049, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.85224480241465206, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.89411692571131696, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.94270986892954756, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0688682849120232, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1537004376097553, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.2615455028370031, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.4045541456153436, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.6057216489444517, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.9146603020550739, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2.4617931307620298, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 3.7267799624996498, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 9.3880118036248401, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test064() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data064) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data064[i].a), Tp(data064[i].b), + Tp(data064[i].c), Tp(data064[i].x)); + const Tp f0 = data064[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data065[] = { + { 0.72547625011001171, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.74535599249992990, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.76696498884737041, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.79056941504209477, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.81649658092772603, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.84515425472851657, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.87705801930702920, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.91287092917527690, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.95346258924559224, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0540925533894598, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.1180339887498949, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1952286093343938, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.2909944487358056, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.4142135623730949, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.5811388300841900, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.8257418583505536, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 2.2360679774997898, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 3.1622776601683782, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test065() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data065) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data065[i].a), Tp(data065[i].b), + Tp(data065[i].c), Tp(data065[i].x)); + const Tp f0 = data065[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data066[] = { + { 0.26690449940521566, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.28252302866181805, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.30123616141153819, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.32421384687602628, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.35334630811776752, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.39191793127467034, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.44620488618129206, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.52980896919265685, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.67754711477562357, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.9567557771780317, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 6.1816042148333086, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 35.653088618561227, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 377.51482843179906, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 7645.8816551195359, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 354791.74537980522, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 57009889.966638684, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 83771357024.863937, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 25866972896376408., 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test066() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data066) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data066[i].a), Tp(data066[i].b), + Tp(data066[i].c), Tp(data066[i].x)); + const Tp f0 = data066[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data067[] = { + { 0.40342659436153405, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.42420571192034318, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.44852768286073008, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.47751245808592863, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.51283632632707754, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.55713468814894307, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.61481320817757312, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.69383483410097202, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.81012002526006033, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3622225506603911, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 2.2349513086109001, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 5.1864917536761723, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 21.020560423779411, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 175.19649997100612, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 3467.1587803688708, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 225003.88683445856, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 110837674.65652709, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6688966964170.6807, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test067() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data067) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data067[i].a), Tp(data067[i].b), + Tp(data067[i].c), Tp(data067[i].x)); + const Tp f0 = data067[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data068[] = { + { 0.48716309885816761, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.50965859152542281, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.53554809210658971, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.56576689207507136, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.60164849637133688, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.64516711595404375, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.69938278735493542, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.76931621518401860, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.86381808725530695, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.2152051956815531, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.6052546785425543, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 2.4765586046012635, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 5.1564492216997486, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 18.446158392136365, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 150.44577670123971, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 3862.6317400115768, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 632428.34833625401, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 7426927663.3808765, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test068() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data068) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data068[i].a), Tp(data068[i].b), + Tp(data068[i].c), Tp(data068[i].x)); + const Tp f0 = data068[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data069[] = { + { 0.54703266209548362, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.56997321774144971, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.59603026159654970, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.62596978851120511, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.66084565876898926, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.70215256667232839, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.75208916592008568, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.81403631111658648, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.89348608489854608, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1517793185139173, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3878110313656598, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.8061071794572381, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 2.7148594517859586, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 5.4529435709049361, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 19.487310275377109, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 191.69079165937470, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 10218.543981792311, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 23160836.646583911, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test069() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data069) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data069[i].a), Tp(data069[i].b), + Tp(data069[i].c), Tp(data069[i].x)); + const Tp f0 = data069[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data070[] = { + { 0.59292067298616002, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.61572496720679915, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.64135339122875623, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.67043457419280483, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.70380956268170980, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.74263251901495231, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.78853555445528278, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.84391122775673766, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.91242401018807406, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1169059681274873, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2825928301302667, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.5385937789924939, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.9895771187893898, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2.9707335806970168, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 6.0299506157180467, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 24.259090336955577, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 406.27267173257223, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 174330.03997220192, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test070() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data070) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data070[i].a), Tp(data070[i].b), + Tp(data070[i].c), Tp(data070[i].x)); + const Tp f0 = data070[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data071[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test071() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data071) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data071[i].a), Tp(data071[i].b), + Tp(data071[i].c), Tp(data071[i].x)); + const Tp f0 = data071[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data072[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test072() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data072) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data072[i].a), Tp(data072[i].b), + Tp(data072[i].c), Tp(data072[i].x)); + const Tp f0 = data072[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data073[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test073() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data073) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data073[i].a), Tp(data073[i].b), + Tp(data073[i].c), Tp(data073[i].x)); + const Tp f0 = data073[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data074[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test074() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data074) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data074[i].a), Tp(data074[i].b), + Tp(data074[i].c), Tp(data074[i].x)); + const Tp f0 = data074[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data075[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test075() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data075) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data075[i].a), Tp(data075[i].b), + Tp(data075[i].c), Tp(data075[i].x)); + const Tp f0 = data075[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data076[] = { + { 0.84089972268671609, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.85410196624968437, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.86811566011579933, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.88303688022450544, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.89897948556635565, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.91607978309961580, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.93450283399425305, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.95445115010332193, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.97617696340303095, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0263340389897240, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0557280900008410, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0889331564394962, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.1270166537925830, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.1715728752538095, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.2251482265544145, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.2922212642709541, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.3819660112501042, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.5194938532959119, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test076() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data076) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data076[i].a), Tp(data076[i].b), + Tp(data076[i].c), Tp(data076[i].x)); + const Tp f0 = data076[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data077[] = { + { 0.90992197313391499, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.91822592662244507, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.92687104566419531, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.93588628166548815, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.94530459215552909, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.95516374875247467, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.96550736800511827, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.97638624595136270, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.98786011482678993, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0128914530682316, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0266391040215350, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0413732738729464, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0572599536532992, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0745166004060953, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0934387388831386, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.1144486980714641, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.1381966011250106, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.1658171625342397, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test077() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data077) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data077[i].a), Tp(data077[i].b), + Tp(data077[i].c), Tp(data077[i].x)); + const Tp f0 = data077[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data078[] = { + { 0.93641908369732885, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.94256349654111315, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.94890138508461319, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.95544578858430007, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.96221121193620718, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.96921386948293542, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.97647198488394704, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.98400616412578656, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.99183986544963032, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0085177124149158, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0174294150407122, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0267781897388850, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0366157405967285, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0470052068648839, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0580253905513313, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0697774741209765, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0823965556448414, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0960739512057103, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test078() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data078) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data078[i].a), Tp(data078[i].b), + Tp(data078[i].c), Tp(data078[i].x)); + const Tp f0 = data078[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data079[] = { + { 0.95069883346936235, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.95559618047704165, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.96061938755931653, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.96577553912851344, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.97107239473807716, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.97651848528588503, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.98212322830227139, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.98789706736195781, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.99385164237825074, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0063568569383123, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0129389344715818, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0197653907773940, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0268583912277143, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0342438793937092, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0419526514766855, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0500219124976327, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0584976491907043, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0674385240268101, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test079() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data079) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data079[i].a), Tp(data079[i].b), + Tp(data079[i].c), Tp(data079[i].x)); + const Tp f0 = data079[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data080[] = { + { 0.95968319138913893, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.96376169072755768, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.96792900082729316, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.97218942798115737, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.97654763592586857, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.98100869054353856, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.98557811238699278, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.99026193885795544, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99506679842072221, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0050696417919618, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0102847452747090, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0156554225057022, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0211930882963096, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0269107343740711, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0328232917216298, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0389481230247195, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0453057164134614, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0519207114461246, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test080() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data080) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data080[i].a), Tp(data080[i].b), + Tp(data080[i].c), Tp(data080[i].x)); + const Tp f0 = data080[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data081[] = { + { 0.71317098463599404, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.73473333112764871, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.75804035866024377, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.78333938207622600, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.81093021621632877, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.84118059155303226, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.87454754822497005, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.91160778396977304, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.95310179804324857, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0536051565782629, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.1157177565710485, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.1889164797957747, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.2770640594149765, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.3862943611198899, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.5271512197902593, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.7199611490370503, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.0117973905426232, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2.5584278811044912, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test081() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data081) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data081[i].a), Tp(data081[i].b), + Tp(data081[i].c), Tp(data081[i].x)); + const Tp f0 = data081[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data082[] = { + { 0.83165649828125576, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.84626246650116577, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.86165287670267410, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.87790681762615241, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.89511583784087689, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.91338673957393823, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.93284521667331954, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.95364066873549813, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.97595268969924187, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0260530485179122, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0544523154103413, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0856358366643180, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.1201824010510930, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.1588830833596719, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.2028682930536780, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.2538561433469468, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3147120107267418, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.3910528844853491, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test082() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data082) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data082[i].a), Tp(data082[i].b), + Tp(data082[i].c), Tp(data082[i].x)); + const Tp f0 = data082[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data083[] = { + { 0.87917686994924527, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.89033956110358414, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.90196195126098366, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.91408080149514692, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.92673756761314952, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.93997926630123407, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.95385955885019291, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.96844012412988900, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.98379242268046208, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0171615499181177, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0353950776091037, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0548437030651112, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0756840039415978, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0981384722661196, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.1224950318916129, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.1491396357184527, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.1786158344507012, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.2117500593515478, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test083() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data083) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data083[i].a), Tp(data083[i].b), + Tp(data083[i].c), Tp(data083[i].x)); + const Tp f0 = data083[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data084[] = { + { 0.90538259348578409, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.91444830598832050, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.92381915945974002, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.93351553488501815, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.94356001859234884, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.95397775039949584, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.96479684710618019, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.97604892281308531, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.98776973540356938, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0127864273812119, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0261830717772533, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0402531144740719, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0550712790827002, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0707271945059007, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0873302420658923, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.1050168587085545, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.1239622188477687, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.1444006183097781, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test084() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data084) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data084[i].a), Tp(data084[i].b), + Tp(data084[i].c), Tp(data084[i].x)); + const Tp f0 = data084[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data085[] = { + { 0.92211295632330403, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.92975727737040659, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.93761992348333467, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.94571346180587801, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.95405164371146867, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.96264956879205954, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.97152388013493096, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.98069299877709348, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99017740778385854, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0101865087004833, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0207660479892111, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0317718013185031, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0432419144892398, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0552206786504446, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0677601383233675, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0809223485579968, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0947826783002668, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.1094349304493603, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test085() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data085) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data085[i].a), Tp(data085[i].b), + Tp(data085[i].c), Tp(data085[i].x)); + const Tp f0 = data085[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data086[] = { + { 0.52631578947368429, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.55555555555555558, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.58823529411764708, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.62500000000000000, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.66666666666666663, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.71428571428571430, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.76923076923076927, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.83333333333333337, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.90909090909090906, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.1111111111111112, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.2500000000000000, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.4285714285714286, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.6666666666666663, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 2.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 2.5000000000000004, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 3.3333333333333330, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 5.0000000000000009, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9.9999999999999929, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test086() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data086) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data086[i].a), Tp(data086[i].b), + Tp(data086[i].c), Tp(data086[i].x)); + const Tp f0 = data086[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data087[] = { + { 0.70351947549341520, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.72637503722092711, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.75099661564391251, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.77761647796730871, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.80651221621216451, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.83801894346580275, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.87254582050258467, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.91059888544083678, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.95281329145592386, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0532154477379738, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.1138692114741471, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.1838976095305187, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.2660586631630237, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.3644676665613118, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.4856585347316102, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.6409590443536872, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.8528798927325769, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 2.1789423102929644, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test087() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data087) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data087[i].a), Tp(data087[i].b), + Tp(data087[i].c), Tp(data087[i].x)); + const Tp f0 = data087[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data088[] = { + { 0.78068027379106253, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.79924541976981278, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.81891305585650942, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.83979799626213270, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.86203315303160166, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.88577352485361693, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.91120135738402208, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.93853291956703588, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.96802755388922956, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0348375559194773, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0730246119544820, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.1151788396279341, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.1621066403893472, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.2148922218710421, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.2750496810838674, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.3448048570872917, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.4276833109859521, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.5299976259379788, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test088() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data088) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data088[i].a), Tp(data088[i].b), + Tp(data088[i].c), Tp(data088[i].x)); + const Tp f0 = data088[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data089[] = { + { 0.82510759951857582, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.84072786892782092, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.85710884896562356, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.87431674418118333, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.89242659229727017, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.91152392685930339, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.93170685950993570, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.95308871926790661, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.97580144325325802, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0258682619030324, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0536269616706000, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0835447330793833, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.1159538758396654, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.1512736659291880, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.1900463690116090, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.2329961591622411, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.2811334345669059, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.3359629014132051, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test089() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data089) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data089[i].a), Tp(data089[i].b), + Tp(data089[i].c), Tp(data089[i].x)); + const Tp f0 = data089[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data090[] = { + { 0.85426123653345876, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.86774543390930370, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.88178859537254239, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.89643269097060951, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.91172456687216763, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.92771674975966134, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.94446842993888647, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.96204667481937678, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.98052794339012128, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0205643671068179, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0423395201078882, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0654651277885334, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0901078068101382, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.1164691415928940, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.1447972335326551, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.1754040384534161, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.2086928679893112, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.2452055640510711, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test090() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data090) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data090[i].a), Tp(data090[i].b), + Tp(data090[i].c), Tp(data090[i].x)); + const Tp f0 = data090[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data091[] = { + { 0.25646288779245091, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.28273129096174382, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.31438201170962976, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.35308837890625017, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.40123456790123463, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.46230737192836319, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.54156016946185359, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.64718364197530875, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.79246636158732342, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.3103947568968148, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.8017578125000004, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 2.6374427321949185, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 4.1975308641975282, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 7.4999999999999964, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 15.859375000000012, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 43.734567901234513, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 194.99999999999994, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2777.4999999999832, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test091() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data091) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data091[i].a), Tp(data091[i].b), + Tp(data091[i].c), Tp(data091[i].x)); + const Tp f0 = data091[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data092[] = { + { 0.46398891966759004, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.49382716049382713, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.52768166089965396, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.56640624999999978, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.61111111111111116, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.66326530612244894, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.72485207100591698, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.79861111111111094, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.88842975206611552, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1419753086419753, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.3281249999999998, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.5816326530612239, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.9444444444444444, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 2.5000000000000000, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 3.4374999999999996, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 5.2777777777777715, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 9.9999999999999947, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 32.499999999999837, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test092() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data092) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data092[i].a), Tp(data092[i].b), + Tp(data092[i].c), Tp(data092[i].x)); + const Tp f0 = data092[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data093[] = { + { 0.57476744883397501, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.60302731682513933, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.63425708719096396, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.66895764182970419, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.70775063063963428, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.75141762103495924, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.80095569442603298, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.85765823887436754, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.92323549576335540, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0911622464839472, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.2013226178607666, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.3373332072682687, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.5099074378209716, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.7368822229245819, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2.0505871832661429, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 2.5172389775867967, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 3.3015631983556144, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 5.0005935155044519, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test093() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data093) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data093[i].a), Tp(data093[i].b), + Tp(data093[i].c), Tp(data093[i].x)); + const Tp f0 = data093[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data094[] = { + { 0.64582752605387961, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.67184161997264169, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.70012779922368040, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.73100784656910256, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.76486919089091077, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.80218301124334579, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.84352883533234446, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.88962858902212572, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.94139473468584123, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0669812691939897, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1443996012177726, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.2350966976721314, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.3431264370409088, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.4745266814162399, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.6388137104840066, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.8522074849776518, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 2.1458016978417458, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 2.5927464669826339, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test094() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data094) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data094[i].a), Tp(data094[i].b), + Tp(data094[i].c), Tp(data094[i].x)); + const Tp f0 = data094[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data095[] = { + { 0.69583236336670629, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.71968920666899694, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.74533885416044232, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.77300145361503014, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.80293630810919514, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.83545132638592035, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.87091544744412508, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.90977522877919847, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.95257738192069130, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0528968282789379, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.1123617169062123, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1798254572896132, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.2572069000522696, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.3471600884974377, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.4535032279573519, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.5820245752814948, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.7421756366906538, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.9513145531098233, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test095() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data095) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data095[i].a), Tp(data095[i].b), + Tp(data095[i].c), Tp(data095[i].x)); + const Tp f0 = data095[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data096[] = { + { 0.12307420104127871, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.13818870041457423, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.15739165631811691, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.18249038606882068, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.21644171225027786, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.26433326159804160, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.33544459430654533, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.44788516696232517, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.63989153514168362, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.7568608796813312, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 3.5836558871799027, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 8.8077526749963226, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 27.285841702089190, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 113.55555555555557, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 706.24023437500091, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 8064.1687976651992, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 271267.22222222196, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 123456789.99999890, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test096() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data096) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data096[i].a), Tp(data096[i].b), + Tp(data096[i].c), Tp(data096[i].x)); + const Tp f0 = data096[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data097[] = { + { 0.28363728383055758, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.30933003169808387, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.33998437757128797, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.37713553224291119, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.42299736538419658, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.48086597727600106, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.55583495759293045, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.65612850114039667, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.79573668772968120, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3184712058058303, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.8576958065941214, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 2.8759509651764228, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 5.1046225531822182, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 11.095238095238095, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 32.797154017857174, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 158.01935680536477, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1815.9523809523814, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 163302.14285714156, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test097() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data097) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data097[i].a), Tp(data097[i].b), + Tp(data097[i].c), Tp(data097[i].x)); + const Tp f0 = data097[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data098[] = { + { 0.39006633302741794, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.41898885698103294, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.45245557983812590, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.49160548618861633, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.53798419230517980, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.59373881442067344, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.66193391357076115, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.74708402736952129, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.85609281019430605, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.1974451135148187, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.4820886036706347, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.9201183180477521, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2.6569338297733336, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 4.0634920634920650, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 7.3102678571428568, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 17.512574302697733, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 74.206349206349131, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1342.8571428571363, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test098() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data098) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data098[i].a), Tp(data098[i].b), + Tp(data098[i].c), Tp(data098[i].x)); + const Tp f0 = data098[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data099[] = { + { 0.46726928123633193, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.49687547629934464, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.53045208856322235, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.56884765624999978, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.61316872427983526, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.66488500161969544, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.72598998634501577, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.79925411522633782, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.88863845062192193, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1423563481176653, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3302951388888888, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.5889212827988335, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.9650205761316870, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 2.5555555555555549, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 3.5937500000000013, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 5.7818930041152203, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 12.222222222222220, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 54.999999999999780, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test099() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data099) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data099[i].a), Tp(data099[i].b), + Tp(data099[i].c), Tp(data099[i].x)); + const Tp f0 = data099[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data100[] = { + { 0.52631578947368429, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.55555555555555558, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.58823529411764708, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.62500000000000000, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.66666666666666663, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.71428571428571430, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.76923076923076927, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.83333333333333337, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.90909090909090906, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1111111111111112, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2500000000000000, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.4285714285714286, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.6666666666666663, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2.0000000000000000, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 2.5000000000000004, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 3.3333333333333330, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 5.0000000000000009, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9.9999999999999929, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test100() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data100) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data100[i].a), Tp(data100[i].b), + Tp(data100[i].c), Tp(data100[i].x)); + const Tp f0 = data100[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data101[] = { + { 0.058479236576646373, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.065788544763137669, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.075184824937824662, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.087707688693157260, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.10521567442213345, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.13135877960541525, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.17423854066297104, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.25492082527223525, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.44025895219654843, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 3.3698615820910360, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 17.997089220808483, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 153.73298291118951, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2159.1667587825627, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 55188.105263157879, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 3191209.3921857267, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 646910975.29152656, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1254834626850.2659, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 5.8479532163741414e+17, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test101() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data101) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data101[i].a), Tp(data101[i].b), + Tp(data101[i].c), Tp(data101[i].x)); + const Tp f0 = data101[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data102[] = { + { 0.15519511120894947, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.17197165701692899, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.19276847315207363, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.21920107206179093, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.25386158960390581, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.30115970686600657, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.36916408142057117, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.47406175901569558, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.65237908266239919, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.8227213362622299, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 4.3716358339791332, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 15.670841312959222, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 94.742651122760179, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1081.7275541795671, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 27809.787731465960, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2329811.1715181042, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1537787532.6780224, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 141562653506999.88, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test102() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data102) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data102[i].a), Tp(data102[i].b), + Tp(data102[i].c), Tp(data102[i].x)); + const Tp f0 = data102[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data103[] = { + { 0.23253645591196570, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.25484220947068353, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.28181987881113829, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.31508211677735765, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.35706285886959599, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.41160053409238195, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.48508083111181949, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.58885194371375260, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.74482241684585748, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.4700356864367146, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.4955144453055143, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 5.3506594845833471, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 16.618413752184221, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 89.310629514963878, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1029.3439900542960, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 35659.847863372350, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 8009309.6233230168, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 145640590027.39731, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test103() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data103) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data103[i].a), Tp(data103[i].b), + Tp(data103[i].c), Tp(data103[i].x)); + const Tp f0 = data103[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data104[] = { + { 0.29614148314592498, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.32176277356430810, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.35217870475550522, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.38885270445515091, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.43389978380608424, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.49048612522269436, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.56355539635634611, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.66123153239117682, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.79773363961895427, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3245132157016595, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.9065148749742076, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 3.1328798652457452, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 6.4172532944033476, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 19.071683734222436, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 104.41989641582512, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1510.5743992324240, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 115518.14360562043, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 414930455.29173034, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test104() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data104) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data104[i].a), Tp(data104[i].b), + Tp(data104[i].c), Tp(data104[i].x)); + const Tp f0 = data104[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data105[] = { + { 0.34954259539177696, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.37714038609235123, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.40942091659748725, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.44767109606846428, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.49368984777532254, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.55006638216982318, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.62065830207408912, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.71145554513583786, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.83223839666914623, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2466748028187731, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.6386752725021749, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.3340068725479681, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 3.7848108613132054, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 7.6754638550304133, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 23.344217312927277, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 149.83491198246921, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3936.9253501916060, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 2794143.5036480185, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test105() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data105) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data105[i].a), Tp(data105[i].b), + Tp(data105[i].c), Tp(data105[i].x)); + const Tp f0 = data105[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data106[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test106() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data106) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data106[i].a), Tp(data106[i].b), + Tp(data106[i].c), Tp(data106[i].x)); + const Tp f0 = data106[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data107[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test107() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data107) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data107[i].a), Tp(data107[i].b), + Tp(data107[i].c), Tp(data107[i].x)); + const Tp f0 = data107[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data108[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test108() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data108) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data108[i].a), Tp(data108[i].b), + Tp(data108[i].c), Tp(data108[i].x)); + const Tp f0 = data108[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data109[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test109() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data109) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data109[i].a), Tp(data109[i].b), + Tp(data109[i].c), Tp(data109[i].x)); + const Tp f0 = data109[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data110[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test110() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data110) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data110[i].a), Tp(data110[i].b), + Tp(data110[i].c), Tp(data110[i].x)); + const Tp f0 = data110[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data111[] = { + { 0.72547625011001171, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.74535599249992990, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.76696498884737041, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.79056941504209477, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.81649658092772603, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.84515425472851657, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.87705801930702920, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.91287092917527690, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.95346258924559224, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0540925533894598, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.1180339887498949, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.1952286093343938, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.2909944487358056, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.4142135623730949, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.5811388300841900, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.8257418583505536, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.2360679774997898, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 3.1622776601683782, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test111() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data111) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data111[i].a), Tp(data111[i].b), + Tp(data111[i].c), Tp(data111[i].x)); + const Tp f0 = data111[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data112[] = { + { 0.83664260086443798, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.85046584300227146, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.86509574979651593, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.88062082573041867, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.89714464248521586, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.91478946588967558, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.93370105322348573, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.95405511057700887, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.97606616007978142, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0261916902334731, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0550723519434702, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0872106588188091, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.1233801699379020, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.1646752981725688, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.2127272514219511, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.2701518651068637, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3416407864998725, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.4374795179111102, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test112() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data112) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data112[i].a), Tp(data112[i].b), + Tp(data112[i].c), Tp(data112[i].x)); + const Tp f0 = data112[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data113[] = { + { 0.88195381730235833, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.89265078469555093, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.90382937908303707, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.91553161389880577, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.92780530349281576, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.94070521140346042, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.95429450630523349, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.96864663325785849, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.98384775588541795, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0172258496884334, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0356742479163459, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0555293036908924, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0770231491562379, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.1004557416484888, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.1262270515731978, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.1548932919125086, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.1872757758134724, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.2247091713458949, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test113() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data113) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data113[i].a), Tp(data113[i].b), + Tp(data113[i].c), Tp(data113[i].x)); + const Tp f0 = data113[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data114[] = { + { 0.90716919697107301, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.91592299407142519, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.92500027075874236, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.93442464185467167, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.94422248683737009, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.95442341810133347, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.96506085725516400, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.97617275213704069, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.98780247986309799, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0128233505813447, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0263406246541855, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0406326381700366, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0557966239802845, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0719515075786321, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0892457392422055, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.1078695188000958, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.1280752258974340, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.1502152002706476, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test114() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data114) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data114[i].a), Tp(data114[i].b), + Tp(data114[i].c), Tp(data114[i].x)); + const Tp f0 = data114[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data115[] = { + { 0.92336416053263093, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.93078397248364519, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.93843714333600226, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.94633837784068076, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.95450388104967909, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.96295158125742764, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.97170139827854296, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.98077556918512687, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99019904777750845, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0102104261941198, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0208669540935695, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0320118665407505, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0436944599504387, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0559728828278145, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0689166967761712, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0826105758119842, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0971599106346146, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.1126998828023964, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test115() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data115) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data115[i].a), Tp(data115[i].b), + Tp(data115[i].c), Tp(data115[i].x)); + const Tp f0 = data115[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data116[] = { + { 0.52631578947368429, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.55555555555555558, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.58823529411764708, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.62500000000000000, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.66666666666666663, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.71428571428571430, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.76923076923076927, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.83333333333333337, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.90909090909090906, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.1111111111111112, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.2500000000000000, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.4285714285714286, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.6666666666666663, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 2.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 2.5000000000000004, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 3.3333333333333330, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 5.0000000000000009, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9.9999999999999929, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test116() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data116) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data116[i].a), Tp(data116[i].b), + Tp(data116[i].c), Tp(data116[i].x)); + const Tp f0 = data116[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data117[] = { + { 0.70351947549341520, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.72637503722092711, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.75099661564391251, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.77761647796730871, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.80651221621216451, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.83801894346580275, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.87254582050258467, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.91059888544083678, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.95281329145592386, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0532154477379738, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.1138692114741471, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.1838976095305187, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.2660586631630237, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.3644676665613118, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.4856585347316102, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.6409590443536872, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.8528798927325769, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 2.1789423102929644, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test117() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data117) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data117[i].a), Tp(data117[i].b), + Tp(data117[i].c), Tp(data117[i].x)); + const Tp f0 = data117[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data118[] = { + { 0.78068027379106253, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.79924541976981278, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.81891305585650942, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.83979799626213270, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.86203315303160166, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.88577352485361693, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.91120135738402208, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.93853291956703588, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.96802755388922956, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0348375559194773, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0730246119544820, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.1151788396279341, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.1621066403893472, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.2148922218710421, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.2750496810838674, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.3448048570872917, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.4276833109859521, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.5299976259379788, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test118() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data118) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data118[i].a), Tp(data118[i].b), + Tp(data118[i].c), Tp(data118[i].x)); + const Tp f0 = data118[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data119[] = { + { 0.82510759951857582, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.84072786892782092, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.85710884896562356, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.87431674418118333, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.89242659229727017, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.91152392685930339, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.93170685950993570, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.95308871926790661, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.97580144325325802, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0258682619030324, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0536269616706000, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0835447330793833, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.1159538758396654, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.1512736659291880, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.1900463690116090, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.2329961591622411, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.2811334345669059, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.3359629014132051, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test119() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data119) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data119[i].a), Tp(data119[i].b), + Tp(data119[i].c), Tp(data119[i].x)); + const Tp f0 = data119[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data120[] = { + { 0.85426123653345876, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.86774543390930370, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.88178859537254239, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.89643269097060951, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.91172456687216763, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.92771674975966134, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.94446842993888647, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.96204667481937678, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.98052794339012128, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0205643671068179, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0423395201078882, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0654651277885334, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0901078068101382, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.1164691415928940, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.1447972335326551, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.1754040384534161, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.2086928679893112, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.2452055640510711, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test120() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data120) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data120[i].a), Tp(data120[i].b), + Tp(data120[i].c), Tp(data120[i].x)); + const Tp f0 = data120[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data121[] = { + { 0.27700831024930750, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.30864197530864196, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.34602076124567477, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.39062499999999994, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.44444444444444442, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.51020408163265307, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.59171597633136097, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.69444444444444453, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.82644628099173545, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.2345679012345681, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.5624999999999998, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 2.0408163265306127, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2.7777777777777768, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 4.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 6.2500000000000036, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 11.111111111111109, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 25.000000000000007, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 99.999999999999872, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test121() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data121) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data121[i].a), Tp(data121[i].b), + Tp(data121[i].c), Tp(data121[i].x)); + const Tp f0 = data121[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data122[] = { + { 0.50515448477320868, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.53674994210078020, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.57194655162437447, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.61137322330312327, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.65581297297972574, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.70625323977290932, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.76395739449542643, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.83056871002513311, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.90826553449323655, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1098784992198341, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.2437942741831700, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.4105343768544543, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.6238435648986016, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.9065970003160624, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 2.3001951284393627, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2.8891774744673464, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 3.8827206436045336, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6.0316345867773542, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test122() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data122) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data122[i].a), Tp(data122[i].b), + Tp(data122[i].c), Tp(data122[i].x)); + const Tp f0 = data122[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data123[] = { + { 0.61824560969673303, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.64645665839161048, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.67712272792612083, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.71058076074636822, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.74723387423852861, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.78756892188863126, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.83218012557592713, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.88180144818204143, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.93735184459468934, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0712594799044883, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.1531330932162096, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.2483404191094898, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.3606934909972501, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.4957544469027071, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.6620777107871287, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.8738132387064506, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 2.1570670242247409, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.5700735959225494, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test123() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data123) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data123[i].a), Tp(data123[i].b), + Tp(data123[i].c), Tp(data123[i].x)); + const Tp f0 = data123[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data124[] = { + { 0.68776713859043437, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.71280582849489826, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.73962983054724929, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.76844343025262085, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.79948476671182911, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.83303347721461229, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.86942060391338782, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.90904161711581655, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.95237381468647742, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0526413941912305, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1112045278881502, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.1768500306393046, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.2510971588297888, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.3359896747789315, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.4343740183432725, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.5504011881337365, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.6905307012604318, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.8658920279264424, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test124() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data124) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data124[i].a), Tp(data124[i].b), + Tp(data124[i].c), Tp(data124[i].x)); + const Tp f0 = data124[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data125[] = { + { 0.73530262886958830, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.75768898977673638, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.78143483544640069, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.80667428603297209, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.83356078772438325, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.86227093001346145, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.89300925500556994, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.92601438873425990, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.96156696230910810, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0417127776179342, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0871896789480930, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1370264514689949, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.1919677804049154, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.2529628761065934, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.3212511796458866, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.3985017309668506, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.4870567523847895, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.5904049523738040, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test125() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data125) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data125[i].a), Tp(data125[i].b), + Tp(data125[i].c), Tp(data125[i].x)); + const Tp f0 = data125[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data126[] = { + { 0.040386107340619266, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.052922149401344633, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.070429627772374270, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.095367431640624972, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.13168724279835387, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.18593443208187066, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.26932907434290437, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.40187757201646096, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.62092132305915493, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.6935087808430296, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 3.0517578124999991, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 5.9499018266198629, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 12.860082304526737, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 32.000000000000000, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 97.656250000000114, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 411.52263374485580, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 3124.9999999999991, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 99999.999999999665, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test126() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data126) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data126[i].a), Tp(data126[i].b), + Tp(data126[i].c), Tp(data126[i].x)); + const Tp f0 = data126[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data127[] = { + { 0.21140107887447140, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.24005486968449935, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.27478119275391821, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.31738281249999994, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.37037037037037035, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.43731778425655982, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.52344105598543444, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.63657407407407429, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.78888054094665638, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3031550068587108, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.7578125000000002, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 2.4781341107871717, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 3.7037037037037037, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 5.9999999999999982, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 10.937500000000005, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 24.074074074074076, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 74.999999999999957, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 549.99999999999670, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test127() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data127) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data127[i].a), Tp(data127[i].b), + Tp(data127[i].c), Tp(data127[i].x)); + const Tp f0 = data127[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data128[] = { + { 0.33250915203252107, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.36566851047721960, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.40414812182437942, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.44916943268118470, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.50233081077479569, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.56575808728873322, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.64233106844971422, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.73603371116919514, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.85251256240112439, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.1909065696197674, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.4447095285569311, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.7935243137840653, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2.2937035820494454, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 3.0524711083016687, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 4.2976512669354259, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 6.5977107563194677, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 11.793747206577530, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 29.997625937982058, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test128() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data128) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data128[i].a), Tp(data128[i].b), + Tp(data128[i].c), Tp(data128[i].x)); + const Tp f0 = data128[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data129[] = { + { 0.42108197362250305, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.45503172013983051, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.49345609813624303, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.53720880551221295, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.58736431524847466, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.64529222467897962, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.71276337354393904, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.79210466220795306, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.88643063455510596, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1387832139040652, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3114025920844752, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.5307655016768162, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.8170727950333345, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 2.2037865486700836, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 2.7506766056439380, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 3.5764534935716972, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 4.9587762302155403, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 7.7740847924166800, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test129() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data129) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data129[i].a), Tp(data129[i].b), + Tp(data129[i].c), Tp(data129[i].x)); + const Tp f0 = data129[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data130[] = { + { 0.48860241312958425, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.52193382517068487, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.55902375003954219, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.60049055150230346, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.64709127927203480, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.69976233335368998, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.75967529501081055, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.82831498895254407, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.90759090169653933, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1088712278667465, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2387445478440853, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.3959812720437546, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.5897930661091164, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.8340789380307454, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 2.1509548085970764, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2.5782406951207504, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3.1877847194242737, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 4.1421596631676900, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test130() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data130) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data130[i].a), Tp(data130[i].b), + Tp(data130[i].c), Tp(data130[i].x)); + const Tp f0 = data130[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data131[] = { + { 0.0016310376661280216, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.0028007538972582421, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.0049603324681551939, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.0090949470177292789, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.017341529915832606, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.034571613033607777, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.072538150286405714, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.16150558288984579, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.38554328942953148, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 2.8679719907924444, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 9.3132257461547816, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 35.401331746414378, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 165.38171687920172, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1024.0000000000000, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 9536.7431640625200, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 169350.87808430271, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 9765624.9999999944, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9999999999.9999332, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test131() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data131) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data131[i].a), Tp(data131[i].b), + Tp(data131[i].c), Tp(data131[i].x)); + const Tp f0 = data131[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data132[] = { + { 0.071191280690193509, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.085646504654238079, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.10478215656371073, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.13074816337653575, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.16701141666848116, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.21939323375313971, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.29813515331786627, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.42225974638874386, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.62942145962174867, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.7218685262373197, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 3.2855760483514689, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 7.1616652508907093, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 18.612326808485907, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 61.476190476190474, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 286.27580915178623, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2274.9441142102296, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 47229.761904761865, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 9961460.7142856438, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test132() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data132) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data132[i].a), Tp(data132[i].b), + Tp(data132[i].c), Tp(data132[i].x)); + const Tp f0 = data132[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data133[] = { + { 0.14747230019381052, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.17073600100690603, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.19982795745135354, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.23681776864188067, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.28475624360398022, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.34827500743063144, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.43464829159684681, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.55576053438064787, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.73195020913445485, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.4310223867822929, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.1742563399057540, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 3.5769231236256043, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 6.5620441134844363, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 14.063492063492063, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 38.085937500000036, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 150.92973632068282, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1212.3015873015852, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 55107.142857142389, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test133() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data133) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data133[i].a), Tp(data133[i].b), + Tp(data133[i].c), Tp(data133[i].x)); + const Tp f0 = data133[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data134[] = { + { 0.21658059714090588, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.24513539602702844, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.27967018274845046, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.32196044921874994, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.37448559670781900, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.44078856032208796, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.52606701446027815, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.63818158436214001, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.78944971882612769, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3044251384443430, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.7659505208333335, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 2.5093710953769270, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 3.8065843621399158, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 6.3333333333333313, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 12.109375000000004, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 29.115226337448540, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 108.33333333333330, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1224.9999999999923, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test134() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data134) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data134[i].a), Tp(data134[i].b), + Tp(data134[i].c), Tp(data134[i].x)); + const Tp f0 = data134[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data135[] = { + { 0.27700831024930750, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.30864197530864196, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.34602076124567477, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.39062499999999994, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.44444444444444442, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.51020408163265307, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.59171597633136097, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.69444444444444453, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.82644628099173545, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2345679012345681, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.5624999999999998, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.0408163265306127, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 2.7777777777777768, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 4.0000000000000000, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 6.2500000000000036, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 11.111111111111109, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 25.000000000000007, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 99.999999999999872, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test135() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data135) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data135[i].a), Tp(data135[i].b), + Tp(data135[i].c), Tp(data135[i].x)); + const Tp f0 = data135[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data136[] = { + { 2.6602838683283435e-06, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 7.8442223930072316e-06, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 2.4604898194634598e-05, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 8.2718061255302686e-05, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.00030072865982171723, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.0011951964277455193, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0052617832469731814, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.026084053304588847, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.14864362802414346, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 8.2252633399699757, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 86.736173798840269, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1253.2542894196865, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 27351.112277912434, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1048576.0000000000, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 90949470.177293226, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 28679719907.924358, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 95367431640624.906, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9.9999999999998657e+19, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test136() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data136) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data136[i].a), Tp(data136[i].b), + Tp(data136[i].c), Tp(data136[i].x)); + const Tp f0 = data136[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data137[] = { + { 0.018828092583720951, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.023381944060455316, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.029789623984280793, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.039191021482500497, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.053727813036721514, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.077762010061669024, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.12110505620123302, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.20870149809080590, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.41429234328785769, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 3.1308087404153113, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 13.586180626453050, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 87.117304082784415, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 889.26474381242826, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 16231.913312693494, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 653537.51168945129, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 87756230.793848589, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 101493977171.74945, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 21375960679556916., 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test137() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data137) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data137[i].a), Tp(data137[i].b), + Tp(data137[i].c), Tp(data137[i].x)); + const Tp f0 = data137[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data138[] = { + { 0.049200410661854252, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.059460876757152226, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.073244762686653350, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.092334626017932922, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.11976760350696837, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.16102414609169383, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.22670456785796222, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.33912903252727361, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.55049794600858060, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 2.1254722872032232, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 5.6261213886736172, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 20.137315891130996, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 108.04381584643853, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 992.41692466460245, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 19055.363816004465, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1105471.9504312086, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 448521363.90608919, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 19078917293639.004, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test138() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data138) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data138[i].a), Tp(data138[i].b), + Tp(data138[i].c), Tp(data138[i].x)); + const Tp f0 = data138[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data139[] = { + { 0.083753547015334745, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.099238444687035701, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.11938294012867758, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.14622683905023326, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.18303556733713025, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.23527764069382409, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.31261681740827085, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.43327581880538862, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.63445840637296658, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.7438842395813297, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 3.5070840938209269, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 8.6573372006089713, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 28.779342118408906, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 147.50178613955714, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1427.1686016136398, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 36780.643714655642, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 5313869.6058585485, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 46057280607.381966, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test139() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data139) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data139[i].a), Tp(data139[i].b), + Tp(data139[i].c), Tp(data139[i].x)); + const Tp f0 = data139[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data140[] = { + { 0.11920045035073683, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.13907946814302774, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.16431439792559688, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.19698796016987008, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.24028510928790570, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.29926031296483119, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.38229327814229169, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.50402047283093110, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.69167261179586503, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.5503152253394308, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 2.6469548193635797, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 5.1882631330566813, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 12.476792759124516, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 41.026391565091259, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 220.92584715988204, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2677.0834450236207, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 141774.31260689779, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 254267148.83196995, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test140() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data140) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data140[i].a), Tp(data140[i].b), + Tp(data140[i].c), Tp(data140[i].x)); + const Tp f0 = data140[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data141[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test141() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data141) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data141[i].a), Tp(data141[i].b), + Tp(data141[i].c), Tp(data141[i].x)); + const Tp f0 = data141[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data142[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test142() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data142) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data142[i].a), Tp(data142[i].b), + Tp(data142[i].c), Tp(data142[i].x)); + const Tp f0 = data142[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data143[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test143() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data143) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data143[i].a), Tp(data143[i].b), + Tp(data143[i].c), Tp(data143[i].x)); + const Tp f0 = data143[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data144[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test144() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data144) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data144[i].a), Tp(data144[i].b), + Tp(data144[i].c), Tp(data144[i].x)); + const Tp f0 = data144[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data145[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test145() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data145) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data145[i].a), Tp(data145[i].b), + Tp(data145[i].c), Tp(data145[i].x)); + const Tp f0 = data145[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data146[] = { + { 0.52275983209457511, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.54700336898142965, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.57468955512601971, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.60665490543315015, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.64403057859056123, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.68838183648623719, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.74193265039311085, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.80794095908995300, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.89135275749639320, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.1469266219310688, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.3552340708357489, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.6690840478838305, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2.1815415453174483, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 3.1156892546032235, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 5.1109077417760416, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 10.560352936466296, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 33.541019662496815, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 300.66343065819501, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test146() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data146) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data146[i].a), Tp(data146[i].b), + Tp(data146[i].c), Tp(data146[i].x)); + const Tp f0 = data146[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data147[] = { + { 0.68252041951139264, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.70394732624993395, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.72748884971552041, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.75351147371199689, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.78247589005573748, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.81497017420249818, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.85175826875009564, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.89385278481745867, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.94262778709507411, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0687327277420910, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.1529725508983291, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.2592587134058799, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.3985773194637892, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.5909902576697317, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.8776023607249752, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2.3582499003694646, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 3.3541019662496838, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6.7198400278577859, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test147() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data147) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data147[i].a), Tp(data147[i].b), + Tp(data147[i].c), Tp(data147[i].x)); + const Tp f0 = data147[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data148[] = { + { 0.75755211927082589, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.77603550233010998, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.79596241913438492, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.81753360792105201, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.84099165409805521, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.86663303852180873, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.89482475828629970, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.92602774279590350, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.96083064727087386, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0445570841313008, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0959004638926031, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.1560106261370562, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.2278121770678145, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.3158640214709998, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.4278095344155000, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.5778700502946612, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.7972173289196469, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.1789970569269732, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test148() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data148) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data148[i].a), Tp(data148[i].b), + Tp(data148[i].c), Tp(data148[i].x)); + const Tp f0 = data148[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data149[] = { + { 0.80270093579329471, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.81884974572462788, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.83605266330015271, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.85443340762795972, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.87413762182790655, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.89533826626907331, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.91824276674115268, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.94310265050720576, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.97022678857609712, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0329098673199812, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0695865684573389, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.1108642103944570, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.1578795055970506, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.2122394794169442, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.2763274721556934, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.3539179650251021, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.4515986118197148, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.5829284571614219, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test149() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data149) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data149[i].a), Tp(data149[i].b), + Tp(data149[i].c), Tp(data149[i].x)); + const Tp f0 = data149[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data150[] = { + { 0.83322694172301959, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.84753931604765664, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.86265784532195022, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.87866479300707079, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.89565516540263501, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.91373946207610557, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.93304721345881891, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.95373159512905148, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.97597554238828121, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0260752851887982, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0545371197996178, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0858099017045830, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.1204416568688709, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.1591587835964847, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.2029564720303347, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.2532588722007874, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.3122319926925459, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.3834948587364100, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test150() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data150) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data150[i].a), Tp(data150[i].b), + Tp(data150[i].c), Tp(data150[i].x)); + const Tp f0 = data150[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data151[] = { + { 0.25646288779245091, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.28273129096174382, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.31438201170962976, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.35308837890625017, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.40123456790123463, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.46230737192836319, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.54156016946185359, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.64718364197530875, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.79246636158732342, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.3103947568968148, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.8017578125000004, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 2.6374427321949185, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 4.1975308641975282, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 7.4999999999999964, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 15.859375000000012, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 43.734567901234513, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 194.99999999999994, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2777.4999999999832, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test151() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data151) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data151[i].a), Tp(data151[i].b), + Tp(data151[i].c), Tp(data151[i].x)); + const Tp f0 = data151[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data152[] = { + { 0.46398891966759004, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.49382716049382713, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.52768166089965396, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.56640624999999978, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.61111111111111116, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.66326530612244894, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.72485207100591698, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.79861111111111094, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.88842975206611552, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1419753086419753, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.3281249999999998, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.5816326530612239, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.9444444444444444, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 2.5000000000000000, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 3.4374999999999996, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 5.2777777777777715, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 9.9999999999999947, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 32.499999999999837, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test152() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data152) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data152[i].a), Tp(data152[i].b), + Tp(data152[i].c), Tp(data152[i].x)); + const Tp f0 = data152[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data153[] = { + { 0.57476744883397501, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.60302731682513933, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.63425708719096396, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.66895764182970419, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.70775063063963428, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.75141762103495924, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.80095569442603298, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.85765823887436754, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.92323549576335540, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0911622464839472, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.2013226178607666, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.3373332072682687, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.5099074378209716, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.7368822229245819, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2.0505871832661429, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 2.5172389775867967, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 3.3015631983556144, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 5.0005935155044519, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test153() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data153) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data153[i].a), Tp(data153[i].b), + Tp(data153[i].c), Tp(data153[i].x)); + const Tp f0 = data153[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data154[] = { + { 0.64582752605387961, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.67184161997264169, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.70012779922368040, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.73100784656910256, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.76486919089091077, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.80218301124334579, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.84352883533234446, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.88962858902212572, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.94139473468584123, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0669812691939897, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1443996012177726, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.2350966976721314, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.3431264370409088, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.4745266814162399, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.6388137104840066, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.8522074849776518, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 2.1458016978417458, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 2.5927464669826339, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test154() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data154) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data154[i].a), Tp(data154[i].b), + Tp(data154[i].c), Tp(data154[i].x)); + const Tp f0 = data154[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data155[] = { + { 0.69583236336670629, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.71968920666899694, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.74533885416044232, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.77300145361503014, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.80293630810919514, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.83545132638592035, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.87091544744412508, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.90977522877919847, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.95257738192069130, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0528968282789379, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.1123617169062123, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1798254572896132, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.2572069000522696, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.3471600884974377, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.4535032279573519, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.5820245752814948, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.7421756366906538, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.9513145531098233, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test155() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data155) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data155[i].a), Tp(data155[i].b), + Tp(data155[i].c), Tp(data155[i].x)); + const Tp f0 = data155[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data156[] = { + { 0.040386107340619266, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.052922149401344633, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.070429627772374270, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.095367431640624972, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.13168724279835387, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.18593443208187066, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.26932907434290437, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.40187757201646096, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.62092132305915493, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.6935087808430296, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 3.0517578124999991, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 5.9499018266198629, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 12.860082304526737, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 32.000000000000000, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 97.656250000000114, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 411.52263374485580, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 3124.9999999999991, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 99999.999999999665, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test156() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data156) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data156[i].a), Tp(data156[i].b), + Tp(data156[i].c), Tp(data156[i].x)); + const Tp f0 = data156[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data157[] = { + { 0.21140107887447140, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.24005486968449935, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.27478119275391821, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.31738281249999994, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.37037037037037035, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.43731778425655982, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.52344105598543444, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.63657407407407429, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.78888054094665638, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3031550068587108, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.7578125000000002, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 2.4781341107871717, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 3.7037037037037037, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 5.9999999999999982, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 10.937500000000005, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 24.074074074074076, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 74.999999999999957, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 549.99999999999670, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test157() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data157) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data157[i].a), Tp(data157[i].b), + Tp(data157[i].c), Tp(data157[i].x)); + const Tp f0 = data157[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data158[] = { + { 0.33250915203252107, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.36566851047721960, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.40414812182437942, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.44916943268118470, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.50233081077479569, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.56575808728873322, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.64233106844971422, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.73603371116919514, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.85251256240112439, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.1909065696197674, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.4447095285569311, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.7935243137840653, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2.2937035820494454, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 3.0524711083016687, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 4.2976512669354259, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 6.5977107563194677, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 11.793747206577530, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 29.997625937982058, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test158() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data158) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data158[i].a), Tp(data158[i].b), + Tp(data158[i].c), Tp(data158[i].x)); + const Tp f0 = data158[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data159[] = { + { 0.42108197362250305, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.45503172013983051, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.49345609813624303, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.53720880551221295, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.58736431524847466, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.64529222467897962, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.71276337354393904, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.79210466220795306, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.88643063455510596, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1387832139040652, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3114025920844752, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.5307655016768162, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.8170727950333345, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 2.2037865486700836, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 2.7506766056439380, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 3.5764534935716972, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 4.9587762302155403, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 7.7740847924166800, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test159() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data159) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data159[i].a), Tp(data159[i].b), + Tp(data159[i].c), Tp(data159[i].x)); + const Tp f0 = data159[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data160[] = { + { 0.48860241312958425, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.52193382517068487, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.55902375003954219, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.60049055150230346, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.64709127927203480, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.69976233335368998, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.75967529501081055, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.82831498895254407, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.90759090169653933, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1088712278667465, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2387445478440853, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.3959812720437546, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.5897930661091164, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.8340789380307454, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 2.1509548085970764, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2.5782406951207504, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3.1877847194242737, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 4.1421596631676900, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test160() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data160) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data160[i].a), Tp(data160[i].b), + Tp(data160[i].c), Tp(data160[i].x)); + const Tp f0 = data160[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data161[] = { + { -0.0047236848832209691, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -0.0073321496427103212, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -0.010977302557845672, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -0.015692785382270907, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { -0.020728547477518677, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { -0.022767481479412769, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.010634636868114139, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.050699832580781923, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.27045765367659280, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 3.4387055868901171, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 12.052059173583981, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 45.565319600798020, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 196.23532998018572, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1032.0000000000002, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 7376.0986328125073, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 86964.639536655843, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2596875.0000000009, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 766224999.99999273, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test161() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data161) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data161[i].a), Tp(data161[i].b), + Tp(data161[i].c), Tp(data161[i].x)); + const Tp f0 = data161[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data162[] = { + { 0.016473280625778897, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.023520955289486407, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.034179084066004943, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.050663948059082052, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.076817558299039843, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.11952927776691676, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.19163799520552813, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.31815307784636504, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.55036208180243285, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.9287183337378946, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 4.0054321289062473, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 9.1373492337376394, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 23.576817558299005, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 71.999999999999972, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 280.76171875000023, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1611.7969821673514, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 18749.999999999996, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1224999.9999999879, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test162() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data162) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data162[i].a), Tp(data162[i].b), + Tp(data162[i].c), Tp(data162[i].x)); + const Tp f0 = data162[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data163[] = { + { 0.067462409738203513, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.084813629887172517, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.10799223563666410, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.13947766136095369, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.18305927261494304, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.24468431546783445, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.33397274564972956, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.46703323887436765, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.67194346197695642, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.5503148146900136, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.5278200136940998, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 4.3933515329658954, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 8.3000308946110888, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 17.570215556257921, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 43.847462183266167, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 141.86909082943853, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 736.63489653168926, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 12117.500593515439, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test163() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data163) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data163[i].a), Tp(data163[i].b), + Tp(data163[i].c), Tp(data163[i].x)); + const Tp f0 = data163[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data164[] = { + { 0.12409443806004232, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.14886910375100412, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.18023328876836334, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.22044046981094714, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.27271160690708801, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.34174821195025840, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.43457788826160237, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.56199385898404552, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.74109892753745221, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3869229400096228, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.9890168748121255, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 2.9741205609307424, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 4.6924751038237300, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 7.9555939380658254, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 14.933102063314404, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 32.780461638447491, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 94.848124287773530, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 523.16034401517425, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test164() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data164) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data164[i].a), Tp(data164[i].b), + Tp(data164[i].c), Tp(data164[i].x)); + const Tp f0 = data164[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data165[] = { + { 0.17885405888526873, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.20861302518993380, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.24504033307244924, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.29007236051133478, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.34635542859732726, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.41756858504598376, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.50892615622124382, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.62798173270509761, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.78595487360378424, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2972517637384813, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.7224028197396388, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.3527690438263305, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 3.3305218060101116, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 4.9383884076775466, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 7.8007604680775229, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 13.518663719271885, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 27.285345906502567, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 75.572415101501988, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test165() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data165) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data165[i].a), Tp(data165[i].b), + Tp(data165[i].c), Tp(data165[i].x)); + const Tp f0 = data165[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data166[] = { + { 0.00063586451658060152, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.0010334743461762443, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.0015326246054669515, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.0019007018181583387, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.0012845577715431577, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { -0.0027213806178058826, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.015121744574954068, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { -0.036637840562974443, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.019117849062621491, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 9.8116901852350615, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 84.255589172244044, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 773.87517619421294, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 8556.9725363053585, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 129023.99999999996, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 3174543.3807373112, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 175133896.95814410, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 43564453125.000061, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 446859999999993.50, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test166() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data166) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data166[i].a), Tp(data166[i].b), + Tp(data166[i].c), Tp(data166[i].x)); + const Tp f0 = data166[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data167[] = { + { -0.00030045430691819899, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -0.00031119487747328581, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { -0.00014589213141649274, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.00056843418860809121, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.0028902549859721725, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.0098776037238877470, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.030689217428863914, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.094211590019076599, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.29791981455918376, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 3.6646308771236793, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 15.133991837501521, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 73.331330046144089, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 441.01791167787133, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3583.9999999999991, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 45299.530029296984, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1157231.0002427341, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 107421875.00000016, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 234999999999.99734, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test167() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data167) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data167[i].a), Tp(data167[i].b), + Tp(data167[i].c), Tp(data167[i].x)); + const Tp f0 = data167[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data168[] = { + { 0.0058530497315411210, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.0088526869356855692, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.013770987983443108, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.022108932690960800, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.036786236450921578, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.063750669040426422, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.11577228680714464, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.22197573416125735, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.45361312968415268, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 2.4162889363082747, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 6.5381564791240399, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 20.415771011498428, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 76.870682056629221, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 373.58730158730162, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2626.2555803571477, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 33060.960671081048, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1203521.8253968258, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 584564285.71427989, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test168() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data168) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data168[i].a), Tp(data168[i].b), + Tp(data168[i].c), Tp(data168[i].x)); + const Tp f0 = data168[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data169[] = { + { 0.020248990107069400, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.027876687750502421, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.039154648888447781, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.056251883506774923, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.082914189910074432, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.12585357817786477, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.19761423206224929, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.32280443863359243, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.55250024062839465, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.9374297986599267, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 4.0849049886067696, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 9.5926988633258983, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 25.958314281359531, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 85.333333333333300, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 372.31445312500028, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2545.3436976070675, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 39583.333333333343, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 4599999.9999999627, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test169() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data169) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data169[i].a), Tp(data169[i].b), + Tp(data169[i].c), Tp(data169[i].x)); + const Tp f0 = data169[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data170[] = { + { 0.040386107340619266, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.052922149401344633, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.070429627772374270, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.095367431640624972, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.13168724279835387, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.18593443208187066, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.26932907434290437, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.40187757201646096, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.62092132305915493, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.6935087808430296, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 3.0517578124999991, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 5.9499018266198629, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 12.860082304526737, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 32.000000000000000, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 97.656250000000114, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 411.52263374485580, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3124.9999999999991, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 99999.999999999665, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test170() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data170) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data170[i].a), Tp(data170[i].b), + Tp(data170[i].c), Tp(data170[i].x)); + const Tp f0 = data170[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data171[] = { + { -1.8650300348791041e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -3.6488008415183135e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -6.4614776410999025e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -8.4495207102575916e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 2.2276197023819217e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.00070736115111467578, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0027829732057272809, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.0013283545664373570, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { -0.041767631015048733, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 61.311496556100003, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 2397.4420539085681, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 103687.60998586559, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 6247196.6451068865, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 656408576.00000000, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 165334768098.54715, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 175097125520816.81, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.6818275451660257e+18, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2.9794599999999321e+25, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test171() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data171) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data171[i].a), Tp(data171[i].b), + Tp(data171[i].c), Tp(data171[i].x)); + const Tp f0 = data171[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000034e-10)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data172[] = { + { -3.6403884515183385e-06, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -9.5873829247725586e-06, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { -2.6052245147354694e-05, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { -7.2378303598294010e-05, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -0.00020048577321454082, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -0.00051222704046236022, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { -0.00080950511491911315, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.0043473422174314449, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.081078342558623825, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 12.794854084397739, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 195.15639104739046, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 3938.7991953190131, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 118521.48653762060, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 6291455.9999999972, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 773070496.50699198, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 363276452167.04102, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 2002716064453133.0, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 4.5999999999999109e+21, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test172() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data172) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data172[i].a), Tp(data172[i].b), + Tp(data172[i].c), Tp(data172[i].x)); + const Tp f0 = data172[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000013e-09)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data173[] = { + { 0.00014313323624069244, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.00025426183473140697, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.00048255612836426809, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.00099096904674788092, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.0022347805521915607, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.0056271390060292376, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.016109059519227226, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.053453465775608999, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.20995202901839258, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 5.9534372167648799, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 46.157632071205875, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 494.32074431164915, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 7989.5277611775946, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 224179.55830753347, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 13848144.485282511, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 2948587692.8891716, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 5940513286161.6602, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.8531757655945201e+18, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test173() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data173) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data173[i].a), Tp(data173[i].b), + Tp(data173[i].c), Tp(data173[i].x)); + const Tp f0 = data173[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data174[] = { + { 0.0012492049968742865, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.0019931241968014451, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.0033203386861411057, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.0058191894509855282, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.010830090368313866, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.021653062305193163, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.047180821280919084, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.11405637279736180, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.31275468794720990, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 3.8598904658643969, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 18.806301417906667, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 122.77054465017432, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1168.4762146808946, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 18437.511788521082, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 597441.79669264762, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 59390411.369227782, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 44681668993.361603, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 4559673269683164.0, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test174() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data174) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data174[i].a), Tp(data174[i].b), + Tp(data174[i].c), Tp(data174[i].x)); + const Tp f0 = data174[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data175[] = { + { 0.0038867957051371450, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.0058484892597364443, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.0090987656053757009, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.014714392537270733, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.024900404542056769, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.044460184663785055, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.084638849196356836, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.17409058241290998, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.39357055823580755, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 2.9410794636226596, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 10.417226071414344, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 46.930585873140835, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 290.76717121814852, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2788.1641083374830, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 50228.117718560752, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2433042.3476752634, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 705345246.77141762, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 15652478868616.762, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test175() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data175) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data175[i].a), Tp(data175[i].b), + Tp(data175[i].c), Tp(data175[i].x)); + const Tp f0 = data175[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data176[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test176() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data176) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data176[i].a), Tp(data176[i].b), + Tp(data176[i].c), Tp(data176[i].x)); + const Tp f0 = data176[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data177[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test177() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data177) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data177[i].a), Tp(data177[i].b), + Tp(data177[i].c), Tp(data177[i].x)); + const Tp f0 = data177[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data178[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test178() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data178) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data178[i].a), Tp(data178[i].b), + Tp(data178[i].c), Tp(data178[i].x)); + const Tp f0 = data178[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data179[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test179() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data179) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data179[i].a), Tp(data179[i].b), + Tp(data179[i].c), Tp(data179[i].x)); + const Tp f0 = data179[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data180[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test180() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data180) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data180[i].a), Tp(data180[i].b), + Tp(data180[i].c), Tp(data180[i].x)); + const Tp f0 = data180[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data181[] = { + { 0.37727530159464628, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.39816010922169010, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.42283703041362453, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.45255640448730505, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.48919507154431141, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.53569358917731880, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.59689778897029566, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.68128587569875731, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.80478739308790359, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.3408664196153621, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 2.0175364359923860, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 3.6011214553736646, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 8.1799429939495312, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 25.644834637536000, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 123.13738891597615, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1088.7122410321333, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 27358.291704709951, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 8174369.0266731177, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test181() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data181) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data181[i].a), Tp(data181[i].b), + Tp(data181[i].c), Tp(data181[i].x)); + const Tp f0 = data181[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data182[] = { + { 0.53905528308450834, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.56235533974376162, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.58887657983263575, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.61941227047262915, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.65504896640793853, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.69731666644529999, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.74844073299399128, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.81178446800105752, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.89266981277598023, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1497248473106778, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.3729717112654571, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.7374982340374392, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 2.4134479340960580, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3.9191255240471192, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 8.3316373077761270, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 28.323020339843335, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 225.84286572747891, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 12757.127591286655, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test182() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data182) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data182[i].a), Tp(data182[i].b), + Tp(data182[i].c), Tp(data182[i].x)); + const Tp f0 = data182[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data183[] = { + { 0.62672622092226071, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.64931010269769829, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.67448067519076316, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.70276306239803676, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.73484179773087555, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.77162761412743897, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.81436116844816531, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.86477994787944557, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.92539820516603888, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0945599448210315, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.2190897395597264, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.3916844336856475, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.6484497630432013, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 2.0717772717131155, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2.8893613630810924, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 4.9459404075413529, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 13.487394149998716, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 136.57616044013972, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test183() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data183) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data183[i].a), Tp(data183[i].b), + Tp(data183[i].c), Tp(data183[i].x)); + const Tp f0 = data183[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data184[] = { + { 0.68421604440344341, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.70548098055548891, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.72884342311710348, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.75466953437856243, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.78342090924662600, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.81568884278645049, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.85224480241465206, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.89411692571131696, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.94270986892954756, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0688682849120232, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1537004376097553, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.2615455028370031, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.4045541456153436, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.6057216489444517, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.9146603020550739, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2.4617931307620298, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 3.7267799624996498, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 9.3880118036248401, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test184() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data184) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data184[i].a), Tp(data184[i].b), + Tp(data184[i].c), Tp(data184[i].x)); + const Tp f0 = data184[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data185[] = { + { 0.72547625011001171, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.74535599249992990, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.76696498884737041, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.79056941504209477, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.81649658092772603, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.84515425472851657, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.87705801930702920, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.91287092917527690, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.95346258924559224, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0540925533894598, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.1180339887498949, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1952286093343938, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.2909944487358056, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.4142135623730949, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.5811388300841900, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.8257418583505536, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 2.2360679774997898, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 3.1622776601683782, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test185() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data185) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data185[i].a), Tp(data185[i].b), + Tp(data185[i].c), Tp(data185[i].x)); + const Tp f0 = data185[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data186[] = { + { 0.12307420104127871, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.13818870041457423, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.15739165631811691, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.18249038606882068, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.21644171225027786, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.26433326159804160, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.33544459430654533, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.44788516696232517, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.63989153514168362, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.7568608796813312, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 3.5836558871799027, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 8.8077526749963226, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 27.285841702089190, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 113.55555555555557, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 706.24023437500091, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 8064.1687976651992, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 271267.22222222196, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 123456789.99999890, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test186() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data186) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data186[i].a), Tp(data186[i].b), + Tp(data186[i].c), Tp(data186[i].x)); + const Tp f0 = data186[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data187[] = { + { 0.28363728383055758, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.30933003169808387, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.33998437757128797, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.37713553224291119, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.42299736538419658, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.48086597727600106, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.55583495759293045, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.65612850114039667, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.79573668772968120, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3184712058058303, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.8576958065941214, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 2.8759509651764228, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 5.1046225531822182, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 11.095238095238095, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 32.797154017857174, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 158.01935680536477, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1815.9523809523814, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 163302.14285714156, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test187() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data187) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data187[i].a), Tp(data187[i].b), + Tp(data187[i].c), Tp(data187[i].x)); + const Tp f0 = data187[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data188[] = { + { 0.39006633302741794, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.41898885698103294, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.45245557983812590, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.49160548618861633, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.53798419230517980, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.59373881442067344, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.66193391357076115, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.74708402736952129, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.85609281019430605, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.1974451135148187, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.4820886036706347, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.9201183180477521, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2.6569338297733336, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 4.0634920634920650, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 7.3102678571428568, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 17.512574302697733, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 74.206349206349131, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1342.8571428571363, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test188() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data188) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data188[i].a), Tp(data188[i].b), + Tp(data188[i].c), Tp(data188[i].x)); + const Tp f0 = data188[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data189[] = { + { 0.46726928123633193, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.49687547629934464, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.53045208856322235, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.56884765624999978, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.61316872427983526, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.66488500161969544, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.72598998634501577, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.79925411522633782, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.88863845062192193, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1423563481176653, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3302951388888888, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.5889212827988335, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.9650205761316870, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 2.5555555555555549, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 3.5937500000000013, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 5.7818930041152203, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 12.222222222222220, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 54.999999999999780, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test189() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data189) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data189[i].a), Tp(data189[i].b), + Tp(data189[i].c), Tp(data189[i].x)); + const Tp f0 = data189[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data190[] = { + { 0.52631578947368429, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.55555555555555558, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.58823529411764708, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.62500000000000000, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.66666666666666663, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.71428571428571430, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.76923076923076927, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.83333333333333337, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.90909090909090906, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1111111111111112, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2500000000000000, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.4285714285714286, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.6666666666666663, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2.0000000000000000, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 2.5000000000000004, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 3.3333333333333330, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 5.0000000000000009, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9.9999999999999929, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test190() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data190) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data190[i].a), Tp(data190[i].b), + Tp(data190[i].c), Tp(data190[i].x)); + const Tp f0 = data190[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data191[] = { + { 0.0016310376661280216, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.0028007538972582421, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.0049603324681551939, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.0090949470177292789, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.017341529915832606, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.034571613033607777, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.072538150286405714, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.16150558288984579, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.38554328942953148, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 2.8679719907924444, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 9.3132257461547816, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 35.401331746414378, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 165.38171687920172, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1024.0000000000000, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 9536.7431640625200, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 169350.87808430271, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 9765624.9999999944, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9999999999.9999332, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test191() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data191) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data191[i].a), Tp(data191[i].b), + Tp(data191[i].c), Tp(data191[i].x)); + const Tp f0 = data191[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data192[] = { + { 0.071191280690193509, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.085646504654238079, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.10478215656371073, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.13074816337653575, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.16701141666848116, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.21939323375313971, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.29813515331786627, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.42225974638874386, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.62942145962174867, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.7218685262373197, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 3.2855760483514689, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 7.1616652508907093, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 18.612326808485907, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 61.476190476190474, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 286.27580915178623, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2274.9441142102296, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 47229.761904761865, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 9961460.7142856438, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test192() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data192) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data192[i].a), Tp(data192[i].b), + Tp(data192[i].c), Tp(data192[i].x)); + const Tp f0 = data192[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data193[] = { + { 0.14747230019381052, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.17073600100690603, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.19982795745135354, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.23681776864188067, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.28475624360398022, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.34827500743063144, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.43464829159684681, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.55576053438064787, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.73195020913445485, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.4310223867822929, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.1742563399057540, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 3.5769231236256043, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 6.5620441134844363, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 14.063492063492063, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 38.085937500000036, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 150.92973632068282, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1212.3015873015852, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 55107.142857142389, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test193() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data193) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data193[i].a), Tp(data193[i].b), + Tp(data193[i].c), Tp(data193[i].x)); + const Tp f0 = data193[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data194[] = { + { 0.21658059714090588, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.24513539602702844, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.27967018274845046, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.32196044921874994, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.37448559670781900, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.44078856032208796, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.52606701446027815, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.63818158436214001, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.78944971882612769, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3044251384443430, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.7659505208333335, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 2.5093710953769270, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 3.8065843621399158, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 6.3333333333333313, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 12.109375000000004, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 29.115226337448540, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 108.33333333333330, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1224.9999999999923, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test194() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data194) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data194[i].a), Tp(data194[i].b), + Tp(data194[i].c), Tp(data194[i].x)); + const Tp f0 = data194[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data195[] = { + { 0.27700831024930750, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.30864197530864196, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.34602076124567477, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.39062499999999994, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.44444444444444442, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.51020408163265307, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.59171597633136097, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.69444444444444453, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.82644628099173545, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2345679012345681, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.5624999999999998, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.0408163265306127, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 2.7777777777777768, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 4.0000000000000000, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 6.2500000000000036, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 11.111111111111109, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 25.000000000000007, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 99.999999999999872, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test195() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data195) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data195[i].a), Tp(data195[i].b), + Tp(data195[i].c), Tp(data195[i].x)); + const Tp f0 = data195[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data196[] = { + { 0.00063586451658060152, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.0010334743461762443, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.0015326246054669515, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.0019007018181583387, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.0012845577715431577, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { -0.0027213806178058826, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.015121744574954068, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { -0.036637840562974443, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.019117849062621491, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 9.8116901852350615, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 84.255589172244044, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 773.87517619421294, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 8556.9725363053585, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 129023.99999999996, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 3174543.3807373112, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 175133896.95814410, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 43564453125.000061, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 446859999999993.50, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test196() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data196) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data196[i].a), Tp(data196[i].b), + Tp(data196[i].c), Tp(data196[i].x)); + const Tp f0 = data196[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data197[] = { + { -0.00030045430691819899, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -0.00031119487747328581, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { -0.00014589213141649274, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.00056843418860809121, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.0028902549859721725, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.0098776037238877470, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.030689217428863914, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.094211590019076599, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.29791981455918376, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 3.6646308771236793, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 15.133991837501521, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 73.331330046144089, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 441.01791167787133, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3583.9999999999991, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 45299.530029296984, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1157231.0002427341, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 107421875.00000016, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 234999999999.99734, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test197() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data197) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data197[i].a), Tp(data197[i].b), + Tp(data197[i].c), Tp(data197[i].x)); + const Tp f0 = data197[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data198[] = { + { 0.0058530497315411210, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.0088526869356855692, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.013770987983443108, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.022108932690960800, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.036786236450921578, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.063750669040426422, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.11577228680714464, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.22197573416125735, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.45361312968415268, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 2.4162889363082747, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 6.5381564791240399, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 20.415771011498428, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 76.870682056629221, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 373.58730158730162, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2626.2555803571477, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 33060.960671081048, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1203521.8253968258, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 584564285.71427989, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test198() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data198) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data198[i].a), Tp(data198[i].b), + Tp(data198[i].c), Tp(data198[i].x)); + const Tp f0 = data198[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data199[] = { + { 0.020248990107069400, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.027876687750502421, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.039154648888447781, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.056251883506774923, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.082914189910074432, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.12585357817786477, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.19761423206224929, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.32280443863359243, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.55250024062839465, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.9374297986599267, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 4.0849049886067696, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 9.5926988633258983, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 25.958314281359531, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 85.333333333333300, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 372.31445312500028, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2545.3436976070675, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 39583.333333333343, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 4599999.9999999627, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test199() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data199) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data199[i].a), Tp(data199[i].b), + Tp(data199[i].c), Tp(data199[i].x)); + const Tp f0 = data199[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data200[] = { + { 0.040386107340619266, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.052922149401344633, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.070429627772374270, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.095367431640624972, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.13168724279835387, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.18593443208187066, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.26932907434290437, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.40187757201646096, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.62092132305915493, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.6935087808430296, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 3.0517578124999991, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 5.9499018266198629, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 12.860082304526737, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 32.000000000000000, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 97.656250000000114, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 411.52263374485580, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3124.9999999999991, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 99999.999999999665, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test200() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data200) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data200[i].a), Tp(data200[i].b), + Tp(data200[i].c), Tp(data200[i].x)); + const Tp f0 = data200[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data201[] = { + { 2.3388730079478623e-05, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -2.3204970759807341e-05, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -0.00016219730505520291, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -0.00044366962360925706, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { -0.00071863577205454770, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 4.4378596544453810e-05, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0044446568070623570, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.0071045155183571103, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { -0.049961558159890146, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 51.305449964107403, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1435.9545414461309, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 39657.913058984115, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1346016.4468570501, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 68086556.444444403, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 6646235808.7301531, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1954852335479.9702, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 4573796225043418.0, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.8280190368899683e+21, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test201() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data201) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data201[i].a), Tp(data201[i].b), + Tp(data201[i].c), Tp(data201[i].x)); + const Tp f0 = data201[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data202[] = { + { 1.3504013648882651e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 3.1753432098404372e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 6.2032098207659688e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 8.8747213942768282e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0478094697243911e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -0.00055998751006011325, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { -0.0024718654966577563, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { -0.0027000264053619817, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.066515394406810674, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 11.579200866389527, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 137.50750548795256, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1901.3196072993419, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 34210.659507137796, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 920588.19047619053, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 45876220.933028772, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 6234608574.0963297, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 5445391090029.7783, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 4.6508713107142163e+17, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test202() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data202) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data202[i].a), Tp(data202[i].b), + Tp(data202[i].c), Tp(data202[i].x)); + const Tp f0 = data202[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data203[] = { + { -2.6846726901567720e-05, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { -4.7817237144207266e-05, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { -7.2908121941975601e-05, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { -6.0427853197480476e-05, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.00020559720946645182, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.0017056910683365828, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.0088037230970526795, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.041510819735141674, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.19754880805677258, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 5.6130947302779246, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 36.475357196722442, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 289.29483001400672, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 3010.8676549536503, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 45844.317460317419, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1221852.6431492427, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 79585968.928968787, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 26733475942.460335, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 500206428571421.19, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test203() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data203) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data203[i].a), Tp(data203[i].b), + Tp(data203[i].c), Tp(data203[i].x)); + const Tp f0 = data203[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data204[] = { + { 0.00025866179054245944, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.00053402577739214288, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.0011390075227240345, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.0025224267119483192, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.0058340332124251467, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.014189256143045285, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.036590990011337567, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.10106560781146992, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.30278778538531409, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 3.7187249990350599, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 16.023275545901704, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 83.265377219882822, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 553.31413918843987, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 5148.4444444444416, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 78082.084655761908, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2565874.8781353114, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 346137152.77777809, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1472499999999.9834, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test204() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data204) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data204[i].a), Tp(data204[i].b), + Tp(data204[i].c), Tp(data204[i].x)); + const Tp f0 = data204[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data205[] = { + { 0.0016310376661280216, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.0028007538972582421, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.0049603324681551939, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.0090949470177292789, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.017341529915832606, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.034571613033607777, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.072538150286405714, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.16150558288984579, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.38554328942953148, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 2.8679719907924444, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 9.3132257461547816, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 35.401331746414378, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 165.38171687920172, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1024.0000000000000, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 9536.7431640625200, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 169350.87808430271, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 9765624.9999999944, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9999999999.9999332, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test205() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data205) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data205[i].a), Tp(data205[i].b), + Tp(data205[i].c), Tp(data205[i].x)); + const Tp f0 = data205[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data206[] = { + { -2.1776535308707967e-07, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -2.9128833151427998e-06, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -9.4755553429035093e-06, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -1.2844297353813116e-05, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 3.6576965483568809e-05, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.00020847453890692649, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.00022868510398174632, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { -0.0021855513841942732, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.014662111759334634, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 746.44776348798098, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 136080.48445225612, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 23094279.597826406, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 5315913395.5545301, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 2261935718399.9990, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 2669150854828235.0, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.7499363099365994e+19, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.8881518494606140e+24, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.4165513933661626e+33, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test206() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data206) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data206[i].a), Tp(data206[i].b), + Tp(data206[i].c), Tp(data206[i].x)); + const Tp f0 = data206[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000005e-08)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data207[] = { + { 1.7149006973860441e-07, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 3.2399324904088936e-07, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.6015317712089860e-07, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { -2.0500917204199595e-06, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -1.0175546788599472e-05, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -1.1720101988202453e-05, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.00014199637113974185, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.00021263363640642297, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { -0.0072649256698441751, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 90.430293772869618, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 6248.1455940292308, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 501143.39852548984, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 58852027.356439680, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 12942923093.333330, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 7618073993853.6592, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 22630251562549288., 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3708372433980356e+21, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.4154113619999653e+29, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test207() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data207) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data207[i].a), Tp(data207[i].b), + Tp(data207[i].c), Tp(data207[i].x)); + const Tp f0 = data207[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000024e-08)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data208[] = { + { -1.6667473370780257e-08, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 8.6214844067774863e-08, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 5.7778331238835108e-07, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 2.1911400500362969e-06, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 4.7440049217100417e-06, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { -1.0564233314924258e-05, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { -0.00017990026051856349, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { -0.00027618146288744351, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.030606019577723392, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 27.832854169493341, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 874.00624088575228, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 36049.199340831554, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2270967.7298624986, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 266979100.44444439, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 80311224337.493027, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 110111693103799.72, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 2.4838871426052618e+18, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 5.4626349999998603e+25, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test208() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data208) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data208[i].a), Tp(data208[i].b), + Tp(data208[i].c), Tp(data208[i].x)); + const Tp f0 = data208[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000019e-07)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data209[] = { + { -1.5843795893321480e-07, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { -5.4877275994033766e-07, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { -1.7169507967745992e-06, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { -4.5236439748752000e-06, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { -5.5690492560325806e-06, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 5.6914115606934911e-05, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.00082507252097519922, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.0085739249288229857, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.088244357683754757, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 13.387208440156897, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 226.77895441155110, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 5281.5716482686785, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 189431.77762850464, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 12408149.333333332, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1966782292.5839682, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1274123112205.7495, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 10903676350911508., 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 5.1849999999998819e+22, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test209() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data209) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data209[i].a), Tp(data209[i].b), + Tp(data209[i].c), Tp(data209[i].x)); + const Tp f0 = data209[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000012e-08)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data210[] = { + { 2.6602838683283435e-06, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 7.8442223930072316e-06, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 2.4604898194634598e-05, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 8.2718061255302686e-05, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.00030072865982171723, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.0011951964277455193, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.0052617832469731814, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.026084053304588847, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.14864362802414346, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 8.2252633399699757, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 86.736173798840269, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1253.2542894196865, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 27351.112277912434, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1048576.0000000000, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 90949470.177293226, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 28679719907.924358, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 95367431640624.906, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9.9999999999998657e+19, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test210() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data210) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data210[i].a), Tp(data210[i].b), + Tp(data210[i].c), Tp(data210[i].x)); + const Tp f0 = data210[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data211[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test211() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data211) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data211[i].a), Tp(data211[i].b), + Tp(data211[i].c), Tp(data211[i].x)); + const Tp f0 = data211[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data212[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test212() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data212) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data212[i].a), Tp(data212[i].b), + Tp(data212[i].c), Tp(data212[i].x)); + const Tp f0 = data212[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data213[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test213() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data213) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data213[i].a), Tp(data213[i].b), + Tp(data213[i].c), Tp(data213[i].x)); + const Tp f0 = data213[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data214[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test214() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data214) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data214[i].a), Tp(data214[i].b), + Tp(data214[i].c), Tp(data214[i].x)); + const Tp f0 = data214[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data215[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test215() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data215) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data215[i].a), Tp(data215[i].b), + Tp(data215[i].c), Tp(data215[i].x)); + const Tp f0 = data215[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data216[] = { + { 0.26690449940521566, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.28252302866181805, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.30123616141153819, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.32421384687602628, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.35334630811776752, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.39191793127467034, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.44620488618129206, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.52980896919265685, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.67754711477562357, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.9567557771780317, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 6.1816042148333086, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 35.653088618561227, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 377.51482843179906, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 7645.8816551195359, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 354791.74537980522, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 57009889.966638684, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 83771357024.863937, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 25866972896376408., 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test216() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data216) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data216[i].a), Tp(data216[i].b), + Tp(data216[i].c), Tp(data216[i].x)); + const Tp f0 = data216[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data217[] = { + { 0.40342659436153405, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.42420571192034318, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.44852768286073008, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.47751245808592863, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.51283632632707754, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.55713468814894307, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.61481320817757312, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.69383483410097202, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.81012002526006033, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3622225506603911, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 2.2349513086109001, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 5.1864917536761723, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 21.020560423779411, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 175.19649997100612, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 3467.1587803688708, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 225003.88683445856, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 110837674.65652709, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6688966964170.6807, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test217() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data217) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data217[i].a), Tp(data217[i].b), + Tp(data217[i].c), Tp(data217[i].x)); + const Tp f0 = data217[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data218[] = { + { 0.48716309885816761, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.50965859152542281, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.53554809210658971, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.56576689207507136, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.60164849637133688, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.64516711595404375, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.69938278735493542, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.76931621518401860, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.86381808725530695, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.2152051956815531, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.6052546785425543, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 2.4765586046012635, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 5.1564492216997486, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 18.446158392136365, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 150.44577670123971, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 3862.6317400115768, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 632428.34833625401, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 7426927663.3808765, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test218() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data218) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data218[i].a), Tp(data218[i].b), + Tp(data218[i].c), Tp(data218[i].x)); + const Tp f0 = data218[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data219[] = { + { 0.54703266209548362, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.56997321774144971, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.59603026159654970, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.62596978851120511, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.66084565876898926, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.70215256667232839, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.75208916592008568, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.81403631111658648, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.89348608489854608, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1517793185139173, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3878110313656598, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.8061071794572381, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 2.7148594517859586, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 5.4529435709049361, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 19.487310275377109, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 191.69079165937470, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 10218.543981792311, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 23160836.646583911, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test219() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data219) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data219[i].a), Tp(data219[i].b), + Tp(data219[i].c), Tp(data219[i].x)); + const Tp f0 = data219[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data220[] = { + { 0.59292067298616002, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.61572496720679915, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.64135339122875623, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.67043457419280483, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.70380956268170980, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.74263251901495231, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.78853555445528278, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.84391122775673766, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.91242401018807406, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1169059681274873, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2825928301302667, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.5385937789924939, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.9895771187893898, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2.9707335806970168, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 6.0299506157180467, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 24.259090336955577, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 406.27267173257223, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 174330.03997220192, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test220() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data220) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data220[i].a), Tp(data220[i].b), + Tp(data220[i].c), Tp(data220[i].x)); + const Tp f0 = data220[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data221[] = { + { 0.058479236576646373, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.065788544763137669, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.075184824937824662, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.087707688693157260, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.10521567442213345, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.13135877960541525, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.17423854066297104, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.25492082527223525, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.44025895219654843, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 3.3698615820910360, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 17.997089220808483, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 153.73298291118951, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2159.1667587825627, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 55188.105263157879, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 3191209.3921857267, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 646910975.29152656, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1254834626850.2659, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 5.8479532163741414e+17, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test221() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data221) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data221[i].a), Tp(data221[i].b), + Tp(data221[i].c), Tp(data221[i].x)); + const Tp f0 = data221[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data222[] = { + { 0.15519511120894947, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.17197165701692899, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.19276847315207363, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.21920107206179093, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.25386158960390581, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.30115970686600657, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.36916408142057117, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.47406175901569558, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.65237908266239919, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.8227213362622299, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 4.3716358339791332, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 15.670841312959222, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 94.742651122760179, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1081.7275541795671, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 27809.787731465960, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2329811.1715181042, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1537787532.6780224, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 141562653506999.88, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test222() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data222) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data222[i].a), Tp(data222[i].b), + Tp(data222[i].c), Tp(data222[i].x)); + const Tp f0 = data222[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data223[] = { + { 0.23253645591196570, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.25484220947068353, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.28181987881113829, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.31508211677735765, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.35706285886959599, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.41160053409238195, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.48508083111181949, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.58885194371375260, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.74482241684585748, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.4700356864367146, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.4955144453055143, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 5.3506594845833471, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 16.618413752184221, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 89.310629514963878, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1029.3439900542960, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 35659.847863372350, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 8009309.6233230168, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 145640590027.39731, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test223() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data223) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data223[i].a), Tp(data223[i].b), + Tp(data223[i].c), Tp(data223[i].x)); + const Tp f0 = data223[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data224[] = { + { 0.29614148314592498, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.32176277356430810, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.35217870475550522, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.38885270445515091, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.43389978380608424, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.49048612522269436, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.56355539635634611, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.66123153239117682, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.79773363961895427, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3245132157016595, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.9065148749742076, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 3.1328798652457452, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 6.4172532944033476, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 19.071683734222436, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 104.41989641582512, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1510.5743992324240, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 115518.14360562043, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 414930455.29173034, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test224() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data224) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data224[i].a), Tp(data224[i].b), + Tp(data224[i].c), Tp(data224[i].x)); + const Tp f0 = data224[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data225[] = { + { 0.34954259539177696, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.37714038609235123, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.40942091659748725, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.44767109606846428, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.49368984777532254, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.55006638216982318, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.62065830207408912, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.71145554513583786, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.83223839666914623, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2466748028187731, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.6386752725021749, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.3340068725479681, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 3.7848108613132054, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 7.6754638550304133, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 23.344217312927277, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 149.83491198246921, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3936.9253501916060, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 2794143.5036480185, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test225() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data225) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data225[i].a), Tp(data225[i].b), + Tp(data225[i].c), Tp(data225[i].x)); + const Tp f0 = data225[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data226[] = { + { 2.6602838683283435e-06, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 7.8442223930072316e-06, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 2.4604898194634598e-05, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 8.2718061255302686e-05, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.00030072865982171723, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.0011951964277455193, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0052617832469731814, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.026084053304588847, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.14864362802414346, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 8.2252633399699757, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 86.736173798840269, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1253.2542894196865, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 27351.112277912434, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1048576.0000000000, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 90949470.177293226, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 28679719907.924358, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 95367431640624.906, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9.9999999999998657e+19, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test226() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data226) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data226[i].a), Tp(data226[i].b), + Tp(data226[i].c), Tp(data226[i].x)); + const Tp f0 = data226[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data227[] = { + { 0.018828092583720951, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.023381944060455316, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.029789623984280793, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.039191021482500497, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.053727813036721514, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.077762010061669024, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.12110505620123302, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.20870149809080590, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.41429234328785769, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 3.1308087404153113, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 13.586180626453050, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 87.117304082784415, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 889.26474381242826, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 16231.913312693494, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 653537.51168945129, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 87756230.793848589, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 101493977171.74945, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 21375960679556916., 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test227() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data227) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data227[i].a), Tp(data227[i].b), + Tp(data227[i].c), Tp(data227[i].x)); + const Tp f0 = data227[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data228[] = { + { 0.049200410661854252, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.059460876757152226, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.073244762686653350, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.092334626017932922, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.11976760350696837, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.16102414609169383, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.22670456785796222, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.33912903252727361, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.55049794600858060, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 2.1254722872032232, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 5.6261213886736172, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 20.137315891130996, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 108.04381584643853, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 992.41692466460245, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 19055.363816004465, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1105471.9504312086, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 448521363.90608919, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 19078917293639.004, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test228() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data228) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data228[i].a), Tp(data228[i].b), + Tp(data228[i].c), Tp(data228[i].x)); + const Tp f0 = data228[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data229[] = { + { 0.083753547015334745, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.099238444687035701, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.11938294012867758, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.14622683905023326, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.18303556733713025, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.23527764069382409, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.31261681740827085, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.43327581880538862, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.63445840637296658, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.7438842395813297, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 3.5070840938209269, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 8.6573372006089713, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 28.779342118408906, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 147.50178613955714, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1427.1686016136398, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 36780.643714655642, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 5313869.6058585485, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 46057280607.381966, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test229() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data229) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data229[i].a), Tp(data229[i].b), + Tp(data229[i].c), Tp(data229[i].x)); + const Tp f0 = data229[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data230[] = { + { 0.11920045035073683, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.13907946814302774, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.16431439792559688, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.19698796016987008, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.24028510928790570, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.29926031296483119, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.38229327814229169, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.50402047283093110, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.69167261179586503, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.5503152253394308, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 2.6469548193635797, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 5.1882631330566813, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 12.476792759124516, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 41.026391565091259, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 220.92584715988204, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2677.0834450236207, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 141774.31260689779, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 254267148.83196995, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test230() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data230) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data230[i].a), Tp(data230[i].b), + Tp(data230[i].c), Tp(data230[i].x)); + const Tp f0 = data230[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data231[] = { + { -1.8650300348791041e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -3.6488008415183135e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -6.4614776410999025e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -8.4495207102575916e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 2.2276197023819217e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.00070736115111467578, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0027829732057272809, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.0013283545664373570, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { -0.041767631015048733, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 61.311496556100003, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 2397.4420539085681, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 103687.60998586559, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 6247196.6451068865, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 656408576.00000000, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 165334768098.54715, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 175097125520816.81, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.6818275451660257e+18, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2.9794599999999321e+25, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test231() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data231) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data231[i].a), Tp(data231[i].b), + Tp(data231[i].c), Tp(data231[i].x)); + const Tp f0 = data231[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000034e-10)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data232[] = { + { -3.6403884515183385e-06, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -9.5873829247725586e-06, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { -2.6052245147354694e-05, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { -7.2378303598294010e-05, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -0.00020048577321454082, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -0.00051222704046236022, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { -0.00080950511491911315, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.0043473422174314449, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.081078342558623825, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 12.794854084397739, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 195.15639104739046, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 3938.7991953190131, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 118521.48653762060, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 6291455.9999999972, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 773070496.50699198, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 363276452167.04102, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 2002716064453133.0, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 4.5999999999999109e+21, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test232() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data232) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data232[i].a), Tp(data232[i].b), + Tp(data232[i].c), Tp(data232[i].x)); + const Tp f0 = data232[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000013e-09)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data233[] = { + { 0.00014313323624069244, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.00025426183473140697, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.00048255612836426809, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.00099096904674788092, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.0022347805521915607, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.0056271390060292376, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.016109059519227226, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.053453465775608999, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.20995202901839258, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 5.9534372167648799, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 46.157632071205875, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 494.32074431164915, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 7989.5277611775946, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 224179.55830753347, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 13848144.485282511, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 2948587692.8891716, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 5940513286161.6602, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.8531757655945201e+18, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test233() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data233) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data233[i].a), Tp(data233[i].b), + Tp(data233[i].c), Tp(data233[i].x)); + const Tp f0 = data233[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-10)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data234[] = { + { 0.0012492049968742865, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.0019931241968014451, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.0033203386861411057, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.0058191894509855282, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.010830090368313866, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.021653062305193163, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.047180821280919084, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.11405637279736180, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.31275468794720990, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 3.8598904658643969, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 18.806301417906667, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 122.77054465017432, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1168.4762146808946, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 18437.511788521082, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 597441.79669264762, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 59390411.369227782, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 44681668993.361603, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 4559673269683164.0, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test234() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data234) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data234[i].a), Tp(data234[i].b), + Tp(data234[i].c), Tp(data234[i].x)); + const Tp f0 = data234[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000006e-11)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data235[] = { + { 0.0038867957051371450, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.0058484892597364443, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.0090987656053757009, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.014714392537270733, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.024900404542056769, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.044460184663785055, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.084638849196356836, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.17409058241290998, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.39357055823580755, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 2.9410794636226596, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 10.417226071414344, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 46.930585873140835, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 290.76717121814852, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2788.1641083374830, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 50228.117718560752, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2433042.3476752634, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 705345246.77141762, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 15652478868616.762, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test235() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data235) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data235[i].a), Tp(data235[i].b), + Tp(data235[i].c), Tp(data235[i].x)); + const Tp f0 = data235[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data236[] = { + { -2.1776535308707967e-07, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -2.9128833151427998e-06, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -9.4755553429035093e-06, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -1.2844297353813116e-05, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 3.6576965483568809e-05, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.00020847453890692649, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.00022868510398174632, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { -0.0021855513841942732, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.014662111759334634, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 746.44776348798098, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 136080.48445225612, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 23094279.597826406, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 5315913395.5545301, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 2261935718399.9990, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 2669150854828235.0, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.7499363099365994e+19, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.8881518494606140e+24, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.4165513933661626e+33, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test236() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data236) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data236[i].a), Tp(data236[i].b), + Tp(data236[i].c), Tp(data236[i].x)); + const Tp f0 = data236[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000005e-08)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data237[] = { + { 1.7149006973860441e-07, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 3.2399324904088936e-07, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.6015317712089860e-07, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { -2.0500917204199595e-06, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -1.0175546788599472e-05, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -1.1720101988202453e-05, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.00014199637113974185, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.00021263363640642297, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { -0.0072649256698441751, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 90.430293772869618, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 6248.1455940292308, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 501143.39852548984, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 58852027.356439680, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 12942923093.333330, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 7618073993853.6592, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 22630251562549288., 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3708372433980356e+21, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.4154113619999653e+29, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test237() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data237) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data237[i].a), Tp(data237[i].b), + Tp(data237[i].c), Tp(data237[i].x)); + const Tp f0 = data237[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000024e-08)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data238[] = { + { -1.6667473370780257e-08, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 8.6214844067774863e-08, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 5.7778331238835108e-07, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 2.1911400500362969e-06, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 4.7440049217100417e-06, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { -1.0564233314924258e-05, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { -0.00017990026051856349, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { -0.00027618146288744351, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.030606019577723392, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 27.832854169493341, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 874.00624088575228, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 36049.199340831554, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2270967.7298624986, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 266979100.44444439, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 80311224337.493027, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 110111693103799.72, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 2.4838871426052618e+18, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 5.4626349999998603e+25, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test238() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data238) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data238[i].a), Tp(data238[i].b), + Tp(data238[i].c), Tp(data238[i].x)); + const Tp f0 = data238[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000019e-07)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data239[] = { + { -1.5843795893321480e-07, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { -5.4877275994033766e-07, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { -1.7169507967745992e-06, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { -4.5236439748752000e-06, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { -5.5690492560325806e-06, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 5.6914115606934911e-05, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.00082507252097519922, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.0085739249288229857, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.088244357683754757, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 13.387208440156897, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 226.77895441155110, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 5281.5716482686785, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 189431.77762850464, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 12408149.333333332, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1966782292.5839682, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1274123112205.7495, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 10903676350911508., 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 5.1849999999998819e+22, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test239() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data239) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data239[i].a), Tp(data239[i].b), + Tp(data239[i].c), Tp(data239[i].x)); + const Tp f0 = data239[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000012e-08)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data240[] = { + { 2.6602838683283435e-06, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 7.8442223930072316e-06, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 2.4604898194634598e-05, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 8.2718061255302686e-05, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.00030072865982171723, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.0011951964277455193, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.0052617832469731814, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.026084053304588847, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.14864362802414346, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 8.2252633399699757, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 86.736173798840269, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1253.2542894196865, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 27351.112277912434, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1048576.0000000000, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 90949470.177293226, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 28679719907.924358, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 95367431640624.906, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9.9999999999998657e+19, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test240() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data240) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data240[i].a), Tp(data240[i].b), + Tp(data240[i].c), Tp(data240[i].x)); + const Tp f0 = data240[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data241[] = { + { 7.4612991101768883e-09, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.1006588946889981e-07, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 2.0126933743389316e-07, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -1.0013775379801016e-06, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { -3.0371956856472516e-06, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 2.2012669924527286e-05, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -6.2415598025417670e-05, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.00033551320394378602, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { -0.0062342152641436353, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 34830.688900741610, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 67626221.263030857, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 102764604848.69762, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 220278355222373.38, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0422324699794536e+18, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.9128731788368004e+22, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 3.5234592919485287e+27, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 5.0867023209025249e+34, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 3.7461088506658564e+46, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test241() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data241) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data241[i].a), Tp(data241[i].b), + Tp(data241[i].c), Tp(data241[i].x)); + const Tp f0 = data241[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000005e-07)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data242[] = { + { -1.5895900796973045e-09, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -2.4403576837293198e-09, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.1622915290732117e-08, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 6.3899796307731726e-08, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -1.3503608352807462e-07, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -1.2198533623899163e-06, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 9.9086618119129001e-06, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { -7.6797020080162010e-05, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.0013196405087170875, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 2274.2044768143564, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1611640.1560475440, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1147063984.7359734, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1253162497163.8311, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3071321673390476.0, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 2.8221123559124324e+19, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2.3658463807419519e+24, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.2596553731345468e+31, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.9627175792062075e+42, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test242() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data242) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data242[i].a), Tp(data242[i].b), + Tp(data242[i].c), Tp(data242[i].x)); + const Tp f0 = data242[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000006e-06)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data243[] = { + { 8.0159808156941562e-11, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { -6.4422687845093557e-10, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { -3.7526134186308981e-09, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { -1.7692034167897114e-09, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 7.9304558772837909e-08, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 5.9348070318594204e-08, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { -3.5827694517425210e-06, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 4.4951490418284159e-05, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { -0.0013716249406310486, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 415.32493304415505, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 121300.42991518594, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 42725673.833462097, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 24588915328.261719, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 31929082412503.652, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.4934954443280477e+17, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 5.7726220597696125e+21, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.1454387824049374e+28, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 3.8088637321581534e+38, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test243() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data243) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data243[i].a), Tp(data243[i].b), + Tp(data243[i].c), Tp(data243[i].x)); + const Tp f0 = data243[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000005e-05)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data244[] = { + { 1.0699072529874453e-10, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 5.4297753417228627e-10, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 9.7625471266824426e-10, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { -6.7257762867770348e-09, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { -5.4634571496175302e-08, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.4595644213893387e-07, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 3.3515966497049909e-06, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { -6.5848086985914887e-05, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.0034800171306214813, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 130.93865856750304, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 17850.203502975532, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 3307058.5655149994, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1041065396.2302787, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 735221357488.41736, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1785176805049585.2, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 3.2302829930269192e+19, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 2.4184909805178299e+25, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.7340021007794567e+35, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test244() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data244) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data244[i].a), Tp(data244[i].b), + Tp(data244[i].c), Tp(data244[i].x)); + const Tp f0 = data244[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000005e-05)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data245[] = { + { -1.7945363894141429e-10, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { -4.4440666675421800e-10, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 6.6171630913717945e-10, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.5453889642199650e-08, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 7.5754083860094422e-08, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { -4.1113628639873710e-07, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { -9.5300704265214247e-06, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.00016081533175785109, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.017684650940379486, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 57.562247312454403, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 4124.4159820362511, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 428774.21436196787, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 76996819.900892526, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 30473174828.943691, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 39291970835753.094, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 3.3890331048069018e+17, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 9.7157373454594049e+22, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.5205808288860858e+32, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test245() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data245) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data245[i].a), Tp(data245[i].b), + Tp(data245[i].c), Tp(data245[i].x)); + const Tp f0 = data245[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000005e-05)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + test037<double>(); + test038<double>(); + test039<double>(); + test040<double>(); + test041<double>(); + test042<double>(); + test043<double>(); + test044<double>(); + test045<double>(); + test046<double>(); + test047<double>(); + test048<double>(); + test049<double>(); + test050<double>(); + test051<double>(); + test052<double>(); + test053<double>(); + test054<double>(); + test055<double>(); + test056<double>(); + test057<double>(); + test058<double>(); + test059<double>(); + test060<double>(); + test061<double>(); + test062<double>(); + test063<double>(); + test064<double>(); + test065<double>(); + test066<double>(); + test067<double>(); + test068<double>(); + test069<double>(); + test070<double>(); + test071<double>(); + test072<double>(); + test073<double>(); + test074<double>(); + test075<double>(); + test076<double>(); + test077<double>(); + test078<double>(); + test079<double>(); + test080<double>(); + test081<double>(); + test082<double>(); + test083<double>(); + test084<double>(); + test085<double>(); + test086<double>(); + test087<double>(); + test088<double>(); + test089<double>(); + test090<double>(); + test091<double>(); + test092<double>(); + test093<double>(); + test094<double>(); + test095<double>(); + test096<double>(); + test097<double>(); + test098<double>(); + test099<double>(); + test100<double>(); + test101<double>(); + test102<double>(); + test103<double>(); + test104<double>(); + test105<double>(); + test106<double>(); + test107<double>(); + test108<double>(); + test109<double>(); + test110<double>(); + test111<double>(); + test112<double>(); + test113<double>(); + test114<double>(); + test115<double>(); + test116<double>(); + test117<double>(); + test118<double>(); + test119<double>(); + test120<double>(); + test121<double>(); + test122<double>(); + test123<double>(); + test124<double>(); + test125<double>(); + test126<double>(); + test127<double>(); + test128<double>(); + test129<double>(); + test130<double>(); + test131<double>(); + test132<double>(); + test133<double>(); + test134<double>(); + test135<double>(); + test136<double>(); + test137<double>(); + test138<double>(); + test139<double>(); + test140<double>(); + test141<double>(); + test142<double>(); + test143<double>(); + test144<double>(); + test145<double>(); + test146<double>(); + test147<double>(); + test148<double>(); + test149<double>(); + test150<double>(); + test151<double>(); + test152<double>(); + test153<double>(); + test154<double>(); + test155<double>(); + test156<double>(); + test157<double>(); + test158<double>(); + test159<double>(); + test160<double>(); + test161<double>(); + test162<double>(); + test163<double>(); + test164<double>(); + test165<double>(); + test166<double>(); + test167<double>(); + test168<double>(); + test169<double>(); + test170<double>(); + test171<double>(); + test172<double>(); + test173<double>(); + test174<double>(); + test175<double>(); + test176<double>(); + test177<double>(); + test178<double>(); + test179<double>(); + test180<double>(); + test181<double>(); + test182<double>(); + test183<double>(); + test184<double>(); + test185<double>(); + test186<double>(); + test187<double>(); + test188<double>(); + test189<double>(); + test190<double>(); + test191<double>(); + test192<double>(); + test193<double>(); + test194<double>(); + test195<double>(); + test196<double>(); + test197<double>(); + test198<double>(); + test199<double>(); + test200<double>(); + test201<double>(); + test202<double>(); + test203<double>(); + test204<double>(); + test205<double>(); + test206<double>(); + test207<double>(); + test208<double>(); + test209<double>(); + test210<double>(); + test211<double>(); + test212<double>(); + test213<double>(); + test214<double>(); + test215<double>(); + test216<double>(); + test217<double>(); + test218<double>(); + test219<double>(); + test220<double>(); + test221<double>(); + test222<double>(); + test223<double>(); + test224<double>(); + test225<double>(); + test226<double>(); + test227<double>(); + test228<double>(); + test229<double>(); + test230<double>(); + test231<double>(); + test232<double>(); + test233<double>(); + test234<double>(); + test235<double>(); + test236<double>(); + test237<double>(); + test238<double>(); + test239<double>(); + test240<double>(); + test241<double>(); + test242<double>(); + test243<double>(); + test244<double>(); + test245<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile.cc new file mode 100644 index 000000000..4376d029b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.17 hyperg + +#include <tr1/cmath> + +void +test01() +{ + float af = 2.0F, bf = 10.0F, cf = 3.0F, xf = 0.5F; + double ad = 2.0, bd = 10.0, cd = 3.0, xd = 0.5; + long double al = 2.0L, bl = 10.0L, cl = 3.0L, xl = 0.5L; + + std::tr1::hyperg(af, bf, cf, xf); + std::tr1::hypergf(af, bf, cf, xf); + std::tr1::hyperg(ad, bd, cd, xd); + std::tr1::hyperg(al, bl, cl, xl); + std::tr1::hypergl(al, bl, cl, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile_2.cc new file mode 100644 index 000000000..433829da2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.17 hyperg + +#include <tr1/math.h> + +void +test01() +{ + float af = 2.0F, bf = 10.0F, cf = 3.0F, xf = 0.5F; + double ad = 2.0, bd = 10.0, cd = 3.0, xd = 0.5; + long double al = 2.0L, bl = 10.0L, cl = 3.0L, xl = 0.5L; + + hyperg(af, bf, cf, xf); + hypergf(af, bf, cf, xf); + hyperg(ad, bd, cd, xd); + hyperg(al, bl, cl, xl); + hypergl(al, bl, cl, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_nan.cc new file mode 100644 index 000000000..c892b2a51 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_nan.cc @@ -0,0 +1,59 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.18 laguerre + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + unsigned int n = 2; + + float a = std::tr1::laguerre(n, xf); + float b = std::tr1::laguerref(n, xf); + double c = std::tr1::laguerre(n, xd); + long double d = std::tr1::laguerre(n, xl); + long double e = std::tr1::laguerrel(n, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_value.cc new file mode 100644 index 000000000..e25e54569 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_value.cc @@ -0,0 +1,469 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// laguerre + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for n=0. +testcase_laguerre<double> data001[] = { + { 1.0000000000000000, 0, 0.0000000000000000 }, + { 1.0000000000000000, 0, 5.0000000000000000 }, + { 1.0000000000000000, 0, 10.000000000000000 }, + { 1.0000000000000000, 0, 15.000000000000000 }, + { 1.0000000000000000, 0, 20.000000000000000 }, + { 1.0000000000000000, 0, 25.000000000000000 }, + { 1.0000000000000000, 0, 30.000000000000000 }, + { 1.0000000000000000, 0, 35.000000000000000 }, + { 1.0000000000000000, 0, 40.000000000000000 }, + { 1.0000000000000000, 0, 45.000000000000000 }, + { 1.0000000000000000, 0, 50.000000000000000 }, + { 1.0000000000000000, 0, 55.000000000000000 }, + { 1.0000000000000000, 0, 60.000000000000000 }, + { 1.0000000000000000, 0, 65.000000000000000 }, + { 1.0000000000000000, 0, 70.000000000000000 }, + { 1.0000000000000000, 0, 75.000000000000000 }, + { 1.0000000000000000, 0, 80.000000000000000 }, + { 1.0000000000000000, 0, 85.000000000000000 }, + { 1.0000000000000000, 0, 90.000000000000000 }, + { 1.0000000000000000, 0, 95.000000000000000 }, + { 1.0000000000000000, 0, 100.00000000000000 }, +}; + +// Test function for n=0. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data001[i].n), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=1. +testcase_laguerre<double> data002[] = { + { 1.0000000000000000, 1, 0.0000000000000000 }, + { -4.0000000000000000, 1, 5.0000000000000000 }, + { -9.0000000000000000, 1, 10.000000000000000 }, + { -14.000000000000000, 1, 15.000000000000000 }, + { -19.000000000000000, 1, 20.000000000000000 }, + { -24.000000000000000, 1, 25.000000000000000 }, + { -29.000000000000000, 1, 30.000000000000000 }, + { -34.000000000000000, 1, 35.000000000000000 }, + { -39.000000000000000, 1, 40.000000000000000 }, + { -44.000000000000000, 1, 45.000000000000000 }, + { -49.000000000000000, 1, 50.000000000000000 }, + { -54.000000000000000, 1, 55.000000000000000 }, + { -59.000000000000000, 1, 60.000000000000000 }, + { -64.000000000000000, 1, 65.000000000000000 }, + { -69.000000000000000, 1, 70.000000000000000 }, + { -74.000000000000000, 1, 75.000000000000000 }, + { -79.000000000000000, 1, 80.000000000000000 }, + { -84.000000000000000, 1, 85.000000000000000 }, + { -89.000000000000000, 1, 90.000000000000000 }, + { -94.000000000000000, 1, 95.000000000000000 }, + { -99.000000000000000, 1, 100.00000000000000 }, +}; + +// Test function for n=1. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data002[i].n), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=2. +testcase_laguerre<double> data003[] = { + { 1.0000000000000000, 2, 0.0000000000000000 }, + { 3.5000000000000000, 2, 5.0000000000000000 }, + { 31.000000000000000, 2, 10.000000000000000 }, + { 83.500000000000000, 2, 15.000000000000000 }, + { 161.00000000000000, 2, 20.000000000000000 }, + { 263.50000000000000, 2, 25.000000000000000 }, + { 391.00000000000000, 2, 30.000000000000000 }, + { 543.50000000000000, 2, 35.000000000000000 }, + { 721.00000000000000, 2, 40.000000000000000 }, + { 923.50000000000000, 2, 45.000000000000000 }, + { 1151.0000000000000, 2, 50.000000000000000 }, + { 1403.5000000000000, 2, 55.000000000000000 }, + { 1681.0000000000000, 2, 60.000000000000000 }, + { 1983.5000000000000, 2, 65.000000000000000 }, + { 2311.0000000000000, 2, 70.000000000000000 }, + { 2663.5000000000000, 2, 75.000000000000000 }, + { 3041.0000000000000, 2, 80.000000000000000 }, + { 3443.5000000000000, 2, 85.000000000000000 }, + { 3871.0000000000000, 2, 90.000000000000000 }, + { 4323.5000000000000, 2, 95.000000000000000 }, + { 4801.0000000000000, 2, 100.00000000000000 }, +}; + +// Test function for n=2. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data003[i].n), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=5. +testcase_laguerre<double> data004[] = { + { 1.0000000000000000, 5, 0.0000000000000000 }, + { -3.1666666666666665, 5, 5.0000000000000000 }, + { 34.333333333333329, 5, 10.000000000000000 }, + { -355.25000000000000, 5, 15.000000000000000 }, + { -4765.6666666666670, 5, 20.000000000000000 }, + { -23040.666666666664, 5, 25.000000000000000 }, + { -74399.000000000000, 5, 30.000000000000000 }, + { -190559.41666666663, 5, 35.000000000000000 }, + { -418865.66666666663, 5, 40.000000000000000 }, + { -825411.50000000000, 5, 45.000000000000000 }, + { -1498165.6666666665, 5, 50.000000000000000 }, + { -2550096.9166666670, 5, 55.000000000000000 }, + { -4122299.0000000000, 5, 60.000000000000000 }, + { -6387115.6666666670, 5, 65.000000000000000 }, + { -9551265.6666666679, 5, 70.000000000000000 }, + { -13858967.750000000, 5, 75.000000000000000 }, + { -19595065.666666664, 5, 80.000000000000000 }, + { -27088153.166666668, 5, 85.000000000000000 }, + { -36713699.000000000, 5, 90.000000000000000 }, + { -48897171.916666657, 5, 95.000000000000000 }, + { -64117165.666666664, 5, 100.00000000000000 }, +}; + +// Test function for n=5. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data004[i].n), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=10. +testcase_laguerre<double> data005[] = { + { 1.0000000000000000, 10, 0.0000000000000000 }, + { 1.7562761794532620, 10, 5.0000000000000000 }, + { 27.984126984126981, 10, 10.000000000000000 }, + { -237.51841517857147, 10, 15.000000000000000 }, + { 3227.8077601410932, 10, 20.000000000000000 }, + { -45786.199797453693, 10, 25.000000000000000 }, + { 15129.571428571489, 10, 30.000000000000000 }, + { 7764800.8179494590, 10, 35.000000000000000 }, + { 79724066.608465582, 10, 40.000000000000000 }, + { 469865425.65122765, 10, 45.000000000000000 }, + { 2037190065.3738980, 10, 50.000000000000000 }, + { 7187828002.9825764, 10, 55.000000000000000 }, + { 21804200401.000000, 10, 60.000000000000000 }, + { 58854343015.616211, 10, 65.000000000000000 }, + { 144688291819.51855, 10, 70.000000000000000 }, + { 329425241736.70038, 10, 75.000000000000000 }, + { 703324772760.08276, 10, 80.000000000000000 }, + { 1421627560118.6157, 10, 85.000000000000000 }, + { 2741055412243.8569, 10, 90.000000000000000 }, + { 5071986977681.8652, 10, 95.000000000000000 }, + { 9051283795429.5723, 10, 100.00000000000000 }, +}; + +// Test function for n=10. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data005[i].n), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for n=20. +testcase_laguerre<double> data006[] = { + { 1.0000000000000000, 20, 0.0000000000000000 }, + { 2.0202257444769129, 20, 5.0000000000000000 }, + { -11.961333867812119, 20, 10.000000000000000 }, + { -50.151037960139455, 20, 15.000000000000000 }, + { 2829.4728613531738, 20, 20.000000000000000 }, + { -11583.947899113535, 20, 25.000000000000000 }, + { -18439.424502520938, 20, 30.000000000000000 }, + { -38838.223606979467, 20, 35.000000000000000 }, + { 24799805.877530701, 20, 40.000000000000000 }, + { -673953823.59913290, 20, 45.000000000000000 }, + { 7551960453.7672529, 20, 50.000000000000000 }, + { 31286508510.614754, 20, 55.000000000000000 }, + { -1379223608444.9155, 20, 60.000000000000000 }, + { -6692517968212.9727, 20, 65.000000000000000 }, + { 165423821874449.94, 20, 70.000000000000000 }, + { 3082390018008546.5, 20, 75.000000000000000 }, + { 29500368536981676., 20, 80.000000000000000 }, + { 2.0353526354974186e+17, 20, 85.000000000000000 }, + { 1.1292309514432899e+18, 20, 90.000000000000000 }, + { 5.3239262855563100e+18, 20, 95.000000000000000 }, + { 2.2061882785931735e+19, 20, 100.00000000000000 }, +}; + +// Test function for n=20. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data006[i].n), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for n=50. +testcase_laguerre<double> data007[] = { + { 1.0000000000000000, 50, 0.0000000000000000 }, + { 1.4735258819430563, 50, 5.0000000000000000 }, + { 17.534183446338233, 50, 10.000000000000000 }, + { -195.62436619077388, 50, 15.000000000000000 }, + { 980.26961889790766, 50, 20.000000000000000 }, + { 24812.277673870871, 50, 25.000000000000000 }, + { 293000.50735962350, 50, 30.000000000000000 }, + { 2316195.5013375296, 50, 35.000000000000000 }, + { -14896937.968694847, 50, 40.000000000000000 }, + { -502066598.00813466, 50, 45.000000000000000 }, + { 2513677852.6916885, 50, 50.000000000000000 }, + { 45129675503.538948, 50, 55.000000000000000 }, + { -883876565337.99207, 50, 60.000000000000000 }, + { 9361319947203.8379, 50, 65.000000000000000 }, + { -80967880733583.219, 50, 70.000000000000000 }, + { 717391079438942.88, 50, 75.000000000000000 }, + { -8217471769564850.0, 50, 80.000000000000000 }, + { 1.2595276229009984e+17, 50, 85.000000000000000 }, + { -2.1140031308048906e+18, 50, 90.000000000000000 }, + { 3.2438187475835138e+19, 50, 95.000000000000000 }, + { -3.9710103487094673e+20, 50, 100.00000000000000 }, +}; + +// Test function for n=50. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data007[i].n), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for n=100. +testcase_laguerre<double> data008[] = { + { 1.0000000000000000, 100, 0.0000000000000000 }, + { 1.4555271625328832, 100, 5.0000000000000000 }, + { 13.277662844303402, 100, 10.000000000000000 }, + { 91.737038454342013, 100, 15.000000000000000 }, + { 1854.0367283243393, 100, 20.000000000000000 }, + { -11281.698886837237, 100, 25.000000000000000 }, + { 170141.86987046539, 100, 30.000000000000000 }, + { -2950092.7025822792, 100, 35.000000000000000 }, + { -7272442.3156007063, 100, 40.000000000000000 }, + { 295697471.90876174, 100, 45.000000000000000 }, + { 4847420871.2690468, 100, 50.000000000000000 }, + { 59406998102.392273, 100, 55.000000000000000 }, + { 693492765740.29736, 100, 60.000000000000000 }, + { 6606192010150.3096, 100, 65.000000000000000 }, + { 17125518672239.707, 100, 70.000000000000000 }, + { -870493767065151.38, 100, 75.000000000000000 }, + { -13763178176383754., 100, 80.000000000000000 }, + { 30667078414479724., 100, 85.000000000000000 }, + { 2.1307220490380198e+18, 100, 90.000000000000000 }, + { -7.2706523009007862e+18, 100, 95.000000000000000 }, + { -2.6292260693068920e+20, 100, 100.00000000000000 }, +}; + +// Test function for n=100. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data008[i].n), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile.cc new file mode 100644 index 000000000..a8bcecbf6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.18 laguerre + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + unsigned int n = 2; + + std::tr1::laguerre(n, xf); + std::tr1::laguerref(n, xf); + std::tr1::laguerre(n, xd); + std::tr1::laguerre(n, xl); + std::tr1::laguerrel(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile_2.cc new file mode 100644 index 000000000..e1bc9a262 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.18 laguerre + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 2; + + laguerre(n, xf); + laguerref(n, xf); + laguerre(n, xd); + laguerre(n, xl); + laguerrel(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_nan.cc new file mode 100644 index 000000000..ed2881f1c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_nan.cc @@ -0,0 +1,59 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.19 legendre + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + unsigned int l = 2; + + float a = std::tr1::legendre(l, xf); + float b = std::tr1::legendref(l, xf); + double c = std::tr1::legendre(l, xd); + long double d = std::tr1::legendre(l, xl); + long double e = std::tr1::legendrel(l, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_value.cc new file mode 100644 index 000000000..b6b973581 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_value.cc @@ -0,0 +1,469 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// legendre + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for l=0. +testcase_legendre<double> data001[] = { + { 1.0000000000000000, 0, -1.0000000000000000 }, + { 1.0000000000000000, 0, -0.90000000000000002 }, + { 1.0000000000000000, 0, -0.80000000000000004 }, + { 1.0000000000000000, 0, -0.69999999999999996 }, + { 1.0000000000000000, 0, -0.59999999999999998 }, + { 1.0000000000000000, 0, -0.50000000000000000 }, + { 1.0000000000000000, 0, -0.40000000000000002 }, + { 1.0000000000000000, 0, -0.30000000000000004 }, + { 1.0000000000000000, 0, -0.19999999999999996 }, + { 1.0000000000000000, 0, -0.099999999999999978 }, + { 1.0000000000000000, 0, 0.0000000000000000 }, + { 1.0000000000000000, 0, 0.10000000000000009 }, + { 1.0000000000000000, 0, 0.19999999999999996 }, + { 1.0000000000000000, 0, 0.30000000000000004 }, + { 1.0000000000000000, 0, 0.39999999999999991 }, + { 1.0000000000000000, 0, 0.50000000000000000 }, + { 1.0000000000000000, 0, 0.60000000000000009 }, + { 1.0000000000000000, 0, 0.69999999999999996 }, + { 1.0000000000000000, 0, 0.80000000000000004 }, + { 1.0000000000000000, 0, 0.89999999999999991 }, + { 1.0000000000000000, 0, 1.0000000000000000 }, +}; + +// Test function for l=0. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data001[i].l), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=1. +testcase_legendre<double> data002[] = { + { -1.0000000000000000, 1, -1.0000000000000000 }, + { -0.90000000000000002, 1, -0.90000000000000002 }, + { -0.80000000000000004, 1, -0.80000000000000004 }, + { -0.69999999999999996, 1, -0.69999999999999996 }, + { -0.59999999999999998, 1, -0.59999999999999998 }, + { -0.50000000000000000, 1, -0.50000000000000000 }, + { -0.40000000000000002, 1, -0.40000000000000002 }, + { -0.30000000000000004, 1, -0.30000000000000004 }, + { -0.19999999999999996, 1, -0.19999999999999996 }, + { -0.099999999999999978, 1, -0.099999999999999978 }, + { 0.0000000000000000, 1, 0.0000000000000000 }, + { 0.10000000000000009, 1, 0.10000000000000009 }, + { 0.19999999999999996, 1, 0.19999999999999996 }, + { 0.30000000000000004, 1, 0.30000000000000004 }, + { 0.39999999999999991, 1, 0.39999999999999991 }, + { 0.50000000000000000, 1, 0.50000000000000000 }, + { 0.60000000000000009, 1, 0.60000000000000009 }, + { 0.69999999999999996, 1, 0.69999999999999996 }, + { 0.80000000000000004, 1, 0.80000000000000004 }, + { 0.89999999999999991, 1, 0.89999999999999991 }, + { 1.0000000000000000, 1, 1.0000000000000000 }, +}; + +// Test function for l=1. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data002[i].l), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=2. +testcase_legendre<double> data003[] = { + { 1.0000000000000000, 2, -1.0000000000000000 }, + { 0.71500000000000008, 2, -0.90000000000000002 }, + { 0.46000000000000019, 2, -0.80000000000000004 }, + { 0.23499999999999988, 2, -0.69999999999999996 }, + { 0.039999999999999925, 2, -0.59999999999999998 }, + { -0.12500000000000000, 2, -0.50000000000000000 }, + { -0.25999999999999995, 2, -0.40000000000000002 }, + { -0.36499999999999999, 2, -0.30000000000000004 }, + { -0.44000000000000006, 2, -0.19999999999999996 }, + { -0.48499999999999999, 2, -0.099999999999999978 }, + { -0.50000000000000000, 2, 0.0000000000000000 }, + { -0.48499999999999999, 2, 0.10000000000000009 }, + { -0.44000000000000006, 2, 0.19999999999999996 }, + { -0.36499999999999999, 2, 0.30000000000000004 }, + { -0.26000000000000012, 2, 0.39999999999999991 }, + { -0.12500000000000000, 2, 0.50000000000000000 }, + { 0.040000000000000147, 2, 0.60000000000000009 }, + { 0.23499999999999988, 2, 0.69999999999999996 }, + { 0.46000000000000019, 2, 0.80000000000000004 }, + { 0.71499999999999986, 2, 0.89999999999999991 }, + { 1.0000000000000000, 2, 1.0000000000000000 }, +}; + +// Test function for l=2. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data003[i].l), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5. +testcase_legendre<double> data004[] = { + { -1.0000000000000000, 5, -1.0000000000000000 }, + { 0.041141249999999997, 5, -0.90000000000000002 }, + { 0.39951999999999993, 5, -0.80000000000000004 }, + { 0.36519874999999991, 5, -0.69999999999999996 }, + { 0.15263999999999994, 5, -0.59999999999999998 }, + { -0.089843750000000000, 5, -0.50000000000000000 }, + { -0.27063999999999988, 5, -0.40000000000000002 }, + { -0.34538624999999995, 5, -0.30000000000000004 }, + { -0.30751999999999996, 5, -0.19999999999999996 }, + { -0.17882874999999995, 5, -0.099999999999999978 }, + { 0.0000000000000000, 5, 0.0000000000000000 }, + { 0.17882875000000015, 5, 0.10000000000000009 }, + { 0.30751999999999996, 5, 0.19999999999999996 }, + { 0.34538624999999995, 5, 0.30000000000000004 }, + { 0.27064000000000010, 5, 0.39999999999999991 }, + { 0.089843750000000000, 5, 0.50000000000000000 }, + { -0.15264000000000022, 5, 0.60000000000000009 }, + { -0.36519874999999991, 5, 0.69999999999999996 }, + { -0.39951999999999993, 5, 0.80000000000000004 }, + { -0.041141250000000407, 5, 0.89999999999999991 }, + { 1.0000000000000000, 5, 1.0000000000000000 }, +}; + +// Test function for l=5. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data004[i].l), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10. +testcase_legendre<double> data005[] = { + { 1.0000000000000000, 10, -1.0000000000000000 }, + { -0.26314561785585977, 10, -0.90000000000000002 }, + { 0.30052979559999998, 10, -0.80000000000000004 }, + { 0.085805795531640333, 10, -0.69999999999999996 }, + { -0.24366274560000006, 10, -0.59999999999999998 }, + { -0.18822860717773438, 10, -0.50000000000000000 }, + { 0.096839064399999869, 10, -0.40000000000000002 }, + { 0.25147634951601561, 10, -0.30000000000000004 }, + { 0.12907202559999989, 10, -0.19999999999999996 }, + { -0.12212499738710947, 10, -0.099999999999999978 }, + { -0.24609375000000000, 10, 0.0000000000000000 }, + { -0.12212499738710922, 10, 0.10000000000000009 }, + { 0.12907202559999989, 10, 0.19999999999999996 }, + { 0.25147634951601561, 10, 0.30000000000000004 }, + { 0.096839064400000258, 10, 0.39999999999999991 }, + { -0.18822860717773438, 10, 0.50000000000000000 }, + { -0.24366274559999987, 10, 0.60000000000000009 }, + { 0.085805795531640333, 10, 0.69999999999999996 }, + { 0.30052979559999998, 10, 0.80000000000000004 }, + { -0.26314561785585888, 10, 0.89999999999999991 }, + { 1.0000000000000000, 10, 1.0000000000000000 }, +}; + +// Test function for l=10. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data005[i].l), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20. +testcase_legendre<double> data006[] = { + { 1.0000000000000000, 20, -1.0000000000000000 }, + { -0.14930823530984821, 20, -0.90000000000000002 }, + { 0.22420460541741344, 20, -0.80000000000000004 }, + { -0.20457394463834172, 20, -0.69999999999999996 }, + { 0.15916752910098114, 20, -0.59999999999999998 }, + { -0.048358381067373557, 20, -0.50000000000000000 }, + { -0.10159261558628156, 20, -0.40000000000000002 }, + { 0.18028715947998047, 20, -0.30000000000000004 }, + { -0.098042194344594741, 20, -0.19999999999999996 }, + { -0.082077130944527649, 20, -0.099999999999999978 }, + { 0.17619705200195312, 20, 0.0000000000000000 }, + { -0.082077130944528037, 20, 0.10000000000000009 }, + { -0.098042194344594741, 20, 0.19999999999999996 }, + { 0.18028715947998047, 20, 0.30000000000000004 }, + { -0.10159261558628112, 20, 0.39999999999999991 }, + { -0.048358381067373557, 20, 0.50000000000000000 }, + { 0.15916752910098084, 20, 0.60000000000000009 }, + { -0.20457394463834172, 20, 0.69999999999999996 }, + { 0.22420460541741344, 20, 0.80000000000000004 }, + { -0.14930823530984949, 20, 0.89999999999999991 }, + { 1.0000000000000000, 20, 1.0000000000000000 }, +}; + +// Test function for l=20. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data006[i].l), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=50. +testcase_legendre<double> data007[] = { + { 1.0000000000000000, 50, -1.0000000000000000 }, + { -0.17003765994383685, 50, -0.90000000000000002 }, + { 0.13879737345093118, 50, -0.80000000000000004 }, + { -0.014572731645892805, 50, -0.69999999999999996 }, + { -0.058860798844002173, 50, -0.59999999999999998 }, + { -0.031059099239609828, 50, -0.50000000000000000 }, + { 0.041569033381825368, 50, -0.40000000000000002 }, + { 0.10911051574714808, 50, -0.30000000000000004 }, + { 0.083432272204197466, 50, -0.19999999999999996 }, + { -0.038205812661313579, 50, -0.099999999999999978 }, + { -0.11227517265921705, 50, 0.0000000000000000 }, + { -0.038205812661314169, 50, 0.10000000000000009 }, + { 0.083432272204197466, 50, 0.19999999999999996 }, + { 0.10911051574714808, 50, 0.30000000000000004 }, + { 0.041569033381824647, 50, 0.39999999999999991 }, + { -0.031059099239609828, 50, 0.50000000000000000 }, + { -0.058860798844001430, 50, 0.60000000000000009 }, + { -0.014572731645892805, 50, 0.69999999999999996 }, + { 0.13879737345093118, 50, 0.80000000000000004 }, + { -0.17003765994383663, 50, 0.89999999999999991 }, + { 1.0000000000000000, 50, 1.0000000000000000 }, +}; + +// Test function for l=50. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data007[i].l), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=100. +testcase_legendre<double> data008[] = { + { 1.0000000000000000, 100, -1.0000000000000000 }, + { 0.10226582055871908, 100, -0.90000000000000002 }, + { 0.050861167913584124, 100, -0.80000000000000004 }, + { -0.077132507199778780, 100, -0.69999999999999996 }, + { -0.023747023905133110, 100, -0.59999999999999998 }, + { -0.060518025961861198, 100, -0.50000000000000000 }, + { -0.072258202125684429, 100, -0.40000000000000002 }, + { 0.057127392202801719, 100, -0.30000000000000004 }, + { 0.014681835355659636, 100, -0.19999999999999996 }, + { -0.063895098434750303, 100, -0.099999999999999978 }, + { 0.079589237387178727, 100, 0.0000000000000000 }, + { -0.063895098434749775, 100, 0.10000000000000009 }, + { 0.014681835355659636, 100, 0.19999999999999996 }, + { 0.057127392202801719, 100, 0.30000000000000004 }, + { -0.072258202125685012, 100, 0.39999999999999991 }, + { -0.060518025961861198, 100, 0.50000000000000000 }, + { -0.023747023905134217, 100, 0.60000000000000009 }, + { -0.077132507199778780, 100, 0.69999999999999996 }, + { 0.050861167913584124, 100, 0.80000000000000004 }, + { 0.10226582055871723, 100, 0.89999999999999991 }, + { 1.0000000000000000, 100, 1.0000000000000000 }, +}; + +// Test function for l=100. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data008[i].l), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile.cc new file mode 100644 index 000000000..98d174c6d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.19 legendre + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + unsigned int l = 2; + + std::tr1::legendre(l, xf); + std::tr1::legendref(l, xf); + std::tr1::legendre(l, xd); + std::tr1::legendre(l, xl); + std::tr1::legendrel(l, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile_2.cc new file mode 100644 index 000000000..da4389a83 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.19 legendre + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int l = 2; + + legendre(l, xf); + legendref(l, xf); + legendre(l, xd); + legendre(l, xl); + legendrel(l, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_nan.cc new file mode 100644 index 000000000..e28dfb47b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_nan.cc @@ -0,0 +1,57 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.20 riemann_zeta + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + float a = std::tr1::riemann_zeta(xf); + float b = std::tr1::riemann_zetaf(xf); + double c = std::tr1::riemann_zeta(xd); + long double d = std::tr1::riemann_zeta(xl); + long double e = std::tr1::riemann_zetal(xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_neg.cc new file mode 100644 index 000000000..ac729692f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_neg.cc @@ -0,0 +1,137 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// riemann_zeta + +// This can take long on simulators, timing out the test. +// { dg-options "-DMAX_ITERATIONS=5" { target simulator } } + +#ifndef MAX_ITERATIONS +#define MAX_ITERATIONS (sizeof(data001) / sizeof(testcase_riemann_zeta<double>)) +#endif + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data. +testcase_riemann_zeta<double> data001[] = { + { 0.0000000000000000, -10.000000000000000 }, + { -0.0033669820451019579, -9.8000000000000007 }, + { -0.0058129517767319039, -9.5999999999999996 }, + { -0.0072908732290557004, -9.4000000000000004 }, + { -0.0078420910654484442, -9.1999999999999993 }, + { -0.0075757575757575803, -9.0000000000000000 }, + { -0.0066476555677551898, -8.8000000000000007 }, + { -0.0052400095350859429, -8.5999999999999996 }, + { -0.0035434308017674959, -8.4000000000000004 }, + { -0.0017417330388368585, -8.1999999999999993 }, + { 0.0000000000000000, -8.0000000000000000 }, + { 0.0015440036789213965, -7.7999999999999998 }, + { 0.0027852131086497423, -7.5999999999999996 }, + { 0.0036537321227995880, -7.4000000000000004 }, + { 0.0041147930817053468, -7.2000000000000002 }, + { 0.0041666666666666683, -7.0000000000000000 }, + { 0.0038369975032738366, -6.7999999999999998 }, + { 0.0031780270571782981, -6.5999999999999996 }, + { 0.0022611282027338573, -6.4000000000000004 }, + { 0.0011710237049390511, -6.2000000000000002 }, + { 0.0000000000000000, -6.0000000000000000 }, + { -0.0011576366649881879, -5.7999999999999998 }, + { -0.0022106784318564345, -5.5999999999999996 }, + { -0.0030755853460586891, -5.4000000000000004 }, + { -0.0036804380477934787, -5.2000000000000002 }, + { -0.0039682539682539698, -5.0000000000000000 }, + { -0.0038996891301999797, -4.7999999999999998 }, + { -0.0034551830834302711, -4.5999999999999996 }, + { -0.0026366345018725115, -4.4000000000000004 }, + { -0.0014687209305056974, -4.2000000000000002 }, + { 0.0000000000000000, -4.0000000000000000 }, + { 0.0016960463875825209, -3.7999999999999998 }, + { 0.0035198355903356747, -3.5999999999999996 }, + { 0.0053441503206513421, -3.4000000000000004 }, + { 0.0070119720770910540, -3.2000000000000002 }, + { 0.0083333333333333350, -3.0000000000000000 }, + { 0.0090807294856852811, -2.7999999999999998 }, + { 0.0089824623788396681, -2.5999999999999996 }, + { 0.0077130239874243630, -2.4000000000000004 }, + { 0.0048792123593036068, -2.2000000000000002 }, + { 0.0000000000000000, -2.0000000000000000 }, + { -0.0075229347765968010, -1.8000000000000007 }, + { -0.018448986678963775, -1.5999999999999996 }, + { -0.033764987694047593, -1.4000000000000004 }, + { -0.054788441243880631, -1.1999999999999993 }, + { -0.083333333333333398, -1.0000000000000000 }, + { -0.12198707766977103, -0.80000000000000071 }, + { -0.17459571193801401, -0.59999999999999964 }, + { -0.24716546083171492, -0.40000000000000036 }, + { -0.34966628059831484, -0.19999999999999929 }, + { -0.49999999999999994, 0.0000000000000000 }, + { -0.73392092489633953, 0.19999999999999929 }, + { -1.1347977838669825, 0.40000000000000036 }, + { -1.9526614482239983, 0.59999999999999964 }, + { -4.4375384158955677, 0.80000000000000071 }, +}; + +// Test function. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = MAX_ITERATIONS; + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::riemann_zeta(Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +int main(int, char**) +{ + test001<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_pos.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_pos.cc new file mode 100644 index 000000000..9cdbb4a02 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_pos.cc @@ -0,0 +1,227 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// riemann_zeta + +// This can take long on simulators, timing out the test. +// { dg-options "-DMAX_ITERATIONS=5" { target simulator } } + +#ifndef MAX_ITERATIONS +#define MAX_ITERATIONS (sizeof(data001) / sizeof(testcase_riemann_zeta<double>)) +#endif + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data. +testcase_riemann_zeta<double> data001[] = { + { 5.5915824411777502, 1.2000000000000000 }, + { 3.1055472779775792, 1.3999999999999999 }, + { 2.2857656656801324, 1.6000000000000001 }, + { 1.8822296181028220, 1.8000000000000000 }, + { 1.6449340668482275, 2.0000000000000000 }, + { 1.4905432565068937, 2.2000000000000002 }, + { 1.3833428588407359, 2.3999999999999999 }, + { 1.3054778090727803, 2.6000000000000001 }, + { 1.2470314223172541, 2.7999999999999998 }, + { 1.2020569031595945, 3.0000000000000000 }, + { 1.1667733709844674, 3.2000000000000002 }, + { 1.1386637757280420, 3.3999999999999999 }, + { 1.1159890791233376, 3.6000000000000001 }, + { 1.0975105764590047, 3.7999999999999998 }, + { 1.0823232337111381, 4.0000000000000000 }, + { 1.0697514772338095, 4.2000000000000002 }, + { 1.0592817259798355, 4.4000000000000004 }, + { 1.0505173825665735, 4.5999999999999996 }, + { 1.0431480133351789, 4.7999999999999998 }, + { 1.0369277551433700, 5.0000000000000000 }, + { 1.0316598766779168, 5.2000000000000002 }, + { 1.0271855389203537, 5.4000000000000004 }, + { 1.0233754792270300, 5.5999999999999996 }, + { 1.0201237683883446, 5.7999999999999998 }, + { 1.0173430619844492, 6.0000000000000000 }, + { 1.0149609451852233, 6.2000000000000002 }, + { 1.0129170887121841, 6.4000000000000004 }, + { 1.0111610141542708, 6.5999999999999996 }, + { 1.0096503223447120, 6.7999999999999998 }, + { 1.0083492773819229, 7.0000000000000000 }, + { 1.0072276664807169, 7.2000000000000002 }, + { 1.0062598756930512, 7.4000000000000004 }, + { 1.0054241359879634, 7.5999999999999996 }, + { 1.0047019048164696, 7.7999999999999998 }, + { 1.0040773561979444, 8.0000000000000000 }, + { 1.0035369583062013, 8.1999999999999993 }, + { 1.0030691220374448, 8.4000000000000004 }, + { 1.0026639074861505, 8.5999999999999996 }, + { 1.0023127779098220, 8.8000000000000007 }, + { 1.0020083928260823, 9.0000000000000000 }, + { 1.0017444334995897, 9.1999999999999993 }, + { 1.0015154553480514, 9.4000000000000004 }, + { 1.0013167628052648, 9.5999999999999996 }, + { 1.0011443029840295, 9.8000000000000007 }, + { 1.0009945751278182, 10.000000000000000 }, + { 1.0008645533615086, 10.199999999999999 }, + { 1.0007516206744649, 10.400000000000000 }, + { 1.0006535124140847, 10.600000000000000 }, + { 1.0005682678503411, 10.800000000000001 }, + { 1.0004941886041194, 11.000000000000000 }, + { 1.0004298029239944, 11.199999999999999 }, + { 1.0003738349551168, 11.400000000000000 }, + { 1.0003251782761946, 11.600000000000000 }, + { 1.0002828730909989, 11.800000000000001 }, + { 1.0002460865533080, 12.000000000000000 }, + { 1.0002140957818750, 12.199999999999999 }, + { 1.0001862731874056, 12.400000000000000 }, + { 1.0001620737887460, 12.600000000000000 }, + { 1.0001410242422089, 12.800000000000001 }, + { 1.0001227133475783, 13.000000000000000 }, + { 1.0001067838280169, 13.199999999999999 }, + { 1.0000929252097515, 13.400000000000000 }, + { 1.0000808676518718, 13.600000000000000 }, + { 1.0000703765974504, 13.800000000000001 }, + { 1.0000612481350588, 14.000000000000000 }, + { 1.0000533049750668, 14.199999999999999 }, + { 1.0000463929582293, 14.400000000000000 }, + { 1.0000403780253397, 14.600000000000000 }, + { 1.0000351435864272, 14.800000000000001 }, + { 1.0000305882363070, 15.000000000000000 }, + { 1.0000266237704787, 15.199999999999999 }, + { 1.0000231734615617, 15.400000000000000 }, + { 1.0000201705617975, 15.600000000000000 }, + { 1.0000175570017611, 15.800000000000001 }, + { 1.0000152822594086, 16.000000000000000 }, + { 1.0000133023770337, 16.199999999999999 }, + { 1.0000115791066830, 16.399999999999999 }, + { 1.0000100791671644, 16.600000000000001 }, + { 1.0000087735980010, 16.800000000000001 }, + { 1.0000076371976379, 17.000000000000000 }, + { 1.0000066480348633, 17.199999999999999 }, + { 1.0000057870238734, 17.399999999999999 }, + { 1.0000050375546607, 17.600000000000001 }, + { 1.0000043851715013, 17.800000000000001 }, + { 1.0000038172932648, 18.000000000000000 }, + { 1.0000033229700953, 18.199999999999999 }, + { 1.0000028926717153, 18.399999999999999 }, + { 1.0000025181032419, 18.600000000000001 }, + { 1.0000021920449287, 18.800000000000001 }, + { 1.0000019082127167, 19.000000000000000 }, + { 1.0000016611368951, 19.199999999999999 }, + { 1.0000014460565094, 19.399999999999999 }, + { 1.0000012588274738, 19.600000000000001 }, + { 1.0000010958426055, 19.800000000000001 }, + { 1.0000009539620338, 20.000000000000000 }, + { 1.0000008304526344, 20.199999999999999 }, + { 1.0000007229353187, 20.399999999999999 }, + { 1.0000006293391575, 20.600000000000001 }, + { 1.0000005478614529, 20.800000000000001 }, + { 1.0000004769329869, 21.000000000000000 }, + { 1.0000004151877719, 21.199999999999999 }, + { 1.0000003614367254, 21.399999999999999 }, + { 1.0000003146447527, 21.600000000000001 }, + { 1.0000002739108020, 21.800000000000001 }, + { 1.0000002384505029, 22.000000000000000 }, + { 1.0000002075810521, 22.199999999999999 }, + { 1.0000001807080625, 22.399999999999999 }, + { 1.0000001573141093, 22.600000000000001 }, + { 1.0000001369487659, 22.800000000000001 }, + { 1.0000001192199262, 23.000000000000000 }, + { 1.0000001037862520, 23.199999999999999 }, + { 1.0000000903506006, 23.399999999999999 }, + { 1.0000000786543011, 23.600000000000001 }, + { 1.0000000684721728, 23.800000000000001 }, + { 1.0000000596081891, 24.000000000000000 }, + { 1.0000000518917020, 24.199999999999999 }, + { 1.0000000451741575, 24.399999999999999 }, + { 1.0000000393262332, 24.600000000000001 }, + { 1.0000000342353501, 24.800000000000001 }, + { 1.0000000298035037, 25.000000000000000 }, + { 1.0000000259453767, 25.199999999999999 }, + { 1.0000000225866978, 25.399999999999999 }, + { 1.0000000196628109, 25.600000000000001 }, + { 1.0000000171174297, 25.800000000000001 }, + { 1.0000000149015549, 26.000000000000000 }, + { 1.0000000129725304, 26.199999999999999 }, + { 1.0000000112932221, 26.399999999999999 }, + { 1.0000000098313035, 26.600000000000001 }, + { 1.0000000085586331, 26.800000000000001 }, + { 1.0000000074507118, 27.000000000000000 }, + { 1.0000000064862125, 27.199999999999999 }, + { 1.0000000056465688, 27.399999999999999 }, + { 1.0000000049156179, 27.600000000000001 }, + { 1.0000000042792894, 27.800000000000001 }, + { 1.0000000037253340, 28.000000000000000 }, + { 1.0000000032430887, 28.199999999999999 }, + { 1.0000000028232703, 28.399999999999999 }, + { 1.0000000024577977, 28.600000000000001 }, + { 1.0000000021396356, 28.800000000000001 }, + { 1.0000000018626598, 29.000000000000000 }, + { 1.0000000016215385, 29.199999999999999 }, + { 1.0000000014116306, 29.399999999999999 }, + { 1.0000000012288952, 29.600000000000001 }, + { 1.0000000010698147, 29.800000000000001 }, + { 1.0000000009313275, 30.000000000000000 }, +}; + +// Test function. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = MAX_ITERATIONS; + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::riemann_zeta(Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile.cc new file mode 100644 index 000000000..62883f87a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.20 riemann_zeta + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + std::tr1::riemann_zeta(xf); + std::tr1::riemann_zetaf(xf); + std::tr1::riemann_zeta(xd); + std::tr1::riemann_zeta(xl); + std::tr1::riemann_zetal(xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile_2.cc new file mode 100644 index 000000000..6e3c7a0a3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile_2.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.20 riemann_zeta + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + riemann_zeta(xf); + riemann_zetaf(xf); + riemann_zeta(xd); + riemann_zeta(xl); + riemann_zetal(xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_nan.cc new file mode 100644 index 000000000..457b49a2e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_nan.cc @@ -0,0 +1,58 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.21 sph_bessel + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + unsigned int n = 0; + + float a = std::tr1::sph_bessel(n, xf); + float b = std::tr1::sph_besself(n, xf); + double c = std::tr1::sph_bessel(n, xd); + long double d = std::tr1::sph_bessel(n, xl); + long double e = std::tr1::sph_bessell(n, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_value.cc new file mode 100644 index 000000000..89dcec430 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_value.cc @@ -0,0 +1,469 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// sph_bessel + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for n=0. +testcase_sph_bessel<double> data001[] = { + { 1.0000000000000000, 0, 0.0000000000000000 }, + { -0.19178485493262770, 0, 5.0000000000000000 }, + { -0.054402111088936986, 0, 10.000000000000000 }, + { 0.043352522677141132, 0, 15.000000000000000 }, + { 0.045647262536381385, 0, 20.000000000000000 }, + { -0.0052940700039109216, 0, 25.000000000000000 }, + { -0.032934387469762058, 0, 30.000000000000000 }, + { -0.012233790557032886, 0, 35.000000000000000 }, + { 0.018627829011983722, 0, 40.000000000000000 }, + { 0.018908967211869299, 0, 45.000000000000000 }, + { -0.0052474970740785751, 0, 50.000000000000000 }, + { -0.018177366788338544, 0, 55.000000000000000 }, + { -0.0050801770183702783, 0, 60.000000000000000 }, + { 0.012720441222924669, 0, 65.000000000000000 }, + { 0.011055581165112701, 0, 70.000000000000000 }, + { -0.0051704218054590724, 0, 75.000000000000000 }, + { -0.012423608174042190, 0, 80.000000000000000 }, + { -0.0020714778817480834, 0, 85.000000000000000 }, + { 0.0099332962622284207, 0, 90.000000000000000 }, + { 0.0071922285761696946, 0, 95.000000000000000 }, + { -0.0050636564110975880, 0, 100.00000000000000 }, +}; + +// Test function for n=0. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data001[i].n), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for n=1. +testcase_sph_bessel<double> data002[] = { + { 0.0000000000000000, 1, 0.0000000000000000 }, + { -0.095089408079170795, 1, 5.0000000000000000 }, + { 0.078466941798751549, 1, 10.000000000000000 }, + { 0.053536029035730834, 1, 15.000000000000000 }, + { -0.018121739963850528, 1, 20.000000000000000 }, + { -0.039859875274695380, 1, 25.000000000000000 }, + { -0.0062395279119115375, 1, 30.000000000000000 }, + { 0.025470240415270681, 1, 35.000000000000000 }, + { 0.017139147266606137, 1, 40.000000000000000 }, + { -0.011253622702352454, 1, 45.000000000000000 }, + { -0.019404270511323839, 1, 50.000000000000000 }, + { -0.00073280223727807778, 1, 55.000000000000000 }, + { 0.015788880056613101, 1, 60.000000000000000 }, + { 0.0088488352686322581, 1, 65.000000000000000 }, + { -0.0088894803131598157, 1, 70.000000000000000 }, + { -0.012358955887069445, 1, 75.000000000000000 }, + { 0.0012245454458125673, 1, 80.000000000000000 }, + { 0.011556531358968161, 1, 85.000000000000000 }, + { 0.0050889656932377614, 1, 90.000000000000000 }, + { -0.0076103298149331573, 1, 95.000000000000000 }, + { -0.0086738252869878150, 1, 100.00000000000000 }, +}; + +// Test function for n=1. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data002[i].n), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for n=2. +testcase_sph_bessel<double> data003[] = { + { 0.0000000000000000, 2, 0.0000000000000000 }, + { 0.13473121008512520, 2, 5.0000000000000000 }, + { 0.077942193628562445, 2, 10.000000000000000 }, + { -0.032645316869994966, 2, 15.000000000000000 }, + { -0.048365523530958965, 2, 20.000000000000000 }, + { 0.00051088497094747614, 2, 25.000000000000000 }, + { 0.032310434678570907, 2, 30.000000000000000 }, + { 0.014416954021198945, 2, 35.000000000000000 }, + { -0.017342392966988262, 2, 40.000000000000000 }, + { -0.019659208725359461, 2, 45.000000000000000 }, + { 0.0040832408433991458, 2, 50.000000000000000 }, + { 0.018137395757214285, 2, 55.000000000000000 }, + { 0.0058696210212009327, 2, 60.000000000000000 }, + { -0.012312033441295490, 2, 65.000000000000000 }, + { -0.011436558892819550, 2, 70.000000000000000 }, + { 0.0046760635699762939, 2, 75.000000000000000 }, + { 0.012469528628260161, 2, 80.000000000000000 }, + { 0.0024793554591234306, 2, 85.000000000000000 }, + { -0.0097636640724538277, 2, 90.000000000000000 }, + { -0.0074325547808517939, 2, 95.000000000000000 }, + { 0.0048034416524879537, 2, 100.00000000000000 }, +}; + +// Test function for n=2. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data003[i].n), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for n=5. +testcase_sph_bessel<double> data004[] = { + { 0.0000000000000000, 5, 0.0000000000000000 }, + { 0.10681116145650454, 5, 5.0000000000000000 }, + { -0.055534511621452197, 5, 10.000000000000000 }, + { 0.065968007076521964, 5, 15.000000000000000 }, + { 0.016683908063095686, 5, 20.000000000000000 }, + { -0.036117795989722368, 5, 25.000000000000000 }, + { -0.020504008736827509, 5, 30.000000000000000 }, + { 0.018499481206814564, 5, 35.000000000000000 }, + { 0.022448773791045016, 5, 40.000000000000000 }, + { -0.0048552694845020103, 5, 45.000000000000000 }, + { -0.020048300563664877, 5, 50.000000000000000 }, + { -0.0052999924455565672, 5, 55.000000000000000 }, + { 0.014151556281331405, 5, 60.000000000000000 }, + { 0.011354588594416765, 5, 65.000000000000000 }, + { -0.0064983781785323642, 5, 70.000000000000000 }, + { -0.013089909320064264, 5, 75.000000000000000 }, + { -0.00096200450071301611, 5, 80.000000000000000 }, + { 0.011048668899130202, 5, 85.000000000000000 }, + { 0.0065639581708135976, 5, 90.000000000000000 }, + { -0.0064646119368202771, 5, 95.000000000000000 }, + { -0.0092901489349075713, 5, 100.00000000000000 }, +}; + +// Test function for n=5. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data004[i].n), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for n=10. +testcase_sph_bessel<double> data005[] = { + { 0.0000000000000000, 10, 0.0000000000000000 }, + { 0.00040734424424946052, 10, 5.0000000000000000 }, + { 0.064605154492564279, 10, 10.000000000000000 }, + { 0.0018969790010883629, 10, 15.000000000000000 }, + { 0.039686698644626366, 10, 20.000000000000000 }, + { -0.036253285601128567, 10, 25.000000000000000 }, + { -0.014529646403897820, 10, 30.000000000000000 }, + { 0.026281264603993850, 10, 35.000000000000000 }, + { 0.013124803182748307, 10, 40.000000000000000 }, + { -0.017600831383728963, 10, 45.000000000000000 }, + { -0.015039221463465962, 10, 50.000000000000000 }, + { 0.0095256289349167356, 10, 55.000000000000000 }, + { 0.015822719394008342, 10, 60.000000000000000 }, + { -0.0019391391708249812, 10, 65.000000000000000 }, + { -0.014293389028395010, 10, 70.000000000000000 }, + { -0.0044210285031696184, 10, 75.000000000000000 }, + { 0.010516146958338822, 10, 80.000000000000000 }, + { 0.0086736275131325761, 10, 85.000000000000000 }, + { -0.0052905066357239365, 10, 90.000000000000000 }, + { -0.010258326955210765, 10, 95.000000000000000 }, + { -0.00019565785971342893, 10, 100.00000000000000 }, +}; + +// Test function for n=10. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data005[i].n), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for n=20. +testcase_sph_bessel<double> data006[] = { + { 0.0000000000000000, 20, 0.0000000000000000 }, + { 5.4277267607932098e-12, 20, 5.0000000000000000 }, + { 2.3083719613194699e-06, 20, 10.000000000000000 }, + { 0.0015467058510412503, 20, 15.000000000000000 }, + { 0.038324851639805181, 20, 20.000000000000000 }, + { 0.028500071484154683, 20, 25.000000000000000 }, + { -0.014711593353429090, 20, 30.000000000000000 }, + { -0.010797653070264238, 20, 35.000000000000000 }, + { 0.026535391837540286, 20, 40.000000000000000 }, + { -0.011582959134716381, 20, 45.000000000000000 }, + { -0.015785029898269291, 20, 50.000000000000000 }, + { 0.013885519185862756, 20, 55.000000000000000 }, + { 0.011112458964023256, 20, 60.000000000000000 }, + { -0.011938384963927570, 20, 65.000000000000000 }, + { -0.010117695207156906, 20, 70.000000000000000 }, + { 0.0089871214102383128, 20, 75.000000000000000 }, + { 0.010400578884991936, 20, 80.000000000000000 }, + { -0.0055359020656326630, 20, 85.000000000000000 }, + { -0.010639343320787519, 20, 90.000000000000000 }, + { 0.0018051661455979488, 20, 95.000000000000000 }, + { 0.010107671283873054, 20, 100.00000000000000 }, +}; + +// Test function for n=20. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data006[i].n), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for n=50. +testcase_sph_bessel<double> data007[] = { + { 0.0000000000000000, 50, 0.0000000000000000 }, + { 2.8574793504401511e-46, 50, 5.0000000000000000 }, + { 2.2306960232186471e-31, 50, 10.000000000000000 }, + { 7.6804716640080780e-23, 50, 15.000000000000000 }, + { 5.6500807918725294e-17, 50, 20.000000000000000 }, + { 1.2540416973758975e-12, 50, 25.000000000000000 }, + { 2.6901637185735330e-09, 50, 30.000000000000000 }, + { 1.0167148174422245e-06, 50, 35.000000000000000 }, + { 9.3949174038179191e-05, 50, 40.000000000000000 }, + { 0.0024888927213794552, 50, 45.000000000000000 }, + { 0.018829107369282640, 50, 50.000000000000000 }, + { 0.026373198438145548, 50, 55.000000000000000 }, + { -0.021230978268739008, 50, 60.000000000000000 }, + { 0.016539881802291316, 50, 65.000000000000000 }, + { -0.015985416061436657, 50, 70.000000000000000 }, + { 0.015462548984405593, 50, 75.000000000000000 }, + { -0.010638570118081834, 50, 80.000000000000000 }, + { 0.00046961239784540576, 50, 85.000000000000000 }, + { 0.0096065882189920234, 50, 90.000000000000000 }, + { -0.010613873910261147, 50, 95.000000000000000 }, + { 0.00057971408822773810, 50, 100.00000000000000 }, +}; + +// Test function for n=50. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data007[i].n), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000017e-10)); +} + +// Test data for n=100. +testcase_sph_bessel<double> data008[] = { + { 0.0000000000000000, 100, 0.0000000000000000 }, + { 5.5356503033889938e-120, 100, 5.0000000000000000 }, + { 5.8320401820058771e-90, 100, 10.000000000000000 }, + { 1.7406387750766626e-72, 100, 15.000000000000000 }, + { 3.5152711125317001e-60, 100, 20.000000000000000 }, + { 9.8455459353816024e-51, 100, 25.000000000000000 }, + { 4.0888596744301567e-43, 100, 30.000000000000000 }, + { 8.8975854911134006e-37, 100, 35.000000000000000 }, + { 2.1513492547733837e-31, 100, 40.000000000000000 }, + { 9.3673586994539323e-27, 100, 45.000000000000000 }, + { 1.0190122629310465e-22, 100, 50.000000000000000 }, + { 3.4887804977690321e-19, 100, 55.000000000000000 }, + { 4.4442883425555691e-16, 100, 60.000000000000000 }, + { 2.3832619568710733e-13, 100, 65.000000000000000 }, + { 5.8948384175608103e-11, 100, 70.000000000000000 }, + { 7.1884446357022268e-09, 100, 75.000000000000000 }, + { 4.5247964400094991e-07, 100, 80.000000000000000 }, + { 1.5096093228779059e-05, 100, 85.000000000000000 }, + { 0.00026825172647807507, 100, 90.000000000000000 }, + { 0.0024744308520581030, 100, 95.000000000000000 }, + { 0.010880477011438327, 100, 100.00000000000000 }, +}; + +// Test function for n=100. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data008[i].n), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile.cc new file mode 100644 index 000000000..49ac8f36a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.21 sph_bessel + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 0; + + std::tr1::sph_bessel(n, xf); + std::tr1::sph_besself(n, xf); + std::tr1::sph_bessel(n, xd); + std::tr1::sph_bessel(n, xl); + std::tr1::sph_bessell(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile_2.cc new file mode 100644 index 000000000..a3531c0b9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.21 sph_bessel + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 0; + + sph_bessel(n, xf); + sph_besself(n, xf); + sph_bessel(n, xd); + sph_bessel(n, xl); + sph_bessell(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_nan.cc new file mode 100644 index 000000000..fa2069b07 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_nan.cc @@ -0,0 +1,58 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.22 sph_legendre + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float thetaf = std::numeric_limits<float>::quiet_NaN(); + double thetad = std::numeric_limits<double>::quiet_NaN(); + long double thetal = std::numeric_limits<long double>::quiet_NaN(); + unsigned int l = 2, m = 1; + + float a = std::tr1::sph_legendre(l, m, thetaf); + float b = std::tr1::sph_legendref(l, m, thetaf); + double c = std::tr1::sph_legendre(l, m, thetad); + long double d = std::tr1::sph_legendre(l, m, thetal); + long double e = std::tr1::sph_legendrel(l, m, thetal); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_value.cc new file mode 100644 index 000000000..f59625cbf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_value.cc @@ -0,0 +1,2745 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// sph_legendre + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for l=0, m=0. +testcase_sph_legendre<double> data001[] = { + { 0.28209479177387814, 0, 0, + 0.0000000000000000 }, + { 0.28209479177387814, 0, 0, + 0.15707963267948966 }, + { 0.28209479177387814, 0, 0, + 0.31415926535897931 }, + { 0.28209479177387814, 0, 0, + 0.47123889803846897 }, + { 0.28209479177387814, 0, 0, + 0.62831853071795862 }, + { 0.28209479177387814, 0, 0, + 0.78539816339744828 }, + { 0.28209479177387814, 0, 0, + 0.94247779607693793 }, + { 0.28209479177387814, 0, 0, + 1.0995574287564276 }, + { 0.28209479177387814, 0, 0, + 1.2566370614359172 }, + { 0.28209479177387814, 0, 0, + 1.4137166941154069 }, + { 0.28209479177387814, 0, 0, + 1.5707963267948966 }, + { 0.28209479177387814, 0, 0, + 1.7278759594743860 }, + { 0.28209479177387814, 0, 0, + 1.8849555921538759 }, + { 0.28209479177387814, 0, 0, + 2.0420352248333655 }, + { 0.28209479177387814, 0, 0, + 2.1991148575128552 }, + { 0.28209479177387814, 0, 0, + 2.3561944901923448 }, + { 0.28209479177387814, 0, 0, + 2.5132741228718345 }, + { 0.28209479177387814, 0, 0, + 2.6703537555513241 }, + { 0.28209479177387814, 0, 0, + 2.8274333882308138 }, + { 0.28209479177387814, 0, 0, + 2.9845130209103035 }, + { 0.28209479177387814, 0, 0, + 3.1415926535897931 }, +}; + +// Test function for l=0, m=0. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data001[i].l), Tp(data001[i].m), + Tp(data001[i].theta)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=1, m=0. +testcase_sph_legendre<double> data002[] = { + { 0.48860251190291992, 1, 0, + 0.0000000000000000 }, + { 0.48258700419201100, 1, 0, + 0.15707963267948966 }, + { 0.46468860282345231, 1, 0, + 0.31415926535897931 }, + { 0.43534802584032634, 1, 0, + 0.47123889803846897 }, + { 0.39528773562374975, 1, 0, + 0.62831853071795862 }, + { 0.34549414947133544, 1, 0, + 0.78539816339744828 }, + { 0.28719335072959390, 1, 0, + 0.94247779607693793 }, + { 0.22182089855280451, 1, 0, + 1.0995574287564276 }, + { 0.15098647967228984, 1, 0, + 1.2566370614359172 }, + { 0.076434272566846345, 1, 0, + 1.4137166941154069 }, + { 2.9918275112863369e-17, 1, 0, + 1.5707963267948966 }, + { -0.076434272566846179, 1, 0, + 1.7278759594743860 }, + { -0.15098647967228976, 1, 0, + 1.8849555921538759 }, + { -0.22182089855280446, 1, 0, + 2.0420352248333655 }, + { -0.28719335072959390, 1, 0, + 2.1991148575128552 }, + { -0.34549414947133544, 1, 0, + 2.3561944901923448 }, + { -0.39528773562374969, 1, 0, + 2.5132741228718345 }, + { -0.43534802584032628, 1, 0, + 2.6703537555513241 }, + { -0.46468860282345231, 1, 0, + 2.8274333882308138 }, + { -0.48258700419201095, 1, 0, + 2.9845130209103035 }, + { -0.48860251190291992, 1, 0, + 3.1415926535897931 }, +}; + +// Test function for l=1, m=0. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data002[i].l), Tp(data002[i].m), + Tp(data002[i].theta)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=1, m=1. +testcase_sph_legendre<double> data003[] = { + { 0.0000000000000000, 1, 1, + 0.0000000000000000 }, + { -0.054047192447077917, 1, 1, + 0.15707963267948966 }, + { -0.10676356364376104, 1, 1, + 0.31415926535897931 }, + { -0.15685106157558129, 1, 1, + 0.47123889803846897 }, + { -0.20307636581258243, 1, 1, + 0.62831853071795862 }, + { -0.24430125595146013, 1, 1, + 0.78539816339744828 }, + { -0.27951063837942880, 1, 1, + 0.94247779607693793 }, + { -0.30783754124787122, 1, 1, + 1.0995574287564276 }, + { -0.32858446219656551, 1, 1, + 1.2566370614359172 }, + { -0.34124054317667202, 1, 1, + 1.4137166941154069 }, + { -0.34549414947133567, 1, 1, + 1.5707963267948966 }, + { -0.34124054317667202, 1, 1, + 1.7278759594743860 }, + { -0.32858446219656556, 1, 1, + 1.8849555921538759 }, + { -0.30783754124787127, 1, 1, + 2.0420352248333655 }, + { -0.27951063837942880, 1, 1, + 2.1991148575128552 }, + { -0.24430125595146013, 1, 1, + 2.3561944901923448 }, + { -0.20307636581258248, 1, 1, + 2.5132741228718345 }, + { -0.15685106157558140, 1, 1, + 2.6703537555513241 }, + { -0.10676356364376104, 1, 1, + 2.8274333882308138 }, + { -0.054047192447078167, 1, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 1, 1, + 3.1415926535897931 }, +}; + +// Test function for l=1, m=1. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data003[i].l), Tp(data003[i].m), + Tp(data003[i].theta)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=2, m=0. +testcase_sph_legendre<double> data004[] = { + { 0.63078313050504009, 2, 0, + 0.0000000000000000 }, + { 0.60762858760316607, 2, 0, + 0.15707963267948966 }, + { 0.54043148688396569, 2, 0, + 0.31415926535897931 }, + { 0.43576954875556589, 2, 0, + 0.47123889803846897 }, + { 0.30388781294457579, 2, 0, + 0.62831853071795862 }, + { 0.15769578262625994, 2, 0, + 0.78539816339744828 }, + { 0.011503752307944235, 2, 0, + 0.94247779607693793 }, + { -0.12037798350304565, 2, 0, + 1.0995574287564276 }, + { -0.22503992163144573, 2, 0, + 1.2566370614359172 }, + { -0.29223702235064597, 2, 0, + 1.4137166941154069 }, + { -0.31539156525252005, 2, 0, + 1.5707963267948966 }, + { -0.29223702235064608, 2, 0, + 1.7278759594743860 }, + { -0.22503992163144584, 2, 0, + 1.8849555921538759 }, + { -0.12037798350304577, 2, 0, + 2.0420352248333655 }, + { 0.011503752307944235, 2, 0, + 2.1991148575128552 }, + { 0.15769578262625994, 2, 0, + 2.3561944901923448 }, + { 0.30388781294457567, 2, 0, + 2.5132741228718345 }, + { 0.43576954875556562, 2, 0, + 2.6703537555513241 }, + { 0.54043148688396569, 2, 0, + 2.8274333882308138 }, + { 0.60762858760316585, 2, 0, + 2.9845130209103035 }, + { 0.63078313050504009, 2, 0, + 3.1415926535897931 }, +}; + +// Test function for l=2, m=0. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data004[i].l), Tp(data004[i].m), + Tp(data004[i].theta)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=2, m=1. +testcase_sph_legendre<double> data005[] = { + { 0.0000000000000000, 2, 1, + 0.0000000000000000 }, + { -0.11936529291378727, 2, 1, + 0.15707963267948966 }, + { -0.22704627929027449, 2, 1, + 0.31415926535897931 }, + { -0.31250239392538215, 2, 1, + 0.47123889803846897 }, + { -0.36736859691086526, 2, 1, + 0.62831853071795862 }, + { -0.38627420202318979, 2, 1, + 0.78539816339744828 }, + { -0.36736859691086526, 2, 1, + 0.94247779607693793 }, + { -0.31250239392538226, 2, 1, + 1.0995574287564276 }, + { -0.22704627929027435, 2, 1, + 1.2566370614359172 }, + { -0.11936529291378740, 2, 1, + 1.4137166941154069 }, + { -4.7304946510089748e-17, 2, 1, + 1.5707963267948966 }, + { 0.11936529291378714, 2, 1, + 1.7278759594743860 }, + { 0.22704627929027429, 2, 1, + 1.8849555921538759 }, + { 0.31250239392538226, 2, 1, + 2.0420352248333655 }, + { 0.36736859691086526, 2, 1, + 2.1991148575128552 }, + { 0.38627420202318979, 2, 1, + 2.3561944901923448 }, + { 0.36736859691086526, 2, 1, + 2.5132741228718345 }, + { 0.31250239392538232, 2, 1, + 2.6703537555513241 }, + { 0.22704627929027449, 2, 1, + 2.8274333882308138 }, + { 0.11936529291378781, 2, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 2, 1, + 3.1415926535897931 }, +}; + +// Test function for l=2, m=1. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data005[i].l), Tp(data005[i].m), + Tp(data005[i].theta)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=2, m=2. +testcase_sph_legendre<double> data006[] = { + { 0.0000000000000000, 2, 2, + 0.0000000000000000 }, + { 0.0094528025561622549, 2, 2, + 0.15707963267948966 }, + { 0.036885904048903795, 2, 2, + 0.31415926535897931 }, + { 0.079613961366457681, 2, 2, + 0.47123889803846897 }, + { 0.13345445455470123, 2, 2, + 0.62831853071795862 }, + { 0.19313710101159492, 2, 2, + 0.78539816339744828 }, + { 0.25281974746848851, 2, 2, + 0.94247779607693793 }, + { 0.30666024065673203, 2, 2, + 1.0995574287564276 }, + { 0.34938829797428600, 2, 2, + 1.2566370614359172 }, + { 0.37682139946702747, 2, 2, + 1.4137166941154069 }, + { 0.38627420202318979, 2, 2, + 1.5707963267948966 }, + { 0.37682139946702753, 2, 2, + 1.7278759594743860 }, + { 0.34938829797428606, 2, 2, + 1.8849555921538759 }, + { 0.30666024065673209, 2, 2, + 2.0420352248333655 }, + { 0.25281974746848851, 2, 2, + 2.1991148575128552 }, + { 0.19313710101159492, 2, 2, + 2.3561944901923448 }, + { 0.13345445455470126, 2, 2, + 2.5132741228718345 }, + { 0.079613961366457764, 2, 2, + 2.6703537555513241 }, + { 0.036885904048903795, 2, 2, + 2.8274333882308138 }, + { 0.0094528025561623433, 2, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 2, 2, + 3.1415926535897931 }, +}; + +// Test function for l=2, m=2. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data006[i].l), Tp(data006[i].m), + Tp(data006[i].theta)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5, m=0. +testcase_sph_legendre<double> data007[] = { + { 0.93560257962738880, 5, 0, + 0.0000000000000000 }, + { 0.77014422942080019, 5, 0, + 0.15707963267948966 }, + { 0.35892185032365215, 5, 0, + 0.31415926535897931 }, + { -0.090214932090594183, 5, 0, + 0.47123889803846897 }, + { -0.36214460396518888, 5, 0, + 0.62831853071795862 }, + { -0.35145955579226890, 5, 0, + 0.78539816339744828 }, + { -0.11441703594725168, 5, 0, + 0.94247779607693793 }, + { 0.17248966720808098, 5, 0, + 1.0995574287564276 }, + { 0.32128384287200523, 5, 0, + 1.2566370614359172 }, + { 0.24377632246714948, 5, 0, + 1.4137166941154069 }, + { 1.0741712853887702e-16, 5, 0, + 1.5707963267948966 }, + { -0.24377632246714906, 5, 0, + 1.7278759594743860 }, + { -0.32128384287200534, 5, 0, + 1.8849555921538759 }, + { -0.17248966720808118, 5, 0, + 2.0420352248333655 }, + { 0.11441703594725168, 5, 0, + 2.1991148575128552 }, + { 0.35145955579226890, 5, 0, + 2.3561944901923448 }, + { 0.36214460396518910, 5, 0, + 2.5132741228718345 }, + { 0.090214932090594724, 5, 0, + 2.6703537555513241 }, + { -0.35892185032365215, 5, 0, + 2.8274333882308138 }, + { -0.77014422942079797, 5, 0, + 2.9845130209103035 }, + { -0.93560257962738880, 5, 0, + 3.1415926535897931 }, +}; + +// Test function for l=5, m=0. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data007[i].l), Tp(data007[i].m), + Tp(data007[i].theta)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5, m=1. +testcase_sph_legendre<double> data008[] = { + { 0.0000000000000000, 5, 1, + 0.0000000000000000 }, + { -0.36712373713318258, 5, 1, + 0.15707963267948966 }, + { -0.54610329010534753, 5, 1, + 0.31415926535897931 }, + { -0.45381991493631785, 5, 1, + 0.47123889803846897 }, + { -0.15679720635769953, 5, 1, + 0.62831853071795862 }, + { 0.16985499419838637, 5, 1, + 0.78539816339744828 }, + { 0.34468004499725180, 5, 1, + 0.94247779607693793 }, + { 0.28349471119605985, 5, 1, + 1.0995574287564276 }, + { 0.044286619339675856, 5, 1, + 1.2566370614359172 }, + { -0.21193784177193470, 5, 1, + 1.4137166941154069 }, + { -0.32028164857621527, 5, 1, + 1.5707963267948966 }, + { -0.21193784177193514, 5, 1, + 1.7278759594743860 }, + { 0.044286619339675606, 5, 1, + 1.8849555921538759 }, + { 0.28349471119605979, 5, 1, + 2.0420352248333655 }, + { 0.34468004499725180, 5, 1, + 2.1991148575128552 }, + { 0.16985499419838637, 5, 1, + 2.3561944901923448 }, + { -0.15679720635769920, 5, 1, + 2.5132741228718345 }, + { -0.45381991493631757, 5, 1, + 2.6703537555513241 }, + { -0.54610329010534753, 5, 1, + 2.8274333882308138 }, + { -0.36712373713318397, 5, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 5, 1, + 3.1415926535897931 }, +}; + +// Test function for l=5, m=1. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data008[i].l), Tp(data008[i].m), + Tp(data008[i].theta)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5, m=2. +testcase_sph_legendre<double> data009[] = { + { 0.0000000000000000, 5, 2, + 0.0000000000000000 }, + { 0.078919441745546146, 5, 2, + 0.15707963267948966 }, + { 0.26373799140437981, 5, 2, + 0.31415926535897931 }, + { 0.43002359842080096, 5, 2, + 0.47123889803846897 }, + { 0.45642486439050994, 5, 2, + 0.62831853071795862 }, + { 0.29959604906083276, 5, 2, + 0.78539816339744828 }, + { 0.023781239849532242, 5, 2, + 0.94247779607693793 }, + { -0.23313989334673815, 5, 2, + 1.0995574287564276 }, + { -0.33799912776303714, 5, 2, + 1.2566370614359172 }, + { -0.23964508489529743, 5, 2, + 1.4137166941154069 }, + { -1.0377480524338170e-16, 5, 2, + 1.5707963267948966 }, + { 0.23964508489529704, 5, 2, + 1.7278759594743860 }, + { 0.33799912776303714, 5, 2, + 1.8849555921538759 }, + { 0.23313989334673837, 5, 2, + 2.0420352248333655 }, + { -0.023781239849532242, 5, 2, + 2.1991148575128552 }, + { -0.29959604906083276, 5, 2, + 2.3561944901923448 }, + { -0.45642486439050978, 5, 2, + 2.5132741228718345 }, + { -0.43002359842080118, 5, 2, + 2.6703537555513241 }, + { -0.26373799140437981, 5, 2, + 2.8274333882308138 }, + { -0.078919441745546867, 5, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 5, 2, + 3.1415926535897931 }, +}; + +// Test function for l=5, m=2. +template <typename Tp> +void test009() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data009) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data009[i].l), Tp(data009[i].m), + Tp(data009[i].theta)); + const Tp f0 = data009[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=5, m=5. +testcase_sph_legendre<double> data010[] = { + { 0.0000000000000000, 5, 5, + 0.0000000000000000 }, + { -4.3481439097909148e-05, 5, 5, + 0.15707963267948966 }, + { -0.0013078367086431812, 5, 5, + 0.31415926535897931 }, + { -0.0089510818191922761, 5, 5, + 0.47123889803846897 }, + { -0.032563803777573896, 5, 5, + 0.62831853071795862 }, + { -0.082047757105021310, 5, 5, + 0.78539816339744828 }, + { -0.16085328164143819, 5, 5, + 0.94247779607693793 }, + { -0.26064303436645375, 5, 5, + 1.0995574287564276 }, + { -0.36113811790820566, 5, 5, + 1.2566370614359172 }, + { -0.43625592459446139, 5, 5, + 1.4137166941154069 }, + { -0.46413220344085809, 5, 5, + 1.5707963267948966 }, + { -0.43625592459446155, 5, 5, + 1.7278759594743860 }, + { -0.36113811790820577, 5, 5, + 1.8849555921538759 }, + { -0.26064303436645381, 5, 5, + 2.0420352248333655 }, + { -0.16085328164143819, 5, 5, + 2.1991148575128552 }, + { -0.082047757105021310, 5, 5, + 2.3561944901923448 }, + { -0.032563803777573924, 5, 5, + 2.5132741228718345 }, + { -0.0089510818191923004, 5, 5, + 2.6703537555513241 }, + { -0.0013078367086431812, 5, 5, + 2.8274333882308138 }, + { -4.3481439097910151e-05, 5, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 5, 5, + 3.1415926535897931 }, +}; + +// Test function for l=5, m=5. +template <typename Tp> +void test010() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data010) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data010[i].l), Tp(data010[i].m), + Tp(data010[i].theta)); + const Tp f0 = data010[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10, m=0. +testcase_sph_legendre<double> data011[] = { + { 1.2927207364566027, 10, 0, + 0.0000000000000000 }, + { 0.55288895150522632, 10, 0, + 0.15707963267948966 }, + { -0.44874428379711506, 10, 0, + 0.31415926535897931 }, + { -0.25532095827149692, 10, 0, + 0.47123889803846897 }, + { 0.36625249688013967, 10, 0, + 0.62831853071795862 }, + { 0.14880806329084145, 10, 0, + 0.78539816339744828 }, + { -0.33533356797848746, 10, 0, + 0.94247779607693793 }, + { -0.080639967662335818, 10, 0, + 1.0995574287564276 }, + { 0.32197986450174521, 10, 0, + 1.2566370614359172 }, + { 0.025713542103667848, 10, 0, + 1.4137166941154069 }, + { -0.31813049373736707, 10, 0, + 1.5707963267948966 }, + { 0.025713542103666668, 10, 0, + 1.7278759594743860 }, + { 0.32197986450174532, 10, 0, + 1.8849555921538759 }, + { -0.080639967662335416, 10, 0, + 2.0420352248333655 }, + { -0.33533356797848746, 10, 0, + 2.1991148575128552 }, + { 0.14880806329084145, 10, 0, + 2.3561944901923448 }, + { 0.36625249688013994, 10, 0, + 2.5132741228718345 }, + { -0.25532095827149576, 10, 0, + 2.6703537555513241 }, + { -0.44874428379711506, 10, 0, + 2.8274333882308138 }, + { 0.55288895150521977, 10, 0, + 2.9845130209103035 }, + { 1.2927207364566027, 10, 0, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=0. +template <typename Tp> +void test011() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data011) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data011[i].l), Tp(data011[i].m), + Tp(data011[i].theta)); + const Tp f0 = data011[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10, m=1. +testcase_sph_legendre<double> data012[] = { + { 0.0000000000000000, 10, 1, + 0.0000000000000000 }, + { -0.74373723919063905, 10, 1, + 0.15707963267948966 }, + { -0.29035110456209551, 10, 1, + 0.31415926535897931 }, + { 0.42219282075271497, 10, 1, + 0.47123889803846897 }, + { 0.17109256898931269, 10, 1, + 0.62831853071795862 }, + { -0.35583574648544292, 10, 1, + 0.78539816339744828 }, + { -0.10089212303543979, 10, 1, + 0.94247779607693793 }, + { 0.32997652649321085, 10, 1, + 1.0995574287564276 }, + { 0.047416376890033113, 10, 1, + 1.2566370614359172 }, + { -0.31999356750295654, 10, 1, + 1.4137166941154069 }, + { -2.0430664782290766e-16, 10, 1, + 1.5707963267948966 }, + { 0.31999356750295660, 10, 1, + 1.7278759594743860 }, + { -0.047416376890032523, 10, 1, + 1.8849555921538759 }, + { -0.32997652649321102, 10, 1, + 2.0420352248333655 }, + { 0.10089212303543979, 10, 1, + 2.1991148575128552 }, + { 0.35583574648544292, 10, 1, + 2.3561944901923448 }, + { -0.17109256898931186, 10, 1, + 2.5132741228718345 }, + { -0.42219282075271553, 10, 1, + 2.6703537555513241 }, + { 0.29035110456209551, 10, 1, + 2.8274333882308138 }, + { 0.74373723919064028, 10, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 10, 1, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=1. +template <typename Tp> +void test012() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data012) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data012[i].l), Tp(data012[i].m), + Tp(data012[i].theta)); + const Tp f0 = data012[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10, m=2. +testcase_sph_legendre<double> data013[] = { + { 0.0000000000000000, 10, 2, + 0.0000000000000000 }, + { 0.34571695599980284, 10, 2, + 0.15707963267948966 }, + { 0.62485535978198059, 10, 2, + 0.31415926535897931 }, + { 0.098210039644716363, 10, 2, + 0.47123889803846897 }, + { -0.41494799233049656, 10, 2, + 0.62831853071795862 }, + { -0.081698973831472149, 10, 2, + 0.78539816339744828 }, + { 0.35253132222271272, 10, 2, + 0.94247779607693793 }, + { 0.049026298555981063, 10, 2, + 1.0995574287564276 }, + { -0.32791246874130797, 10, 2, + 1.2566370614359172 }, + { -0.016196782433946910, 10, 2, + 1.4137166941154069 }, + { 0.32106263400438328, 10, 2, + 1.5707963267948966 }, + { -0.016196782433945765, 10, 2, + 1.7278759594743860 }, + { -0.32791246874130797, 10, 2, + 1.8849555921538759 }, + { 0.049026298555980702, 10, 2, + 2.0420352248333655 }, + { 0.35253132222271272, 10, 2, + 2.1991148575128552 }, + { -0.081698973831472149, 10, 2, + 2.3561944901923448 }, + { -0.41494799233049667, 10, 2, + 2.5132741228718345 }, + { 0.098210039644714753, 10, 2, + 2.6703537555513241 }, + { 0.62485535978198059, 10, 2, + 2.8274333882308138 }, + { 0.34571695599980551, 10, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 10, 2, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=2. +template <typename Tp> +void test013() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data013) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data013[i].l), Tp(data013[i].m), + Tp(data013[i].theta)); + const Tp f0 = data013[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=10, m=5. +testcase_sph_legendre<double> data014[] = { + { 0.0000000000000000, 10, 5, + 0.0000000000000000 }, + { -0.0030300124052750187, 10, 5, + 0.15707963267948966 }, + { -0.070348585248056830, 10, 5, + 0.31415926535897931 }, + { -0.30055029290703639, 10, 5, + 0.47123889803846897 }, + { -0.49987818144009166, 10, 5, + 0.62831853071795862 }, + { -0.28108771757150086, 10, 5, + 0.78539816339744828 }, + { 0.22068081187249308, 10, 5, + 0.94247779607693793 }, + { 0.33689502212592115, 10, 5, + 1.0995574287564276 }, + { -0.086095515520763985, 10, 5, + 1.2566370614359172 }, + { -0.33935827318511558, 10, 5, + 1.4137166941154069 }, + { -1.9213014340664578e-16, 10, 5, + 1.5707963267948966 }, + { 0.33935827318511552, 10, 5, + 1.7278759594743860 }, + { 0.086095515520764526, 10, 5, + 1.8849555921538759 }, + { -0.33689502212592098, 10, 5, + 2.0420352248333655 }, + { -0.22068081187249308, 10, 5, + 2.1991148575128552 }, + { 0.28108771757150086, 10, 5, + 2.3561944901923448 }, + { 0.49987818144009155, 10, 5, + 2.5132741228718345 }, + { 0.30055029290703678, 10, 5, + 2.6703537555513241 }, + { 0.070348585248056830, 10, 5, + 2.8274333882308138 }, + { 0.0030300124052750855, 10, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 10, 5, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=5. +template <typename Tp> +void test014() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data014) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data014[i].l), Tp(data014[i].m), + Tp(data014[i].theta)); + const Tp f0 = data014[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=10, m=10. +testcase_sph_legendre<double> data015[] = { + { 0.0000000000000000, 10, 10, + 0.0000000000000000 }, + { 4.7624282733343473e-09, 10, 10, + 0.15707963267948966 }, + { 4.3085156534549772e-06, 10, 10, + 0.31415926535897931 }, + { 0.00020182347649472368, 10, 10, + 0.47123889803846897 }, + { 0.0026711045506511684, 10, 10, + 0.62831853071795862 }, + { 0.016957196623256943, 10, 10, + 0.78539816339744828 }, + { 0.065174916004990341, 10, 10, + 0.94247779607693793 }, + { 0.17112476903017843, 10, 10, + 1.0995574287564276 }, + { 0.32852414199733548, 10, 10, + 1.2566370614359172 }, + { 0.47940582314838287, 10, 10, + 1.4137166941154069 }, + { 0.54263029194422152, 10, 10, + 1.5707963267948966 }, + { 0.47940582314838309, 10, 10, + 1.7278759594743860 }, + { 0.32852414199733571, 10, 10, + 1.8849555921538759 }, + { 0.17112476903017854, 10, 10, + 2.0420352248333655 }, + { 0.065174916004990341, 10, 10, + 2.1991148575128552 }, + { 0.016957196623256943, 10, 10, + 2.3561944901923448 }, + { 0.0026711045506511706, 10, 10, + 2.5132741228718345 }, + { 0.00020182347649472493, 10, 10, + 2.6703537555513241 }, + { 4.3085156534549772e-06, 10, 10, + 2.8274333882308138 }, + { 4.7624282733345673e-09, 10, 10, + 2.9845130209103035 }, + { 0.0000000000000000, 10, 10, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=10. +template <typename Tp> +void test015() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data015) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data015[i].l), Tp(data015[i].m), + Tp(data015[i].theta)); + const Tp f0 = data015[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20, m=0. +testcase_sph_legendre<double> data016[] = { + { 1.8062879984608917, 20, 0, + 0.0000000000000000 }, + { -0.58906549291415966, 20, 0, + 0.15707963267948966 }, + { 0.45624611402342408, 20, 0, + 0.31415926535897931 }, + { -0.39955402700466724, 20, 0, + 0.47123889803846897 }, + { 0.36818552901640750, 20, 0, + 0.62831853071795862 }, + { -0.34873131330857787, 20, 0, + 0.78539816339744828 }, + { 0.33600882829186501, 20, 0, + 0.94247779607693793 }, + { -0.32759286308122904, 20, 0, + 1.0995574287564276 }, + { 0.32222458068091320, 20, 0, + 1.2566370614359172 }, + { -0.31922731037135960, 20, 0, + 1.4137166941154069 }, + { 0.31826262039531755, 20, 0, + 1.5707963267948966 }, + { -0.31922731037135965, 20, 0, + 1.7278759594743860 }, + { 0.32222458068091336, 20, 0, + 1.8849555921538759 }, + { -0.32759286308122937, 20, 0, + 2.0420352248333655 }, + { 0.33600882829186501, 20, 0, + 2.1991148575128552 }, + { -0.34873131330857787, 20, 0, + 2.3561944901923448 }, + { 0.36818552901640839, 20, 0, + 2.5132741228718345 }, + { -0.39955402700466852, 20, 0, + 2.6703537555513241 }, + { 0.45624611402342408, 20, 0, + 2.8274333882308138 }, + { -0.58906549291416699, 20, 0, + 2.9845130209103035 }, + { 1.8062879984608917, 20, 0, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=0. +template <typename Tp> +void test016() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data016) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data016[i].l), Tp(data016[i].m), + Tp(data016[i].theta)); + const Tp f0 = data016[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20, m=1. +testcase_sph_legendre<double> data017[] = { + { 0.0000000000000000, 20, 1, + 0.0000000000000000 }, + { -0.45905213045060206, 20, 1, + 0.15707963267948966 }, + { 0.31166370423309170, 20, 1, + 0.31415926535897931 }, + { -0.23278757741246814, 20, 1, + 0.47123889803846897 }, + { 0.17937240823504183, 20, 1, + 0.62831853071795862 }, + { -0.13857299972299736, 20, 1, + 0.78539816339744828 }, + { 0.10495324841927710, 20, 1, + 0.94247779607693793 }, + { -0.075707774352164178, 20, 1, + 1.0995574287564276 }, + { 0.049168697683476620, 20, 1, + 1.2566370614359172 }, + { -0.024216050551253254, 20, 1, + 1.4137166941154069 }, + { 3.9938443510694349e-16, 20, 1, + 1.5707963267948966 }, + { 0.024216050551250898, 20, 1, + 1.7278759594743860 }, + { -0.049168697683475482, 20, 1, + 1.8849555921538759 }, + { 0.075707774352163332, 20, 1, + 2.0420352248333655 }, + { -0.10495324841927710, 20, 1, + 2.1991148575128552 }, + { 0.13857299972299736, 20, 1, + 2.3561944901923448 }, + { -0.17937240823504039, 20, 1, + 2.5132741228718345 }, + { 0.23278757741246658, 20, 1, + 2.6703537555513241 }, + { -0.31166370423309170, 20, 1, + 2.8274333882308138 }, + { 0.45905213045059318, 20, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 1, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=1. +template <typename Tp> +void test017() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data017) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data017[i].l), Tp(data017[i].m), + Tp(data017[i].theta)); + const Tp f0 = data017[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=20, m=2. +testcase_sph_legendre<double> data018[] = { + { 0.0000000000000000, 20, 2, + 0.0000000000000000 }, + { 0.87399805141574682, 20, 2, + 0.15707963267948966 }, + { -0.55116854080894984, 20, 2, + 0.31415926535897931 }, + { 0.44520137308557534, 20, 2, + 0.47123889803846897 }, + { -0.39321637877908228, 20, 2, + 0.62831853071795862 }, + { 0.36312025711350970, 20, 2, + 0.78539816339744828 }, + { -0.34427103004873094, 20, 2, + 0.94247779607693793 }, + { 0.33214917638387625, 20, 2, + 1.0995574287564276 }, + { -0.32455734448839091, 20, 2, + 1.2566370614359172 }, + { 0.32036529628513238, 20, 2, + 1.4137166941154069 }, + { -0.31902310563819986, 20, 2, + 1.5707963267948966 }, + { 0.32036529628513266, 20, 2, + 1.7278759594743860 }, + { -0.32455734448839102, 20, 2, + 1.8849555921538759 }, + { 0.33214917638387670, 20, 2, + 2.0420352248333655 }, + { -0.34427103004873094, 20, 2, + 2.1991148575128552 }, + { 0.36312025711350970, 20, 2, + 2.3561944901923448 }, + { -0.39321637877908278, 20, 2, + 2.5132741228718345 }, + { 0.44520137308557639, 20, 2, + 2.6703537555513241 }, + { -0.55116854080894984, 20, 2, + 2.8274333882308138 }, + { 0.87399805141574360, 20, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 2, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=2. +template <typename Tp> +void test018() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data018) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data018[i].l), Tp(data018[i].m), + Tp(data018[i].theta)); + const Tp f0 = data018[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=20, m=5. +testcase_sph_legendre<double> data019[] = { + { 0.0000000000000000, 20, 5, + 0.0000000000000000 }, + { -0.10024848623504846, 20, 5, + 0.15707963267948966 }, + { -0.68115361075940595, 20, 5, + 0.31415926535897931 }, + { 0.31774532551156237, 20, 5, + 0.47123889803846897 }, + { -0.16011868165390564, 20, 5, + 0.62831853071795862 }, + { 0.085844143304116230, 20, 5, + 0.78539816339744828 }, + { -0.047467540840864686, 20, 5, + 0.94247779607693793 }, + { 0.026283575189471282, 20, 5, + 1.0995574287564276 }, + { -0.013891104052597331, 20, 5, + 1.2566370614359172 }, + { 0.0059873308239496931, 20, 5, + 1.4137166941154069 }, + { 3.9355286582083095e-16, 20, 5, + 1.5707963267948966 }, + { -0.0059873308239519040, 20, 5, + 1.7278759594743860 }, + { 0.013891104052598531, 20, 5, + 1.8849555921538759 }, + { -0.026283575189472212, 20, 5, + 2.0420352248333655 }, + { 0.047467540840864686, 20, 5, + 2.1991148575128552 }, + { -0.085844143304116230, 20, 5, + 2.3561944901923448 }, + { 0.16011868165390636, 20, 5, + 2.5132741228718345 }, + { -0.31774532551156448, 20, 5, + 2.6703537555513241 }, + { 0.68115361075940595, 20, 5, + 2.8274333882308138 }, + { 0.10024848623505037, 20, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 5, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=5. +template <typename Tp> +void test019() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data019) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data019[i].l), Tp(data019[i].m), + Tp(data019[i].theta)); + const Tp f0 = data019[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for l=20, m=10. +testcase_sph_legendre<double> data020[] = { + { 0.0000000000000000, 20, 10, + 0.0000000000000000 }, + { 3.0595797603706485e-05, 20, 10, + 0.15707963267948966 }, + { 0.015924453916397008, 20, 10, + 0.31415926535897931 }, + { 0.26588079118745700, 20, 10, + 0.47123889803846897 }, + { 0.54045081420686825, 20, 10, + 0.62831853071795862 }, + { -0.28215279394285597, 20, 10, + 0.78539816339744828 }, + { 0.0085297337582246665, 20, 10, + 0.94247779607693793 }, + { 0.16930127953533775, 20, 10, + 1.0995574287564276 }, + { -0.27215134048018352, 20, 10, + 1.2566370614359172 }, + { 0.32456597088029526, 20, 10, + 1.4137166941154069 }, + { -0.34057893241353715, 20, 10, + 1.5707963267948966 }, + { 0.32456597088029449, 20, 10, + 1.7278759594743860 }, + { -0.27215134048018308, 20, 10, + 1.8849555921538759 }, + { 0.16930127953533725, 20, 10, + 2.0420352248333655 }, + { 0.0085297337582246665, 20, 10, + 2.1991148575128552 }, + { -0.28215279394285597, 20, 10, + 2.3561944901923448 }, + { 0.54045081420686658, 20, 10, + 2.5132741228718345 }, + { 0.26588079118745822, 20, 10, + 2.6703537555513241 }, + { 0.015924453916397008, 20, 10, + 2.8274333882308138 }, + { 3.0595797603707854e-05, 20, 10, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 10, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=10. +template <typename Tp> +void test020() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data020) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data020[i].l), Tp(data020[i].m), + Tp(data020[i].theta)); + const Tp f0 = data020[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=20, m=20. +testcase_sph_legendre<double> data021[] = { + { 0.0000000000000000, 20, 20, + 0.0000000000000000 }, + { 4.9264471419245886e-17, 20, 20, + 0.15707963267948966 }, + { 4.0321091681531780e-11, 20, 20, + 0.31415926535897931 }, + { 8.8474944184471664e-08, 20, 20, + 0.47123889803846897 }, + { 1.5497395129387764e-05, 20, 20, + 0.62831853071795862 }, + { 0.00062457564282984723, 20, 20, + 0.78539816339744828 }, + { 0.0092265192458967603, 20, 20, + 0.94247779607693793 }, + { 0.063606673236323269, 20, 20, + 1.0995574287564276 }, + { 0.23442909509776308, 20, 20, + 1.2566370614359172 }, + { 0.49921030481087009, 20, 20, + 1.4137166941154069 }, + { 0.63956545825776223, 20, 20, + 1.5707963267948966 }, + { 0.49921030481087064, 20, 20, + 1.7278759594743860 }, + { 0.23442909509776344, 20, 20, + 1.8849555921538759 }, + { 0.063606673236323352, 20, 20, + 2.0420352248333655 }, + { 0.0092265192458967603, 20, 20, + 2.1991148575128552 }, + { 0.00062457564282984723, 20, 20, + 2.3561944901923448 }, + { 1.5497395129387818e-05, 20, 20, + 2.5132741228718345 }, + { 8.8474944184472617e-08, 20, 20, + 2.6703537555513241 }, + { 4.0321091681531780e-11, 20, 20, + 2.8274333882308138 }, + { 4.9264471419250786e-17, 20, 20, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 20, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=20. +template <typename Tp> +void test021() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data021) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data021[i].l), Tp(data021[i].m), + Tp(data021[i].theta)); + const Tp f0 = data021[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=50, m=0. +testcase_sph_legendre<double> data022[] = { + { 2.8350175706934717, 50, 0, + 0.0000000000000000 }, + { 0.53157537495174845, 50, 0, + 0.15707963267948966 }, + { -0.46056183476301349, 50, 0, + 0.31415926535897931 }, + { -0.24876032079677909, 50, 0, + 0.47123889803846897 }, + { 0.36926172901532522, 50, 0, + 0.62831853071795862 }, + { 0.14571730283563306, 50, 0, + 0.78539816339744828 }, + { -0.33636199170850811, 50, 0, + 0.94247779607693793 }, + { -0.079132716267092035, 50, 0, + 1.0995574287564276 }, + { 0.32232921941301440, 50, 0, + 1.2566370614359172 }, + { 0.025253991969481446, 50, 0, + 1.4137166941154069 }, + { -0.31830208724152359, 50, 0, + 1.5707963267948966 }, + { 0.025253991969476128, 50, 0, + 1.7278759594743860 }, + { 0.32232921941301479, 50, 0, + 1.8849555921538759 }, + { -0.079132716267090078, 50, 0, + 2.0420352248333655 }, + { -0.33636199170850811, 50, 0, + 2.1991148575128552 }, + { 0.14571730283563306, 50, 0, + 2.3561944901923448 }, + { 0.36926172901532717, 50, 0, + 2.5132741228718345 }, + { -0.24876032079677393, 50, 0, + 2.6703537555513241 }, + { -0.46056183476301349, 50, 0, + 2.8274333882308138 }, + { 0.53157537495172380, 50, 0, + 2.9845130209103035 }, + { 2.8350175706934717, 50, 0, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=0. +template <typename Tp> +void test022() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data022) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data022[i].l), Tp(data022[i].m), + Tp(data022[i].theta)); + const Tp f0 = data022[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=50, m=1. +testcase_sph_legendre<double> data023[] = { + { 0.0000000000000000, 50, 1, + 0.0000000000000000 }, + { -0.63751752155226116, 50, 1, + 0.15707963267948966 }, + { -0.32616619317604312, 50, 1, + 0.31415926535897931 }, + { 0.40649930826162706, 50, 1, + 0.47123889803846897 }, + { 0.18473991408344026, 50, 1, + 0.62831853071795862 }, + { -0.35083930302013211, 50, 1, + 0.78539816339744828 }, + { -0.10755382110947098, 50, 1, + 0.94247779607693793 }, + { 0.32822568316499862, 50, 1, + 1.0995574287564276 }, + { 0.050286056609798180, 50, 1, + 1.2566370614359172 }, + { -0.31935368562159638, 50, 1, + 1.4137166941154069 }, + { -9.8421602686195941e-16, 50, 1, + 1.5707963267948966 }, + { 0.31935368562159705, 50, 1, + 1.7278759594743860 }, + { -0.050286056609795383, 50, 1, + 1.8849555921538759 }, + { -0.32822568316499923, 50, 1, + 2.0420352248333655 }, + { 0.10755382110947098, 50, 1, + 2.1991148575128552 }, + { 0.35083930302013211, 50, 1, + 2.3561944901923448 }, + { -0.18473991408343632, 50, 1, + 2.5132741228718345 }, + { -0.40649930826163039, 50, 1, + 2.6703537555513241 }, + { 0.32616619317604312, 50, 1, + 2.8274333882308138 }, + { 0.63751752155227837, 50, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 1, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=1. +template <typename Tp> +void test023() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data023) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data023[i].l), Tp(data023[i].m), + Tp(data023[i].theta)); + const Tp f0 = data023[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=50, m=2. +testcase_sph_legendre<double> data024[] = { + { 0.0000000000000000, 50, 2, + 0.0000000000000000 }, + { -0.37230261163839168, 50, 2, + 0.15707963267948966 }, + { 0.50051599680315972, 50, 2, + 0.31415926535897931 }, + { 0.21724795180329545, 50, 2, + 0.47123889803846897 }, + { -0.37948127307610940, 50, 2, + 0.62831853071795862 }, + { -0.13187372121003119, 50, 2, + 0.78539816339744828 }, + { 0.33959009162400194, 50, 2, + 0.94247779607693793 }, + { 0.072537503112490409, 50, 2, + 1.0995574287564276 }, + { -0.32310306941855271, 50, 2, + 1.2566370614359172 }, + { -0.023259822816436588, 50, 2, + 1.4137166941154069 }, + { 0.31842698506357275, 50, 2, + 1.5707963267948966 }, + { -0.023259822816431144, 50, 2, + 1.7278759594743860 }, + { -0.32310306941855299, 50, 2, + 1.8849555921538759 }, + { 0.072537503112488369, 50, 2, + 2.0420352248333655 }, + { 0.33959009162400194, 50, 2, + 2.1991148575128552 }, + { -0.13187372121003119, 50, 2, + 2.3561944901923448 }, + { -0.37948127307611074, 50, 2, + 2.5132741228718345 }, + { 0.21724795180328935, 50, 2, + 2.6703537555513241 }, + { 0.50051599680315972, 50, 2, + 2.8274333882308138 }, + { -0.37230261163836298, 50, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 2, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=2. +template <typename Tp> +void test024() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data024) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data024[i].l), Tp(data024[i].m), + Tp(data024[i].theta)); + const Tp f0 = data024[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for l=50, m=5. +testcase_sph_legendre<double> data025[] = { + { 0.0000000000000000, 50, 5, + 0.0000000000000000 }, + { -0.57750385903193069, 50, 5, + 0.15707963267948966 }, + { 0.077360497065584566, 50, 5, + 0.31415926535897931 }, + { 0.47707267400540210, 50, 5, + 0.47123889803846897 }, + { 0.055370615126630537, 50, 5, + 0.62831853071795862 }, + { -0.37629451847202855, 50, 5, + 0.78539816339744828 }, + { -0.048042277801960624, 50, 5, + 0.94247779607693793 }, + { 0.33619379362228685, 50, 5, + 1.0995574287564276 }, + { 0.025265227185719726, 50, 5, + 1.2566370614359172 }, + { -0.32083679430964518, 50, 5, + 1.4137166941154069 }, + { -9.8189201019751884e-16, 50, 5, + 1.5707963267948966 }, + { 0.32083679430964590, 50, 5, + 1.7278759594743860 }, + { -0.025265227185716856, 50, 5, + 1.8849555921538759 }, + { -0.33619379362228730, 50, 5, + 2.0420352248333655 }, + { 0.048042277801960624, 50, 5, + 2.1991148575128552 }, + { 0.37629451847202855, 50, 5, + 2.3561944901923448 }, + { -0.055370615126626936, 50, 5, + 2.5132741228718345 }, + { -0.47707267400540210, 50, 5, + 2.6703537555513241 }, + { -0.077360497065584566, 50, 5, + 2.8274333882308138 }, + { 0.57750385903191004, 50, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 5, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=5. +template <typename Tp> +void test025() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data025) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data025[i].l), Tp(data025[i].m), + Tp(data025[i].theta)); + const Tp f0 = data025[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for l=50, m=10. +testcase_sph_legendre<double> data026[] = { + { 0.0000000000000000, 50, 10, + 0.0000000000000000 }, + { 0.15606941844800759, 50, 10, + 0.15707963267948966 }, + { -0.53748868836814601, 50, 10, + 0.31415926535897931 }, + { -0.49304919025183896, 50, 10, + 0.47123889803846897 }, + { -0.26267582750428264, 50, 10, + 0.62831853071795862 }, + { 0.22058983666314402, 50, 10, + 0.78539816339744828 }, + { 0.32936725160671759, 50, 10, + 0.94247779607693793 }, + { -0.092053311559446988, 50, 10, + 1.0995574287564276 }, + { -0.32542913495935555, 50, 10, + 1.2566370614359172 }, + { 0.025673223789103500, 50, 10, + 1.4137166941154069 }, + { 0.32150019350255743, 50, 10, + 1.5707963267948966 }, + { 0.025673223789108864, 50, 10, + 1.7278759594743860 }, + { -0.32542913495935494, 50, 10, + 1.8849555921538759 }, + { -0.092053311559448570, 50, 10, + 2.0420352248333655 }, + { 0.32936725160671759, 50, 10, + 2.1991148575128552 }, + { 0.22058983666314402, 50, 10, + 2.3561944901923448 }, + { -0.26267582750427909, 50, 10, + 2.5132741228718345 }, + { -0.49304919025184119, 50, 10, + 2.6703537555513241 }, + { -0.53748868836814601, 50, 10, + 2.8274333882308138 }, + { 0.15606941844801259, 50, 10, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 10, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=10. +template <typename Tp> +void test026() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data026) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data026[i].l), Tp(data026[i].m), + Tp(data026[i].theta)); + const Tp f0 = data026[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=50, m=20. +testcase_sph_legendre<double> data027[] = { + { 0.0000000000000000, 50, 20, + 0.0000000000000000 }, + { 3.0409598712833082e-07, 50, 20, + 0.15707963267948966 }, + { 0.030940518122882305, 50, 20, + 0.31415926535897931 }, + { 0.64134588721659935, 50, 20, + 0.47123889803846897 }, + { 0.29895244392136394, 50, 20, + 0.62831853071795862 }, + { 0.25309324781874065, 50, 20, + 0.78539816339744828 }, + { 0.34368634714931712, 50, 20, + 0.94247779607693793 }, + { 0.33996764360663956, 50, 20, + 1.0995574287564276 }, + { 0.12866267745104118, 50, 20, + 1.2566370614359172 }, + { -0.18201114398922874, 50, 20, + 1.4137166941154069 }, + { -0.33216683431510857, 50, 20, + 1.5707963267948966 }, + { -0.18201114398923304, 50, 20, + 1.7278759594743860 }, + { 0.12866267745103846, 50, 20, + 1.8849555921538759 }, + { 0.33996764360663906, 50, 20, + 2.0420352248333655 }, + { 0.34368634714931712, 50, 20, + 2.1991148575128552 }, + { 0.25309324781874065, 50, 20, + 2.3561944901923448 }, + { 0.29895244392136738, 50, 20, + 2.5132741228718345 }, + { 0.64134588721659791, 50, 20, + 2.6703537555513241 }, + { 0.030940518122882305, 50, 20, + 2.8274333882308138 }, + { 3.0409598712835877e-07, 50, 20, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 20, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=20. +template <typename Tp> +void test027() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data027) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data027[i].l), Tp(data027[i].m), + Tp(data027[i].theta)); + const Tp f0 = data027[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=50, m=50. +testcase_sph_legendre<double> data028[] = { + { 0.0000000000000000, 50, 50, + 0.0000000000000000 }, + { 4.1649039898151844e-41, 50, 50, + 0.15707963267948966 }, + { 2.5240684647724192e-26, 50, 50, + 0.31415926535897931 }, + { 5.6927376423967334e-18, 50, 50, + 0.47123889803846897 }, + { 2.3116239814797057e-12, 50, 50, + 0.62831853071795862 }, + { 2.3835981241325311e-08, 50, 50, + 0.78539816339744828 }, + { 1.9992410287270356e-05, 50, 50, + 0.94247779607693793 }, + { 0.0024947505670829791, 50, 50, + 1.0995574287564276 }, + { 0.065057774647971175, 50, 50, + 1.2566370614359172 }, + { 0.43050607056732243, 50, 50, + 1.4137166941154069 }, + { 0.79980281171531975, 50, 50, + 1.5707963267948966 }, + { 0.43050607056732360, 50, 50, + 1.7278759594743860 }, + { 0.065057774647971384, 50, 50, + 1.8849555921538759 }, + { 0.0024947505670829856, 50, 50, + 2.0420352248333655 }, + { 1.9992410287270356e-05, 50, 50, + 2.1991148575128552 }, + { 2.3835981241325311e-08, 50, 50, + 2.3561944901923448 }, + { 2.3116239814797222e-12, 50, 50, + 2.5132741228718345 }, + { 5.6927376423968544e-18, 50, 50, + 2.6703537555513241 }, + { 2.5240684647724192e-26, 50, 50, + 2.8274333882308138 }, + { 4.1649039898161316e-41, 50, 50, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 50, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=50. +template <typename Tp> +void test028() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data028) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data028[i].l), Tp(data028[i].m), + Tp(data028[i].theta)); + const Tp f0 = data028[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=100, m=0. +testcase_sph_legendre<double> data029[] = { + { 3.9993839251484076, 100, 0, + 0.0000000000000000 }, + { -0.60770160285935471, 100, 0, + 0.15707963267948966 }, + { 0.46193027883956100, 100, 0, + 0.31415926535897931 }, + { -0.40218718869815234, 100, 0, + 0.47123889803846897 }, + { 0.36960201406910737, 100, 0, + 0.62831853071795862 }, + { -0.34953726547378611, 100, 0, + 0.78539816339744828 }, + { 0.33646959352497846, 100, 0, + 0.94247779607693793 }, + { -0.32784733067663169, 100, 0, + 1.0995574287564276 }, + { 0.32235624474047936, 100, 0, + 1.2566370614359172 }, + { -0.31929330706601283, 100, 0, + 1.4137166941154069 }, + { 0.31830791662110325, 100, 0, + 1.5707963267948966 }, + { -0.31929330706601389, 100, 0, + 1.7278759594743860 }, + { 0.32235624474048052, 100, 0, + 1.8849555921538759 }, + { -0.32784733067663291, 100, 0, + 2.0420352248333655 }, + { 0.33646959352497846, 100, 0, + 2.1991148575128552 }, + { -0.34953726547378611, 100, 0, + 2.3561944901923448 }, + { 0.36960201406911114, 100, 0, + 2.5132741228718345 }, + { -0.40218718869815695, 100, 0, + 2.6703537555513241 }, + { 0.46193027883956100, 100, 0, + 2.8274333882308138 }, + { -0.60770160285939478, 100, 0, + 2.9845130209103035 }, + { 3.9993839251484076, 100, 0, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=0. +template <typename Tp> +void test029() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data029) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data029[i].l), Tp(data029[i].m), + Tp(data029[i].theta)); + const Tp f0 = data029[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for l=100, m=1. +testcase_sph_legendre<double> data030[] = { + { 0.0000000000000000, 100, 1, + 0.0000000000000000 }, + { -0.50851949013719622, 100, 1, + 0.15707963267948966 }, + { 0.33129641402221310, 100, 1, + 0.31415926535897931 }, + { -0.24390405750942562, 100, 1, + 0.47123889803846897 }, + { 0.18659755088414165, 100, 1, + 0.62831853071795862 }, + { -0.14355908970516640, 100, 1, + 0.78539816339744828 }, + { 0.10844906813251093, 100, 1, + 0.94247779607693793 }, + { -0.078100088690859812, 100, 1, + 1.0995574287564276 }, + { 0.050670002998304528, 100, 1, + 1.2566370614359172 }, + { -0.024941251747138762, 100, 1, + 1.4137166941154069 }, + { 1.9587949830851639e-15, 100, 1, + 1.5707963267948966 }, + { 0.024941251747127649, 100, 1, + 1.7278759594743860 }, + { -0.050670002998298595, 100, 1, + 1.8849555921538759 }, + { 0.078100088690855676, 100, 1, + 2.0420352248333655 }, + { -0.10844906813251093, 100, 1, + 2.1991148575128552 }, + { 0.14355908970516640, 100, 1, + 2.3561944901923448 }, + { -0.18659755088413349, 100, 1, + 2.5132741228718345 }, + { 0.24390405750941485, 100, 1, + 2.6703537555513241 }, + { -0.33129641402221310, 100, 1, + 2.8274333882308138 }, + { 0.50851949013714548, 100, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 1, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=1. +template <typename Tp> +void test030() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data030) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data030[i].l), Tp(data030[i].m), + Tp(data030[i].theta)); + const Tp f0 = data030[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for l=100, m=2. +testcase_sph_legendre<double> data031[] = { + { 0.0000000000000000, 100, 2, + 0.0000000000000000 }, + { 0.67166274297194040, 100, 2, + 0.15707963267948966 }, + { -0.48226933687995144, 100, 2, + 0.31415926535897931 }, + { 0.41175421895715447, 100, 2, + 0.47123889803846897 }, + { -0.37475021787822460, 100, 2, + 0.62831853071795862 }, + { 0.35242909383605475, 100, 2, + 0.78539816339744828 }, + { -0.33807110409160002, 100, 2, + 0.94247779607693793 }, + { 0.32867180390709999, 100, 2, + 1.0995574287564276 }, + { -0.32271583790278469, 100, 2, + 1.2566370614359172 }, + { 0.31940354677687433, 100, 2, + 1.4137166941154069 }, + { -0.31833943693772526, 100, 2, + 1.5707963267948966 }, + { 0.31940354677687521, 100, 2, + 1.7278759594743860 }, + { -0.32271583790278524, 100, 2, + 1.8849555921538759 }, + { 0.32867180390710143, 100, 2, + 2.0420352248333655 }, + { -0.33807110409160002, 100, 2, + 2.1991148575128552 }, + { 0.35242909383605475, 100, 2, + 2.3561944901923448 }, + { -0.37475021787822771, 100, 2, + 2.5132741228718345 }, + { 0.41175421895716069, 100, 2, + 2.6703537555513241 }, + { -0.48226933687995144, 100, 2, + 2.8274333882308138 }, + { 0.67166274297196804, 100, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 2, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=2. +template <typename Tp> +void test031() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data031) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data031[i].l), Tp(data031[i].m), + Tp(data031[i].theta)); + const Tp f0 = data031[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000020e-13)); +} + +// Test data for l=100, m=5. +testcase_sph_legendre<double> data032[] = { + { 0.0000000000000000, 100, 5, + 0.0000000000000000 }, + { 0.062564361105907143, 100, 5, + 0.15707963267948966 }, + { 0.14179554455880186, 100, 5, + 0.31415926535897931 }, + { -0.14356866942906019, 100, 5, + 0.47123889803846897 }, + { 0.12355483388448507, 100, 5, + 0.62831853071795862 }, + { -0.10090029999681098, 100, 5, + 0.78539816339744828 }, + { 0.078905134460230564, 100, 5, + 0.94247779607693793 }, + { -0.058040182398187236, 100, 5, + 1.0995574287564276 }, + { 0.038142759389484152, 100, 5, + 1.2566370614359172 }, + { -0.018906264170660277, 100, 5, + 1.4137166941154069 }, + { 1.9576303042914544e-15, 100, 5, + 1.5707963267948966 }, + { 0.018906264170649747, 100, 5, + 1.7278759594743860 }, + { -0.038142759389478524, 100, 5, + 1.8849555921538759 }, + { 0.058040182398182996, 100, 5, + 2.0420352248333655 }, + { -0.078905134460230564, 100, 5, + 2.1991148575128552 }, + { 0.10090029999681098, 100, 5, + 2.3561944901923448 }, + { -0.12355483388447780, 100, 5, + 2.5132741228718345 }, + { 0.14356866942904903, 100, 5, + 2.6703537555513241 }, + { -0.14179554455880186, 100, 5, + 2.8274333882308138 }, + { -0.062564361105959004, 100, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 5, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=5. +template <typename Tp> +void test032() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data032) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data032[i].l), Tp(data032[i].m), + Tp(data032[i].theta)); + const Tp f0 = data032[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000029e-12)); +} + +// Test data for l=100, m=10. +testcase_sph_legendre<double> data033[] = { + { 0.0000000000000000, 100, 10, + 0.0000000000000000 }, + { -0.75366545187995670, 100, 10, + 0.15707963267948966 }, + { -0.35914570017277186, 100, 10, + 0.31415926535897931 }, + { 0.43480692911578245, 100, 10, + 0.47123889803846897 }, + { -0.40862111080315705, 100, 10, + 0.62831853071795862 }, + { 0.37832688692909400, 100, 10, + 0.78539816339744828 }, + { -0.35484056194773472, 100, 10, + 0.94247779607693793 }, + { 0.33821981171196336, 100, 10, + 1.0995574287564276 }, + { -0.32729120767830605, 100, 10, + 1.2566370614359172 }, + { 0.32110336937091455, 100, 10, + 1.4137166941154069 }, + { -0.31910064020036194, 100, 10, + 1.5707963267948966 }, + { 0.32110336937091488, 100, 10, + 1.7278759594743860 }, + { -0.32729120767830577, 100, 10, + 1.8849555921538759 }, + { 0.33821981171196341, 100, 10, + 2.0420352248333655 }, + { -0.35484056194773472, 100, 10, + 2.1991148575128552 }, + { 0.37832688692909400, 100, 10, + 2.3561944901923448 }, + { -0.40862111080315433, 100, 10, + 2.5132741228718345 }, + { 0.43480692911577806, 100, 10, + 2.6703537555513241 }, + { -0.35914570017277186, 100, 10, + 2.8274333882308138 }, + { -0.75366545187998180, 100, 10, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 10, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=10. +template <typename Tp> +void test033() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data033) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data033[i].l), Tp(data033[i].m), + Tp(data033[i].theta)); + const Tp f0 = data033[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000008e-12)); +} + +// Test data for l=100, m=20. +testcase_sph_legendre<double> data034[] = { + { 0.0000000000000000, 100, 20, + 0.0000000000000000 }, + { 0.053569660841553138, 100, 20, + 0.15707963267948966 }, + { 0.57154926874732426, 100, 20, + 0.31415926535897931 }, + { 0.47536909969585828, 100, 20, + 0.47123889803846897 }, + { -0.28882554564109014, 100, 20, + 0.62831853071795862 }, + { 0.020116179014049645, 100, 20, + 0.78539816339744828 }, + { 0.14752195931706580, 100, 20, + 0.94247779607693793 }, + { -0.24069428588868527, 100, 20, + 1.0995574287564276 }, + { 0.29031796025014395, 100, 20, + 1.2566370614359172 }, + { -0.31437256851143475, 100, 20, + 1.4137166941154069 }, + { 0.32153954851141792, 100, 20, + 1.5707963267948966 }, + { -0.31437256851143192, 100, 20, + 1.7278759594743860 }, + { 0.29031796025014112, 100, 20, + 1.8849555921538759 }, + { -0.24069428588868211, 100, 20, + 2.0420352248333655 }, + { 0.14752195931706580, 100, 20, + 2.1991148575128552 }, + { 0.020116179014049645, 100, 20, + 2.3561944901923448 }, + { -0.28882554564109658, 100, 20, + 2.5132741228718345 }, + { 0.47536909969585378, 100, 20, + 2.6703537555513241 }, + { 0.57154926874732426, 100, 20, + 2.8274333882308138 }, + { 0.053569660841557065, 100, 20, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 20, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=20. +template <typename Tp> +void test034() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data034) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data034[i].l), Tp(data034[i].m), + Tp(data034[i].theta)); + const Tp f0 = data034[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +// Test data for l=100, m=50. +testcase_sph_legendre<double> data035[] = { + { 0.0000000000000000, 100, 50, + 0.0000000000000000 }, + { 3.3047910392590630e-21, 100, 50, + 0.15707963267948966 }, + { 1.0592655372554983e-07, 100, 50, + 0.31415926535897931 }, + { 0.080418744223952635, 100, 50, + 0.47123889803846897 }, + { -0.56450600580393062, 100, 50, + 0.62831853071795862 }, + { 0.33338739844741766, 100, 50, + 0.78539816339744828 }, + { 0.39741714816514678, 100, 50, + 0.94247779607693793 }, + { 0.35223993750972293, 100, 50, + 1.0995574287564276 }, + { 0.17885891940721749, 100, 50, + 1.2566370614359172 }, + { -0.15341660126461953, 100, 50, + 1.4137166941154069 }, + { -0.34175924303503102, 100, 50, + 1.5707963267948966 }, + { -0.15341660126462864, 100, 50, + 1.7278759594743860 }, + { 0.17885891940721332, 100, 50, + 1.8849555921538759 }, + { 0.35223993750972149, 100, 50, + 2.0420352248333655 }, + { 0.39741714816514678, 100, 50, + 2.1991148575128552 }, + { 0.33338739844741766, 100, 50, + 2.3561944901923448 }, + { -0.56450600580392785, 100, 50, + 2.5132741228718345 }, + { 0.080418744223953439, 100, 50, + 2.6703537555513241 }, + { 1.0592655372554983e-07, 100, 50, + 2.8274333882308138 }, + { 3.3047910392597871e-21, 100, 50, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 50, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=50. +template <typename Tp> +void test035() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data035) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data035[i].l), Tp(data035[i].m), + Tp(data035[i].theta)); + const Tp f0 = data035[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +// Test data for l=100, m=100. +testcase_sph_legendre<double> data036[] = { + { 0.0000000000000000, 100, 100, + 0.0000000000000000 }, + { 2.5744136608862186e-81, 100, 100, + 0.15707963267948966 }, + { 9.4551974868956498e-52, 100, 100, + 0.31415926535897931 }, + { 4.8096190703396912e-35, 100, 100, + 0.47123889803846897 }, + { 7.9305393636343450e-24, 100, 100, + 0.62831853071795862 }, + { 8.4320740610946652e-16, 100, 100, + 0.78539816339744828 }, + { 5.9319660146027522e-10, 100, 100, + 0.94247779607693793 }, + { 9.2368225946796921e-06, 100, 100, + 1.0995574287564276 }, + { 0.0062815489742043982, 100, 100, + 1.2566370614359172 }, + { 0.27505966018176986, 100, 100, + 1.4137166941154069 }, + { 0.94936713998764621, 100, 100, + 1.5707963267948966 }, + { 0.27505966018177136, 100, 100, + 1.7278759594743860 }, + { 0.0062815489742044433, 100, 100, + 1.8849555921538759 }, + { 9.2368225946797582e-06, 100, 100, + 2.0420352248333655 }, + { 5.9319660146027522e-10, 100, 100, + 2.1991148575128552 }, + { 8.4320740610946652e-16, 100, 100, + 2.3561944901923448 }, + { 7.9305393636344581e-24, 100, 100, + 2.5132741228718345 }, + { 4.8096190703399648e-35, 100, 100, + 2.6703537555513241 }, + { 9.4551974868956498e-52, 100, 100, + 2.8274333882308138 }, + { 2.5744136608873895e-81, 100, 100, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 100, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=100. +template <typename Tp> +void test036() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data036) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data036[i].l), Tp(data036[i].m), + Tp(data036[i].theta)); + const Tp f0 = data036[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000039e-13)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile.cc new file mode 100644 index 000000000..5fd64536e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.22 sph_legendre + +#include <tr1/cmath> + +void +test01() +{ + float thetaf = 0.5F; + double thetad = 0.5; + long double thetal = 0.5L; + unsigned int l = 2, m = 1; + + std::tr1::sph_legendre(l, m, thetaf); + std::tr1::sph_legendref(l, m, thetaf); + std::tr1::sph_legendre(l, m, thetad); + std::tr1::sph_legendre(l, m, thetal); + std::tr1::sph_legendrel(l, m, thetal); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile_2.cc new file mode 100644 index 000000000..ea67af577 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.22 sph_legendre + +#include <tr1/math.h> + +void +test01() +{ + float thetaf = 0.5F; + double thetad = 0.5; + long double thetal = 0.5L; + unsigned int l = 2, m = 1; + + sph_legendre(l, m, thetaf); + sph_legendref(l, m, thetaf); + sph_legendre(l, m, thetad); + sph_legendre(l, m, thetal); + sph_legendrel(l, m, thetal); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_nan.cc new file mode 100644 index 000000000..ad0c4661d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_nan.cc @@ -0,0 +1,58 @@ +// { dg-require-c-std "" } +// { dg-add-options ieee } + +// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.23 sph_neumann + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + float xf = std::numeric_limits<float>::quiet_NaN(); + double xd = std::numeric_limits<double>::quiet_NaN(); + long double xl = std::numeric_limits<long double>::quiet_NaN(); + + unsigned int n = 0; + + float a = std::tr1::sph_neumann(n, xf); + float b = std::tr1::sph_neumannf(n, xf); + double c = std::tr1::sph_neumann(n, xd); + long double d = std::tr1::sph_neumann(n, xl); + long double e = std::tr1::sph_neumannl(n, xl); + + VERIFY(std::tr1::isnan<float>(a)); + VERIFY(std::tr1::isnan<float>(b)); + VERIFY(std::tr1::isnan<double>(c)); + VERIFY(std::tr1::isnan<long double>(d)); + VERIFY(std::tr1::isnan<long double>(e)); + + return; +} + +int +main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_value.cc new file mode 100644 index 000000000..b68894da0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_value.cc @@ -0,0 +1,461 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// sph_neumann + + +// Compare against values generated by the GNU Scientific Library. +// The GSL can be found on the web: http://www.gnu.org/software/gsl/ + +#include <tr1/cmath> +#if defined(__TEST_DEBUG) +#include <iostream> +#define VERIFY(A) \ +if (!(A)) \ + { \ + std::cout << "line " << __LINE__ \ + << " max_abs_frac = " << max_abs_frac \ + << std::endl; \ + } +#else +#include <testsuite_hooks.h> +#endif +#include "../testcase.h" + + +// Test data for n=0. +testcase_sph_neumann<double> data001[] = { + { -0.056732437092645263, 0, 5.0000000000000000 }, + { 0.083907152907645249, 0, 10.000000000000000 }, + { 0.050645860857254754, 0, 15.000000000000000 }, + { -0.020404103090669597, 0, 20.000000000000000 }, + { -0.039648112474538942, 0, 25.000000000000000 }, + { -0.0051417149962528020, 0, 30.000000000000000 }, + { 0.025819777288328762, 0, 35.000000000000000 }, + { 0.016673451541306544, 0, 40.000000000000000 }, + { -0.011673821973727327, 0, 45.000000000000000 }, + { -0.019299320569842265, 0, 50.000000000000000 }, + { -0.00040230465930828606, 0, 55.000000000000000 }, + { 0.015873549673585938, 0, 60.000000000000000 }, + { 0.0086531361728949541, 0, 65.000000000000000 }, + { -0.0090474171869471404, 0, 70.000000000000000 }, + { -0.012290016929663325, 0, 75.000000000000000 }, + { 0.0013798405479880946, 0, 80.000000000000000 }, + { 0.011580901686988727, 0, 85.000000000000000 }, + { 0.0049785957347685574, 0, 90.000000000000000 }, + { -0.0076860374841559963, 0, 95.000000000000000 }, + { -0.0086231887228768386, 0, 100.00000000000000 }, +}; + +// Test function for n=0. +template <typename Tp> +void test001() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data001) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data001[i].n), Tp(data001[i].x)); + const Tp f0 = data001[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for n=1. +testcase_sph_neumann<double> data002[] = { + { 0.18043836751409864, 1, 5.0000000000000000 }, + { 0.062792826379701516, 1, 10.000000000000000 }, + { -0.039976131953324147, 1, 15.000000000000000 }, + { -0.046667467690914864, 1, 20.000000000000000 }, + { 0.0037081455049293634, 1, 25.000000000000000 }, + { 0.032762996969886965, 1, 30.000000000000000 }, + { 0.012971498479556564, 1, 35.000000000000000 }, + { -0.018210992723451058, 1, 40.000000000000000 }, + { -0.019168385477952129, 1, 45.000000000000000 }, + { 0.0048615106626817301, 1, 50.000000000000000 }, + { 0.018170052158169303, 1, 55.000000000000000 }, + { 0.0053447361795967109, 1, 60.000000000000000 }, + { -0.012587316051033977, 1, 65.000000000000000 }, + { -0.011184829982069090, 1, 70.000000000000000 }, + { 0.0050065549130635621, 1, 75.000000000000000 }, + { 0.012440856180892041, 1, 80.000000000000000 }, + { 0.0022077237839479508, 1, 85.000000000000000 }, + { -0.0098779785318421041, 1, 90.000000000000000 }, + { -0.0072731342338976518, 1, 95.000000000000000 }, + { 0.0049774245238688201, 1, 100.00000000000000 }, +}; + +// Test function for n=1. +template <typename Tp> +void test002() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data002) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data002[i].n), Tp(data002[i].x)); + const Tp f0 = data002[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for n=2. +testcase_sph_neumann<double> data003[] = { + { 0.16499545760110443, 2, 5.0000000000000000 }, + { -0.065069304993734797, 2, 10.000000000000000 }, + { -0.058641087247919589, 2, 15.000000000000000 }, + { 0.013403982937032370, 2, 20.000000000000000 }, + { 0.040093089935130465, 2, 25.000000000000000 }, + { 0.0084180146932414986, 2, 30.000000000000000 }, + { -0.024707934561509628, 2, 35.000000000000000 }, + { -0.018039275995565374, 2, 40.000000000000000 }, + { 0.010395929608530519, 2, 45.000000000000000 }, + { 0.019591011209603170, 2, 50.000000000000000 }, + { 0.0013933984133902479, 2, 55.000000000000000 }, + { -0.015606312864606103, 2, 60.000000000000000 }, + { -0.0092340892214042153, 2, 65.000000000000000 }, + { 0.0085680673305727519, 2, 70.000000000000000 }, + { 0.012490279126185866, 2, 75.000000000000000 }, + { -0.00091330844120464307, 2, 80.000000000000000 }, + { -0.011502982024025860, 2, 85.000000000000000 }, + { -0.0053078616858299602, 2, 90.000000000000000 }, + { 0.0074563595609802805, 2, 95.000000000000000 }, + { 0.0087725114585929034, 2, 100.00000000000000 }, +}; + +// Test function for n=2. +template <typename Tp> +void test003() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data003) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data003[i].n), Tp(data003[i].x)); + const Tp f0 = data003[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for n=5. +testcase_sph_neumann<double> data004[] = { + { -0.32046504674973919, 5, 5.0000000000000000 }, + { 0.093833541678691818, 5, 10.000000000000000 }, + { 0.020475698281859061, 5, 15.000000000000000 }, + { -0.048172347757372780, 5, 20.000000000000000 }, + { -0.018309489232548347, 5, 25.000000000000000 }, + { 0.026639390496569996, 5, 30.000000000000000 }, + { 0.022006038985576210, 5, 35.000000000000000 }, + { -0.011268975348057965, 5, 40.000000000000000 }, + { -0.021770388372274862, 5, 45.000000000000000 }, + { -0.00069711319645853712, 5, 50.000000000000000 }, + { 0.017439589450220897, 5, 55.000000000000000 }, + { 0.0088699170919343089, 5, 60.000000000000000 }, + { -0.010421334444951861, 5, 65.000000000000000 }, + { -0.012746769858008551, 5, 70.000000000000000 }, + { 0.0026282888028967737, 5, 75.000000000000000 }, + { 0.012477658581324189, 5, 80.000000000000000 }, + { 0.0040771816818182642, 5, 85.000000000000000 }, + { -0.0089777759570579801, 5, 90.000000000000000 }, + { -0.0083184557896676149, 5, 95.000000000000000 }, + { 0.0037206784862748965, 5, 100.00000000000000 }, +}; + +// Test function for n=5. +template <typename Tp> +void test004() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data004) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data004[i].n), Tp(data004[i].x)); + const Tp f0 = data004[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for n=10. +testcase_sph_neumann<double> data005[] = { + { -26.656114405718704, 10, 5.0000000000000000 }, + { -0.17245367208805784, 10, 10.000000000000000 }, + { 0.078461689849642580, 10, 15.000000000000000 }, + { -0.036843410496289961, 10, 20.000000000000000 }, + { -0.021158339301097472, 10, 25.000000000000000 }, + { 0.031219591064754935, 10, 30.000000000000000 }, + { 0.012840593422414804, 10, 35.000000000000000 }, + { -0.021803068636888072, 10, 40.000000000000000 }, + { -0.014071636804469047, 10, 45.000000000000000 }, + { 0.013524687511158756, 10, 50.000000000000000 }, + { 0.015684932653180592, 10, 55.000000000000000 }, + { -0.0056356895567262122, 10, 60.000000000000000 }, + { -0.015364490270315362, 10, 65.000000000000000 }, + { -0.0014525575672261291, 10, 70.000000000000000 }, + { 0.012648951699549433, 10, 75.000000000000000 }, + { 0.0068571608061120358, 10, 80.000000000000000 }, + { -0.0080151152941401460, 10, 85.000000000000000 }, + { -0.0098139742219019131, 10, 90.000000000000000 }, + { 0.0025002854072314951, 10, 95.000000000000000 }, + { 0.010025777373636153, 10, 100.00000000000000 }, +}; + +// Test function for n=10. +template <typename Tp> +void test005() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data005) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data005[i].n), Tp(data005[i].x)); + const Tp f0 = data005[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(5.0000000000000028e-11)); +} + +// Test data for n=20. +testcase_sph_neumann<double> data006[] = { + { -926795140.30575454, 20, 5.0000000000000000 }, + { -1211.2106053526034, 20, 10.000000000000000 }, + { -1.5559965765652188, 20, 15.000000000000000 }, + { -0.093401132250914426, 20, 20.000000000000000 }, + { 0.044031985675276435, 20, 25.000000000000000 }, + { -0.036078033606613907, 20, 30.000000000000000 }, + { 0.029828405631319641, 20, 35.000000000000000 }, + { -0.0048414810986760785, 20, 40.000000000000000 }, + { -0.020504694681516944, 20, 45.000000000000000 }, + { 0.013759531302541211, 20, 50.000000000000000 }, + { 0.012783038861734196, 20, 55.000000000000000 }, + { -0.013117009421906418, 20, 60.000000000000000 }, + { -0.010338106075674407, 20, 65.000000000000000 }, + { 0.010538610814111246, 20, 70.000000000000000 }, + { 0.010200029094273743, 20, 75.000000000000000 }, + { -0.0073123450945617122, 20, 80.000000000000000 }, + { -0.010581510354950906, 20, 85.000000000000000 }, + { 0.0036866374015298714, 20, 90.000000000000000 }, + { 0.010498384318338270, 20, 95.000000000000000 }, + { 5.6317293788333982e-05, 20, 100.00000000000000 }, +}; + +// Test function for n=20. +template <typename Tp> +void test006() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data006) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data006[i].n), Tp(data006[i].x)); + const Tp f0 = data006[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(1.0000000000000007e-09)); +} + +// Test data for n=50. +testcase_sph_neumann<double> data007[] = { + { -6.9641091882698388e+42, 50, 5.0000000000000000 }, + { -4.5282272723512023e+27, 50, 10.000000000000000 }, + { -9.0004902645887027e+18, 50, 15.000000000000000 }, + { -9542541667002.5098, 50, 20.000000000000000 }, + { -363518140.71026677, 50, 25.000000000000000 }, + { -152551.57233157745, 50, 30.000000000000000 }, + { -386.26599186208625, 50, 35.000000000000000 }, + { -4.3290507947291035, 50, 40.000000000000000 }, + { -0.19968460851503764, 50, 45.000000000000000 }, + { -0.041900001504607758, 50, 50.000000000000000 }, + { 0.010696040672421900, 50, 55.000000000000000 }, + { 0.0078198768555268507, 50, 60.000000000000000 }, + { -0.010088474938191242, 50, 65.000000000000000 }, + { 0.0062423671279824801, 50, 70.000000000000000 }, + { 0.0011284242794941733, 50, 75.000000000000000 }, + { -0.0093934266037485562, 50, 80.000000000000000 }, + { 0.013108079602843424, 50, 85.000000000000000 }, + { -0.0075396607225722626, 50, 90.000000000000000 }, + { -0.0042605703552836558, 50, 95.000000000000000 }, + { 0.010747822973682470, 50, 100.00000000000000 }, +}; + +// Test function for n=50. +template <typename Tp> +void test007() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data007) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data007[i].n), Tp(data007[i].x)); + const Tp f0 = data007[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000014e-11)); +} + +// Test data for n=100. +testcase_sph_neumann<double> data008[] = { + { -1.7997139826259744e+116, 100, 5.0000000000000000 }, + { -8.5732263093296254e+85, 100, 10.000000000000000 }, + { -1.9270658593711675e+68, 100, 15.000000000000000 }, + { -7.2208893582952363e+55, 100, 20.000000000000000 }, + { -2.0868752613007946e+46, 100, 25.000000000000000 }, + { -4.2496124023612646e+38, 100, 30.000000000000000 }, + { -1.7042898348910271e+32, 100, 35.000000000000000 }, + { -6.3021565260724554e+26, 100, 40.000000000000000 }, + { -1.3199917400494369e+22, 100, 45.000000000000000 }, + { -1.1256928913265985e+18, 100, 50.000000000000000 }, + { -309801083340341.00, 100, 55.000000000000000 }, + { -232585620046.64737, 100, 60.000000000000000 }, + { -421135935.93756086, 100, 65.000000000000000 }, + { -1680637.4531202619, 100, 70.000000000000000 }, + { -13868.302591128842, 100, 75.000000000000000 }, + { -227.24385709173322, 100, 80.000000000000000 }, + { -7.2807038787139486, 100, 85.000000000000000 }, + { -0.46648154448250878, 100, 90.000000000000000 }, + { -0.067270772720654542, 100, 95.000000000000000 }, + { -0.022983850491562267, 100, 100.00000000000000 }, +}; + +// Test function for n=100. +template <typename Tp> +void test008() +{ + const Tp eps = std::numeric_limits<Tp>::epsilon(); + Tp max_abs_diff = -Tp(1); + Tp max_abs_frac = -Tp(1); + unsigned int num_datum = sizeof(data008) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data008[i].n), Tp(data008[i].x)); + const Tp f0 = data008[i].f0; + const Tp diff = f - f0; + if (std::abs(diff) > max_abs_diff) + max_abs_diff = std::abs(diff); + if (std::abs(f0) > Tp(10) * eps + && std::abs(f) > Tp(10) * eps) + { + const Tp frac = diff / f0; + if (std::abs(frac) > max_abs_frac) + max_abs_frac = std::abs(frac); + } + } + VERIFY(max_abs_frac < Tp(2.5000000000000015e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile.cc new file mode 100644 index 000000000..aeed5e1de --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.23 sph_neumann + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 0; + + std::tr1::sph_neumann(n, xf); + std::tr1::sph_neumannf(n, xf); + std::tr1::sph_neumann(n, xd); + std::tr1::sph_neumann(n, xl); + std::tr1::sph_neumannl(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile_2.cc new file mode 100644 index 000000000..ec17f72e2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile_2.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 5.2.1.23 sph_neumann + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 0; + + sph_neumann(n, xf); + sph_neumannf(n, xf); + sph_neumann(n, xd); + sph_neumann(n, xl); + sph_neumannl(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/testcase.h b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/testcase.h new file mode 100644 index 000000000..0d56fd655 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/testcase.h @@ -0,0 +1,258 @@ +// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// testcase.h + +// +// These are little PODs for special function inputs and +// expexted results for the testsuite. +// + +// 5.2.1.1 Associated Laguerre polynomials. +template <typename _Tp> +struct testcase_assoc_laguerre +{ + _Tp f0; + unsigned int n; + unsigned int m; + _Tp x; + _Tp f; +}; + +// 5.2.1.2 Associated Legendre functions. +template <typename _Tp> +struct testcase_assoc_legendre +{ + _Tp f0; + unsigned int l; + unsigned int m; + _Tp x; + _Tp f; +}; + +// 5.2.1.3 Beta function. +template <typename _Tp> +struct testcase_beta +{ + _Tp f0; + _Tp x; + _Tp y; + _Tp f; +}; + +// 5.2.1.4 Complete elliptic integrals of the first kind. +template <typename _Tp> +struct testcase_comp_ellint_1 +{ + _Tp f0; + _Tp k; + _Tp f; +}; + +// 5.2.1.5 Complete elliptic integrals of the second kind. +template <typename _Tp> +struct testcase_comp_ellint_2 +{ + _Tp f0; + _Tp k; + _Tp f; +}; + +// 5.2.1.6 Complete elliptic integrals of the third kind. +template <typename _Tp> +struct testcase_comp_ellint_3 +{ + _Tp f0; + _Tp k; + _Tp nu; + _Tp f; +}; + +// 5.2.1.7 Confluent hypergeometric functions. +template <typename _Tp> +struct testcase_conf_hyperg +{ + _Tp f0; + _Tp a; + _Tp c; + _Tp x; + _Tp f; +}; + +// 5.2.1.8 Regular modified cylindrical Bessel functions. +template <typename _Tp> +struct testcase_cyl_bessel_i +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// 5.2.1.9 Cylindrical Bessel functions (of the first kind). +template <typename _Tp> +struct testcase_cyl_bessel_j +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// 5.2.1.10 Irregular modified cylindrical Bessel functions. +template <typename _Tp> +struct testcase_cyl_bessel_k +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// 5.2.1.11 Cylindrical Neumann functions. +template <typename _Tp> +struct testcase_cyl_neumann +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// 5.2.1.12 Elliptic integrals of the first kind. +template <typename _Tp> +struct testcase_ellint_1 +{ + _Tp f0; + _Tp k; + _Tp phi; + _Tp f; +}; + +// 5.2.1.13 Elliptic integrals of the second kind. +template <typename _Tp> +struct testcase_ellint_2 +{ + _Tp f0; + _Tp k; + _Tp phi; + _Tp f; +}; + +// 5.2.1.14 Elliptic integrals of the third kind. +template <typename _Tp> +struct testcase_ellint_3 +{ + _Tp f0; + _Tp k; + _Tp nu; + _Tp phi; + _Tp f; +}; + +// 5.2.1.15 Exponential integral. +template <typename _Tp> +struct testcase_expint +{ + _Tp f0; + _Tp x; + _Tp f; +}; + +// 5.2.1.16 Hermite polynomials +template <typename _Tp> +struct testcase_hermite +{ + _Tp f0; + unsigned int n; + _Tp x; + _Tp f; +}; + +// 5.2.1.17 Hypergeometric functions. +template <typename _Tp> +struct testcase_hyperg +{ + _Tp f0; + _Tp a; + _Tp b; + _Tp c; + _Tp x; + _Tp f; +}; + +// 5.2.1.18 Laguerre polynomials. +template <typename _Tp> +struct testcase_laguerre +{ + _Tp f0; + unsigned int n; + _Tp x; + _Tp f; +}; + +// 5.2.1.19 Legendre polynomials. +template <typename _Tp> +struct testcase_legendre +{ + _Tp f0; + unsigned int l; + _Tp x; + _Tp f; +}; + +// 5.2.1.20 Riemann zeta function. +template <typename _Tp> +struct testcase_riemann_zeta +{ + _Tp f0; + _Tp x; + _Tp f; +}; + +// 5.2.1.21 Spherical Bessel functions. +template <typename _Tp> +struct testcase_sph_bessel +{ + _Tp f0; + unsigned int n; + _Tp x; + _Tp f; +}; + +// 5.2.1.22 Spherical Legendre functions. +template <typename _Tp> +struct testcase_sph_legendre +{ + _Tp f0; + unsigned int l; + unsigned int m; + _Tp theta; + _Tp f; +}; + +// 5.2.1.23 Spherical Neumann functions. +template <typename _Tp> +struct testcase_sph_neumann +{ + _Tp f0; + unsigned int n; + _Tp x; + _Tp f; +}; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/empty.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/empty.cc new file mode 100644 index 000000000..24a561916 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/empty.cc @@ -0,0 +1,53 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + { + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + + VERIFY( a.empty() == false ); + } + + { + const size_t len = 0; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a; + + VERIFY( a.empty() == true ); + } +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/max_size.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/max_size.cc new file mode 100644 index 000000000..d5321192c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/max_size.cc @@ -0,0 +1,52 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + { + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + + VERIFY( a.max_size() == len ); + } + + { + const size_t len = 0; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a; + + VERIFY( a.max_size() == len ); + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/size.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/size.cc new file mode 100644 index 000000000..3c7d29278 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/size.cc @@ -0,0 +1,53 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + { + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + + VERIFY( a.size() == len ); + } + + { + const size_t len = 0; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a; + + VERIFY( a.size() == len ); + } +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/equal.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/equal.cc new file mode 100644 index 000000000..7e9ac4acd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/equal.cc @@ -0,0 +1,45 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3 } }; + + VERIFY( a == b ); + VERIFY( !(a == c) ); +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/greater.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/greater.cc new file mode 100644 index 000000000..bbe02d6ad --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/greater.cc @@ -0,0 +1,45 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3, 7 } }; + + VERIFY( !(a > b) ); + VERIFY( c > a ); +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/greater_or_equal.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/greater_or_equal.cc new file mode 100644 index 000000000..0f5fb250a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/greater_or_equal.cc @@ -0,0 +1,45 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3, 7 } }; + + VERIFY( a >= b ); + VERIFY( c >= a ); +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/less.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/less.cc new file mode 100644 index 000000000..8db6ec6ad --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/less.cc @@ -0,0 +1,45 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3, 7 } }; + + VERIFY( !(a < b) ); + VERIFY( a < c ); +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/less_or_equal.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/less_or_equal.cc new file mode 100644 index 000000000..8ff18b300 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/less_or_equal.cc @@ -0,0 +1,45 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3, 7 } }; + + VERIFY( a <= b ); + VERIFY( a <= c ); +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc new file mode 100644 index 000000000..957c05ebc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc @@ -0,0 +1,45 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3, 4 } }; + array_type c = { { 0, 1, 2, 3 } }; + + VERIFY( !(a != b) ); + VERIFY( a != c ); +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc new file mode 100644 index 000000000..78085f940 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> + +void +test01() +{ + typedef std::tr1::array<int, 5> array_type; + + array_type a = { { 0, 1, 2, 3, 4 } }; + array_type b = { { 0, 1, 2, 3 } }; + + a = b; +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc new file mode 100644 index 000000000..4a53a6d99 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc @@ -0,0 +1,56 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <stdexcept> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + + try + { + a.at(len); + VERIFY( false ); + } + catch(std::out_of_range& obj) + { + // Expected. + VERIFY( true ); + } + catch(...) + { + // Failed. + VERIFY( false ); + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/back.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/back.cc new file mode 100644 index 000000000..3c0ea2490 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/back.cc @@ -0,0 +1,50 @@ +// 2005-08-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + + { + array_type a = { { 0, 1, 2, 3, 4 } }; + int& ri = a.back(); + VERIFY( ri == 4 ); + } + + { + const array_type ca = { { 4, 3, 2, 1, 0 } }; + const int& cri = ca.back(); + VERIFY( cri == 0 ); + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/data.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/data.cc new file mode 100644 index 000000000..80f27e7fc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/data.cc @@ -0,0 +1,50 @@ +// 2005-08-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + + { + array_type a = { { 0, 1, 2, 3, 4 } }; + int* pi = a.data(); + VERIFY( *pi == 0 ); + } + + { + const array_type ca = { { 4, 3, 2, 1, 0 } }; + const int* pci = ca.data(); + VERIFY( *pci == 4 ); + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/front.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/front.cc new file mode 100644 index 000000000..e7eb139ed --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/front.cc @@ -0,0 +1,50 @@ +// 2005-08-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + + { + array_type a = { { 0, 1, 2, 3, 4 } }; + int& ri = a.front(); + VERIFY( ri == 0 ); + } + + { + const array_type ca = { { 4, 3, 2, 1, 0 } }; + const int& cri = ca.front(); + VERIFY( cri == 4 ); + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc new file mode 100644 index 000000000..92ff761db --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc @@ -0,0 +1,46 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <stdexcept> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + + array_type::iterator b = a.begin(); + array_type::iterator e = a.end(); + + VERIFY( e != (b + a.size() - 1)); +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/assign.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/assign.cc new file mode 100644 index 000000000..5925cc796 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/assign.cc @@ -0,0 +1,46 @@ +// 2006-02-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 3; + typedef std::tr1::array<int, len> array_type; + + array_type a = { { 0, 1, 2 } }; + const int value = 5; + + a.assign(value); + VERIFY( a[0] == value ); + VERIFY( a[1] == value ); + VERIFY( a[2] == value ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/contiguous.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/contiguous.cc new file mode 100644 index 000000000..e22b96cbe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/contiguous.cc @@ -0,0 +1,46 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + array_type a = { { 0, 1, 2, 3, 4 } }; + + // &a[n] == &a[0] + n for all 0 <= n < N. + for (size_t i = 0; i < len; ++i) + { + VERIFY( &a[i] == &a[0] + i ); + } +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..0074de7cb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/explicit_instantiation.cc @@ -0,0 +1,27 @@ +// { dg-do compile } + +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// 6.2.2 Class template array + +#include <tr1/array> + +template class std::tr1::array<int, 5>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/member_swap.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/member_swap.cc new file mode 100644 index 000000000..ea663bf71 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/member_swap.cc @@ -0,0 +1,48 @@ +// 2006-02-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + + array_type a = { { 0, 1, 2, 3, 4 } }; + const array_type a_ref = a; + + array_type b = { { 4, 3, 2, 1, 0 } }; + const array_type b_ref = b; + + a.swap(b); + VERIFY( a == b_ref ); + VERIFY( b == a_ref ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/typedefs.cc new file mode 100644 index 000000000..9f616ee75 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/typedefs.cc @@ -0,0 +1,40 @@ +// { dg-do compile } + +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// 6.2.2 Class template array + +#include <tr1/array> + +void test01() +{ + // Check for required typedefs + typedef std::tr1::array<int, 5> test_type; + typedef test_type::reference reference; + typedef test_type::const_reference const_reference; + typedef test_type::iterator iterator; + typedef test_type::const_iterator const_iterator; + typedef test_type::size_type size_type; + typedef test_type::difference_type difference_type; + typedef test_type::value_type value_type; + typedef test_type::reverse_iterator reverse_iterator; + typedef test_type::const_reverse_iterator const_reverse_iterator; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/zero_sized_arrays.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/zero_sized_arrays.cc new file mode 100644 index 000000000..1ea4f8aee --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/zero_sized_arrays.cc @@ -0,0 +1,61 @@ +// 2004-10-20 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2.4 Zero sized arrays + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + const size_t len = 0; + typedef std::tr1::array<int, len> array_type; + bool test __attribute__((unused)) = true; + + // 1: ? + array_type a = { }; + + // 2 + array_type b; + + // 3 + // begin() == end() + VERIFY( a.begin() == a.end() ); + VERIFY( b.begin() == b.end() ); + + // 4: ? + // begin() == end() == unique value. + { + typedef std::tr1::array<long, len> array_type1; + typedef std::tr1::array<char, len> array_type2; + array_type1 one; + array_type2 two; + void* v1 = one.begin(); + void* v2 = two.begin(); + VERIFY( v1 != v2 ); + } +} + +int main() +{ + test01(); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/specialized_algorithms/swap.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/specialized_algorithms/swap.cc new file mode 100644 index 000000000..1f0ae9d7f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/specialized_algorithms/swap.cc @@ -0,0 +1,48 @@ +// 2006-02-24 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2.2 array specialized algorithms + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const size_t len = 5; + typedef std::tr1::array<int, len> array_type; + + array_type a = { { 0, 1, 2, 3, 4 } }; + const array_type a_ref = a; + + array_type b = { { 4, 3, 2, 1, 0 } }; + const array_type b_ref = b; + + std::tr1::swap(a, b); + VERIFY( a == b_ref ); + VERIFY( b == a_ref ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/get.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/get.cc new file mode 100644 index 000000000..de0531da2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/get.cc @@ -0,0 +1,51 @@ +// 2005-08-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + const size_t len = 5; + typedef array<int, len> array_type; + + { + array_type a = { { 0, 1, 2, 3, 4 } }; + int& ri = get<0>(a); + VERIFY( ri == 0 ); + } + + { + const array_type a = { { 4, 3, 2, 1, 0 } }; + const int& cri = get<1>(a); + VERIFY( cri == 3 ); + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/tuple_element.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/tuple_element.cc new file mode 100644 index 000000000..09de57dc5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/tuple_element.cc @@ -0,0 +1,51 @@ +// 2005-08-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <tr1/type_traits> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + { + const size_t len = 3; + typedef array<int, len> array_type; + VERIFY( (is_same<tuple_element<0, array_type>::type, int>::value == true) ); + VERIFY( (is_same<tuple_element<1, array_type>::type, int>::value == true) ); + VERIFY( (is_same<tuple_element<2, array_type>::type, int>::value == true) ); + } + + { + const size_t len = 0; + typedef array<int, len> array_type; + VERIFY( (is_same<tuple_element<0, array_type>::type, int>::value == true) ); + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/tuple_size.cc b/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/tuple_size.cc new file mode 100644 index 000000000..99fcc7de0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/array/tuple_interface/tuple_size.cc @@ -0,0 +1,48 @@ +// 2005-08-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.2.2 Class template array + +#include <tr1/array> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + { + const size_t len = 5; + typedef array<int, len> array_type; + VERIFY( tuple_size<array_type>::value == 5 ); + } + + { + const size_t len = 0; + typedef array<float, len> array_type; + VERIFY( tuple_size<array_type>::value == 0 ); + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/hash/24799.cc b/libstdc++-v3/testsuite/tr1/6_containers/hash/24799.cc new file mode 100644 index 000000000..374651001 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/hash/24799.cc @@ -0,0 +1,73 @@ +// 2005-11-11 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.3 Class template hash + +#include <tr1/functional> +#include <string> +#include <tr1/type_traits> +#include <testsuite_tr1.h> +#include <testsuite_hooks.h> + +template<typename T> + void + do_test() + { + bool test __attribute__((unused)) = true; + + using std::tr1::is_same; + using __gnu_test::test_relationship; + + typedef typename std::tr1::hash<T>::argument_type argument_type; + typedef typename std::tr1::hash<T>::result_type result_type; + + VERIFY( (test_relationship<is_same, argument_type, T>(true)) ); + VERIFY( (test_relationship<is_same, result_type, std::size_t>(true)) ); + } + +// libstdc++/24799 +void test01() +{ + do_test<bool>(); + do_test<char>(); + do_test<signed char>(); + do_test<unsigned char>(); + do_test<short>(); + do_test<int>(); + do_test<long>(); + do_test<unsigned short>(); + do_test<unsigned int>(); + do_test<unsigned long>(); + do_test<int*>(); + do_test<std::string>(); + do_test<float>(); + do_test<double>(); + do_test<long double>(); + +#ifdef _GLIBCXX_USE_WCHAR_T + do_test<wchar_t>(); + do_test<std::wstring>(); +#endif +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/hash/operators/size_t.cc b/libstdc++-v3/testsuite/tr1/6_containers/hash/operators/size_t.cc new file mode 100644 index 000000000..9013a04bf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/hash/operators/size_t.cc @@ -0,0 +1,75 @@ +// 2007-08-20 <benjamin@redhat.com> +// +// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.3 Class template hash + +#include <tr1/functional> +#include <string> +#include <testsuite_hooks.h> + +template<typename T> + void + do_test() + { + bool test __attribute__((unused)) = true; + + typedef T value_type; + typedef std::tr1::hash<value_type> hash_type; + using std::size_t; + + value_type v = T(); // default initialized is fine, same value all + // that matters. + hash_type h1; + size_t r1 = size_t(h1(v)); + + hash_type h2; + size_t r2 = size_t(h2(v)); + + VERIFY( r1 == r2 ); + } + +void test01() +{ + do_test<bool>(); + do_test<char>(); + do_test<signed char>(); + do_test<unsigned char>(); + do_test<short>(); + do_test<int>(); + do_test<long>(); + do_test<unsigned short>(); + do_test<unsigned int>(); + do_test<unsigned long>(); + do_test<int*>(); + do_test<std::string>(); + do_test<float>(); + do_test<double>(); + do_test<long double>(); + +#ifdef _GLIBCXX_USE_WCHAR_T + do_test<wchar_t>(); + do_test<std::wstring>(); +#endif +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/base_classes.cc b/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/base_classes.cc new file mode 100644 index 000000000..f5883786c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/base_classes.cc @@ -0,0 +1,32 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/functional> + +void test01() +{ + // Check for required base class. + typedef long value_type; + typedef std::tr1::hash<value_type> test_type; + typedef std::unary_function<value_type, std::size_t> base_type; + + test_type b; + const test_type& obj = b; + const base_type* base __attribute__((unused)) = &obj; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..462e929df --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/explicit_instantiation.cc @@ -0,0 +1,50 @@ +// { dg-do compile } + +// 2005-02-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.3 class template hash + +#include <string> +#include <tr1/functional> + +using namespace std::tr1; + +// Verify that we can instantiate hash for every required type. +template class hash<bool>; +template class hash<char>; +template class hash<signed char>; +template class hash<unsigned char>; +template class hash<short>; +template class hash<int>; +template class hash<long>; +template class hash<unsigned short>; +template class hash<unsigned int>; +template class hash<unsigned long>; +template class hash<float>; +template class hash<double>; +template class hash<long double>; +template class hash<void*>; +template class hash<std::string>; + +#ifdef _GLIBCXX_USE_WCHAR_T +template class hash<wchar_t>; +template class hash<std::wstring>; +#endif + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/headers/array/synopsis.cc b/libstdc++-v3/testsuite/tr1/6_containers/headers/array/synopsis.cc new file mode 100644 index 000000000..778bf0730 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/headers/array/synopsis.cc @@ -0,0 +1,51 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/array> + +namespace std { +namespace tr1 { + + // [6.2.2] Class template array + template <class T, size_t N > struct array; + + // Array comparisons + template <class T, size_t N> bool operator==(const array<T,N>& x, const array<T,N>& y); + template <class T, size_t N> bool operator!=(const array<T,N>& x, const array<T,N>& y); + template <class T, size_t N> bool operator<(const array<T,N>& x, const array<T,N>& y); + template <class T, size_t N> bool operator>(const array<T,N>& x, const array<T,N>& y); + template <class T, size_t N> bool operator<=(const array<T,N>& x, const array<T,N>& y); + template <class T, size_t N> bool operator>=(const array<T,N>& x, const array<T,N>& y); + + // [6.2.2.2] Specialized algorithms + template <class T, size_t N > void swap(array<T,N>& x, array<T,N>& y); + + // [6.2.2.5] Tuple interface to class template array + template <class T> class tuple_size; // forward declaration + template <int I, class T> class tuple_element; // forward declaration + template <class T, size_t N> struct tuple_size<array<T, N> >; + template <int I, class T, size_t N> struct tuple_element<I, array<T, N> >; + template <int I, class T, size_t N> T& get(array<T, N>&); + template <int I, class T, size_t N> const T& get(const array<T, N>&); + +} // namespace tr1 +} // namespace std + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/headers/functional/synopsis.cc b/libstdc++-v3/testsuite/tr1/6_containers/headers/functional/synopsis.cc new file mode 100644 index 000000000..a64979145 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/headers/functional/synopsis.cc @@ -0,0 +1,32 @@ +// { dg-do compile } +// { dg-require-c-std "" } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/functional> + +namespace std { +namespace tr1 { + + // [6.3.3] Hash function base template + template <class T> struct hash; + +} // namespace tr1 +} // namespace std diff --git a/libstdc++-v3/testsuite/tr1/6_containers/headers/tuple/synopsis.cc b/libstdc++-v3/testsuite/tr1/6_containers/headers/tuple/synopsis.cc new file mode 100644 index 000000000..3d41b0a3b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/headers/tuple/synopsis.cc @@ -0,0 +1,70 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/tuple> + +namespace std { +namespace tr1 { + +#if 0 + // [6.1.3] Class template tuple + template <class T1 = unspecified , + class T2 = unspecified , + ..., + class TM = unspecified > class tuple; + + // [6.1.3.2] Tuple creation functions + const unspecified ignore; + template<class T1, class T2, ..., class TN> + tuple<V1, V2, ..., VN> make_tuple(const T1&, const T2& , ..., const TN&); + + template<class T1, class T2, ..., class TN> + tuple<T1&, T2&, ..., TN&> tie(T1&, T2& , ..., TN&); +#endif + + // [6.1.3.3] Tuple helper classes + template <class T> class tuple_size; + template <int I, class T> class tuple_element; + +#if 0 + // [6.1.3.4] Element access + template <int I, class T1, class T2, ..., class TN> + RJ get(tuple<T1, T2, ..., TN>&); + template <int I, class T1, class T2, ..., class TN> + PJ get(const tuple<T1, T2, ..., TN>&); + + // [6.1.3.5] relational operators + template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM> + bool operator==(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&); + template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM> + bool operator<(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&); + template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM> + bool operator!=(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&); + template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM> + bool operator>(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&); + template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM> + bool operator<=(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&); + template<class T1, class T2, ..., class TM, class U1, class U2, ..., class UM> + bool operator>=(const tuple<T1, T2, ..., TM>&, const tuple<U1, U2, ..., UM>&); +#endif + +} // namespace tr1 +} // namespace std diff --git a/libstdc++-v3/testsuite/tr1/6_containers/headers/tuple/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/6_containers/headers/tuple/types_std_tr1.cc new file mode 100644 index 000000000..3feb5b70f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/headers/tuple/types_std_tr1.cc @@ -0,0 +1,25 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/tuple> + +namespace gnu +{ + using std::tr1::ignore; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/headers/unordered_map/synopsis.cc b/libstdc++-v3/testsuite/tr1/6_containers/headers/unordered_map/synopsis.cc new file mode 100644 index 000000000..0555ece20 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/headers/unordered_map/synopsis.cc @@ -0,0 +1,52 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/unordered_map> + +namespace std { +namespace tr1 { + + // [6.3.4.4] Class template unordered_map + template <class Key, + class T, + class Hash, + class Pred, + class Alloc> + class unordered_map; + + // [6.3.4.6] Class template unordered_multimap + template <class Key, + class T, + class Hash, + class Pred, + class Alloc> + class unordered_multimap; + +template <class Key, class T, class Hash, class Pred, class Alloc> + void swap(unordered_map<Key, T, Hash, Pred, Alloc>& x, + unordered_map<Key, T, Hash, Pred, Alloc>& y); +template <class Key, class T, class Hash, class Pred, class Alloc> + void swap(unordered_multimap<Key, T, Hash, Pred, Alloc>& x, + unordered_multimap<Key, T, Hash, Pred, Alloc>& y); + +} // namespace tr1 +} // namespace std + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/headers/unordered_set/synopsis.cc b/libstdc++-v3/testsuite/tr1/6_containers/headers/unordered_set/synopsis.cc new file mode 100644 index 000000000..0facef6b8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/headers/unordered_set/synopsis.cc @@ -0,0 +1,51 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik <bkoz@redhat.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/unordered_set> + +namespace std { +namespace tr1 { + + // [6.3.4.3] Class template unordered_set + template <class Value, + class Hash, + class Pred, + class Alloc> + class unordered_set; + + // [6.3.4.5] Class template unordered_multiset + template <class Value, + class Hash, + class Pred, + class Alloc> + class unordered_multiset; + + template <class Value, class Hash, class Pred, class Alloc> + void swap(unordered_set<Value, Hash, Pred, Alloc>& x, + unordered_set<Value, Hash, Pred, Alloc>& y); + + template <class Value, class Hash, class Pred, class Alloc> + void swap(unordered_multiset<Value, Hash, Pred, Alloc>& x, + unordered_multiset<Value, Hash, Pred, Alloc>& y); + +} // namespace tr1 +} // namespace std + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/35480_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/35480_neg.cc new file mode 100644 index 000000000..aff8e9a40 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/35480_neg.cc @@ -0,0 +1,32 @@ +// { dg-do compile } + +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> + +// libstdc++/35480 +void test01() +{ + std::tr1::tuple<int> t1( 1 ); + std::tr1::tuple<int, int> t2( 1, 2 ); + if ( t1 < t2 ) {} // { dg-error "here" } + if ( t1 == t2 ) {} // { dg-error "here" } +} +// { dg-excess-errors "incomplete type" } diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/comparisons.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/comparisons.cc new file mode 100644 index 000000000..b5ef96f41 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/comparisons.cc @@ -0,0 +1,50 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <testsuite_hooks.h> + +using namespace std::tr1; + +bool test __attribute__((unused)) = true; + +#define TEST1(x) VERIFY( x == x && !(x != x) && x <= x && !(x < x) ) + +int +main() +{ + int i=0; + int j=0; + int k=2; + tuple<int, int, int> a(0, 0, 0); + tuple<int, int, int> b(0, 0, 1); + tuple<int& , int& , int&> c(i,j,k); + tuple<const int&, const int&, const int&> d(c); + TEST1(a); + TEST1(b); + TEST1(c); + TEST1(d); + VERIFY(!(a > a) && !(b > b)); + VERIFY(a >= a && b >= b); + VERIFY(a < b && !(b < a) && a <= b && !(b <= a)); + VERIFY(b > a && !(a > b) && b >= a && !(a >= b)); +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/assignment.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/assignment.cc new file mode 100644 index 000000000..a2cf9181f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/assignment.cc @@ -0,0 +1,53 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <testsuite_hooks.h> + +using namespace std::tr1; + +int +main() +{ + bool test __attribute__((unused)) = true; + + tuple<> ta; + tuple<> tb; + ta = tb; + + tuple<int> tc(1); + tuple<int> td(0); + td = tc; + VERIFY(get<0>(td) == 1); + + int i=0; + tuple<int&> te(i); + te = tc; + VERIFY(i == 1); + + tuple<const int&> tf(tc); + + get<0>(tc) = 2; + VERIFY(get<0>(tf) == 2); + tuple<double> tg; + tg = tc; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/big_tuples.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/big_tuples.cc new file mode 100644 index 000000000..51c6216a8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/big_tuples.cc @@ -0,0 +1,108 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <testsuite_hooks.h> + +using namespace std::tr1; +using std::pair; + +// A simple class without conversions to check some things +struct foo +{ }; + +void +test_constructors() +{ + bool test __attribute__((unused)) = true; + + int x1=0,x2=0; + const int &z1=x1; + + // Test empty constructor + tuple<> ta __attribute__((unused)); + tuple<int,int> tb; + // Test construction from values + tuple<int,int> tc(x1,x2); + tuple<int,int&> td(x1,x2); + tuple<const int&> te(z1); + x1=1; + x2=1; + VERIFY(get<0>(td) == 0 && get<1>(td) == 1 && get<0>(te) == 1); + + // Test identical tuple copy constructor + tuple<int,int> tf(tc); + tuple<int,int> tg(td); + tuple<const int&> th(te); + // Test different tuple copy constructor + tuple<int,double> ti(tc); + tuple<int,double> tj(td); + // Test constructing from a pair + pair<int,int> pair1(1,1); + const pair<int,int> pair2(pair1); + tuple<int,int> tl(pair1); + tuple<int,const int&> tm(pair1); + tuple<int,int> tn(pair2); + tuple<int,const int&> to(pair2); +} + +int +main(void) +{ + //test construction + typedef tuple<int,int,int,int,int,int,int,int,int,int> type1; + type1 a(0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + type1 b(0, 0, 0, 0, 0, 0, 0, 0, 0, 2); + type1 c(a); + typedef tuple<int,int,int,int,int,int,int,int,int,char> type2; + type2 d(0, 0, 0, 0, 0, 0, 0, 0, 0, 3); + type1 e(d); + typedef tuple<foo,int,int,int,int,int,int,int,int,foo> type3; + // get + VERIFY(get<9>(a)==1 && get<9>(b)==2); + // comparisons + VERIFY(a==a && !(a!=a) && a<=a && a>=a && !(a<a) && !(a>a)); + VERIFY(!(a==b) && a!=b && a<=b && a<b && !(a>=b) && !(a>b)); + //tie + { + int i = 0; + tie(ignore, ignore, ignore, ignore, ignore, ignore, ignore, ignore, + ignore, i) = a; + VERIFY(i == 1); + } + //test_assignment + a=d; + a=b; + //make_tuple + make_tuple(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //tuple_size + VERIFY(tuple_size<type3>::value == 10); + //tuple_element + { + foo q1; + tuple_element<0,type3>::type q2(q1); + tuple_element<9,type3>::type q3(q1); + } + +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/constructor.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/constructor.cc new file mode 100644 index 000000000..2e862813b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/constructor.cc @@ -0,0 +1,67 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <testsuite_hooks.h> + +using namespace std::tr1; +using std::pair; + +int +main() +{ + bool test __attribute__((unused)) = true; + + int x1=0,x2=0; + const int &z1=x1; + + // Test empty constructor + tuple<> ta __attribute__((unused)); + tuple<int,int> tb; + // Test construction from values + tuple<int,int> tc(x1,x2); + tuple<int,int&> td(x1,x2); + tuple<const int&> te(z1); + x1=1; + x2=1; + VERIFY(get<0>(td) == 0 && get<1>(td) == 1 && get<0>(te) == 1); + + // Test identical tuple copy constructor + tuple<int,int> tf(tc); + tuple<int,int> tg(td); + tuple<const int&> th(te); + // Test different tuple copy constructor + tuple<int,double> ti(tc); + tuple<int,double> tj(td); + //tuple<int&, int&> tk(tc); + tuple<const int&, const int&> tl(tc); + tuple<const int&, const int&> tm(tl); + // Test constructing from a pair + pair<int,int> pair1(1,1); + const pair<int,int> pair2(pair1); + tuple<int,int> tn(pair1); + tuple<int,const int&> to(pair1); + tuple<int,int> tp(pair2); + tuple<int,const int&> tq(pair2); + return 0; +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/23978.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/23978.cc new file mode 100644 index 000000000..b4f928714 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/23978.cc @@ -0,0 +1,46 @@ +// 2005-09-29 Chris Jefferson <chris@bubblescope.net> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <tr1/utility> +#include <testsuite_hooks.h> + +using namespace std::tr1; +using std::pair; + +// libstdc++/23978 +void test01() +{ + bool test __attribute__((unused)) = true; + + pair<int, int> p(1, 2); + int x = 0; + int y = 0; + tie(x, y) = p; + VERIFY( x == 1 && y == 2 ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc new file mode 100644 index 000000000..0b6da3fee --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc @@ -0,0 +1,38 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <tr1/functional> +#include <testsuite_hooks.h> + +using namespace std::tr1; + +int +main() +{ + bool test __attribute__((unused)) = true; + + int i=0; + make_tuple(1,2,4.0); + make_tuple(ref(i)) = tuple<int>(1); + VERIFY(i == 1); +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie.cc new file mode 100644 index 000000000..419a7ad31 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie.cc @@ -0,0 +1,43 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <testsuite_hooks.h> + +using namespace std::tr1; + +int +main() +{ + bool test __attribute__((unused)) = true; + + int x1 = 0; + int x2 = 0; + int y1 = 0; + int y2 = 0; + tuple<int,int> ta(1,1); + tuple<const int&,const int&> tc(x1,x2); + tie(y1,y2)=ta; + VERIFY(y1 == 1 && y2 == 1); + tie(y1,y2)=tc; + VERIFY(y1 == 0 && y2 == 0); +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie2.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie2.cc new file mode 100644 index 000000000..7aea51643 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie2.cc @@ -0,0 +1,36 @@ +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <string> +#include <testsuite_hooks.h> + +int +main() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + + int i; + std::string s; + + tie(i, ignore, s) = make_tuple(42, 3.14, "C++"); + VERIFY( i == 42 ); + VERIFY( s == "C++" ); +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/element_access/get.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/element_access/get.cc new file mode 100644 index 000000000..ebd3fd2bf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/element_access/get.cc @@ -0,0 +1,45 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <testsuite_hooks.h> + +using namespace std::tr1; + +int +main() +{ + bool test __attribute__((unused)) = true; + + int j=1; + const int k=2; + tuple<int,int &,const int&> a(0,j,k); + const tuple<int,int &,const int&> b(1,j,k); + VERIFY(get<0>(a)==0 && get<1>(a)==1 && get<2>(a)==2); + get<0>(a)=3; + get<1>(a)=4; + VERIFY(get<0>(a)==3 && get<1>(a)==4); + VERIFY(j==4); + get<1>(b)=5; + VERIFY(get<0>(b)==1 && get<1>(b)==5 && get<2>(b)==2); + VERIFY(j==5); +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..72e710f57 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/requirements/explicit_instantiation.cc @@ -0,0 +1,25 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + + +// This file tests explicit instantiation of library containers. + +#include <tr1/tuple> + +template class std::tr1::tuple<short, int, double>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_element.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_element.cc new file mode 100644 index 000000000..b41592105 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_element.cc @@ -0,0 +1,39 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <testsuite_hooks.h> + +using namespace std::tr1; + +struct foo +{ }; + +int +main() +{ + // As foo isn't constructible from anything else, this + // lets us check if type is returning foo when it should + foo q1; + tuple_element<0,tuple<foo,void,int> >::type q2(q1); + tuple_element<2,tuple<void,int,foo> >::type q3(q1); +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_size.cc b/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_size.cc new file mode 100644 index 000000000..d15a3cc20 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_size.cc @@ -0,0 +1,39 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// Tuple + +#include <tr1/tuple> +#include <testsuite_hooks.h> + +using namespace std::tr1; + +int +main() +{ + bool test __attribute__((unused)) = true; + + VERIFY(tuple_size<tuple<> >::value == 0); + VERIFY(tuple_size<tuple<int> >::value == 1); + VERIFY(tuple_size<tuple<void> >::value == 1); + typedef tuple<int,const int&,void> test_tuple1; + VERIFY(tuple_size<test_tuple1>::value == 3); + VERIFY(tuple_size<tuple<tuple<void> > >::value == 1); +} + diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/24064.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/24064.cc new file mode 100644 index 000000000..d94351fa9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/24064.cc @@ -0,0 +1,47 @@ +// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3 Unordered associative containers + +#include <tr1/unordered_map> +#include <testsuite_hooks.h> + +// libstdc++/24064 +void test01() +{ + bool test __attribute__((unused)) = true; + + using namespace std::tr1; + using std::allocator; + using std::pair; + using std::equal_to; + + __unordered_map<int, char, hash<int>, equal_to<int>, + allocator<pair<const int, char> >, true> m; + + for (int i = 0; i < 1000; ++i) + m[i] = '0' + i % 9; + + for (int i = 0; i < 1000; ++i) + VERIFY( ++m.find(i)->second == '1' + i % 9 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/capacity/29134-map.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/capacity/29134-map.cc new file mode 100644 index 000000000..08d87f2df --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/capacity/29134-map.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 Class template unordered_map + +#include <tr1/unordered_map> +#include <testsuite_hooks.h> + +// libstdc++/29134 +void test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::unordered_map<int, int> um; + + VERIFY( (um.max_size() == std::allocator<std::tr1::__detail::_Hash_node< + std::pair<const int, int>, false> >().max_size())); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/erase/1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/erase/1.cc new file mode 100644 index 000000000..68236032f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/erase/1.cc @@ -0,0 +1,130 @@ +// 2007-02-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 Class template unordered_map + +#include <tr1/unordered_map> +#include <string> +#include <testsuite_hooks.h> + +// In the occasion of libstdc++/25896 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_map<std::string, int> Map; + typedef Map::iterator iterator; + typedef Map::const_iterator const_iterator; + typedef Map::value_type value_type; + + Map m1; + + m1.insert(value_type("because to why", 1)); + m1.insert(value_type("the stockholm syndrome", 2)); + m1.insert(value_type("a cereous night", 3)); + m1.insert(value_type("eeilo", 4)); + m1.insert(value_type("protean", 5)); + m1.insert(value_type("the way you are when", 6)); + m1.insert(value_type("tillsammans", 7)); + m1.insert(value_type("umbra/penumbra", 8)); + m1.insert(value_type("belonging (no longer mix)", 9)); + m1.insert(value_type("one line behind", 10)); + VERIFY( m1.size() == 10 ); + + VERIFY( m1.erase("eeilo") == 1 ); + VERIFY( m1.size() == 9 ); + iterator it1 = m1.find("eeilo"); + VERIFY( it1 == m1.end() ); + + VERIFY( m1.erase("tillsammans") == 1 ); + VERIFY( m1.size() == 8 ); + iterator it2 = m1.find("tillsammans"); + VERIFY( it2 == m1.end() ); + + // Must work (see DR 526) + iterator it3 = m1.find("belonging (no longer mix)"); + VERIFY( it3 != m1.end() ); + VERIFY( m1.erase(it3->first) == 1 ); + VERIFY( m1.size() == 7 ); + it3 = m1.find("belonging (no longer mix)"); + VERIFY( it3 == m1.end() ); + + VERIFY( !m1.erase("abra") ); + VERIFY( m1.size() == 7 ); + + VERIFY( !m1.erase("eeilo") ); + VERIFY( m1.size() == 7 ); + + VERIFY( m1.erase("because to why") == 1 ); + VERIFY( m1.size() == 6 ); + iterator it4 = m1.find("because to why"); + VERIFY( it4 == m1.end() ); + + iterator it5 = m1.find("umbra/penumbra"); + iterator it6 = m1.find("one line behind"); + VERIFY( it5 != m1.end() ); + VERIFY( it6 != m1.end() ); + + VERIFY( m1.find("the stockholm syndrome") != m1.end() ); + VERIFY( m1.find("a cereous night") != m1.end() ); + VERIFY( m1.find("the way you are when") != m1.end() ); + VERIFY( m1.find("a cereous night") != m1.end() ); + + VERIFY( m1.erase(it5->first) == 1 ); + VERIFY( m1.size() == 5 ); + it5 = m1.find("umbra/penumbra"); + VERIFY( it5 == m1.end() ); + + VERIFY( m1.erase(it6->first) == 1 ); + VERIFY( m1.size() == 4 ); + it6 = m1.find("one line behind"); + VERIFY( it6 == m1.end() ); + + iterator it7 = m1.begin(); + iterator it8 = it7; + ++it8; + iterator it9 = it8; + ++it9; + + VERIFY( m1.erase(it8->first) == 1 ); + VERIFY( m1.size() == 3 ); + VERIFY( ++it7 == it9 ); + + iterator it10 = it9; + ++it10; + iterator it11 = it10; + + VERIFY( m1.erase(it9->first) == 1 ); + VERIFY( m1.size() == 2 ); + VERIFY( ++it10 == m1.end() ); + + VERIFY( m1.erase(m1.begin()) != m1.end() ); + VERIFY( m1.size() == 1 ); + VERIFY( m1.begin() == it11 ); + + VERIFY( m1.erase(m1.begin()->first) == 1 ); + VERIFY( m1.size() == 0 ); + VERIFY( m1.begin() == m1.end() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/erase/24061-map.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/erase/24061-map.cc new file mode 100644 index 000000000..86f0e26cc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/erase/24061-map.cc @@ -0,0 +1,105 @@ +// 2005-10-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 Class template unordered_map + +#include <tr1/unordered_map> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_map<std::string, int> Map; + typedef Map::iterator iterator; + typedef Map::const_iterator const_iterator; + typedef Map::value_type value_type; + + Map m1; + + m1.insert(value_type("all the love in the world", 1)); + m1.insert(value_type("you know what you are?", 2)); + m1.insert(value_type("the collector", 3)); + m1.insert(value_type("the hand that feeds", 4)); + m1.insert(value_type("love is not enough", 5)); + m1.insert(value_type("every day is exactly the same", 6)); + m1.insert(value_type("with teeth", 7)); + m1.insert(value_type("only", 8)); + m1.insert(value_type("getting smaller", 9)); + m1.insert(value_type("sunspots", 10)); + VERIFY( m1.size() == 10 ); + + iterator it1 = m1.begin(); + ++it1; + iterator it2 = it1; + ++it2; + iterator it3 = m1.erase(it1); + VERIFY( m1.size() == 9 ); + VERIFY( it3 == it2 ); + VERIFY( *it3 == *it2 ); + + iterator it4 = m1.begin(); + ++it4; + ++it4; + ++it4; + iterator it5 = it4; + ++it5; + ++it5; + iterator it6 = m1.erase(it4, it5); + VERIFY( m1.size() == 7 ); + VERIFY( it6 == it5 ); + VERIFY( *it6 == *it5 ); + + const_iterator it7 = m1.begin(); + ++it7; + ++it7; + ++it7; + const_iterator it8 = it7; + ++it8; + const_iterator it9 = m1.erase(it7); + VERIFY( m1.size() == 6 ); + VERIFY( it9 == it8 ); + VERIFY( *it9 == *it8 ); + + const_iterator it10 = m1.begin(); + ++it10; + const_iterator it11 = it10; + ++it11; + ++it11; + ++it11; + ++it11; + const_iterator it12 = m1.erase(it10, it11); + VERIFY( m1.size() == 2 ); + VERIFY( it12 == it11 ); + VERIFY( *it12 == *it11 ); + VERIFY( ++it12 == m1.end() ); + + iterator it13 = m1.erase(m1.begin(), m1.end()); + VERIFY( m1.size() == 0 ); + VERIFY( it13 == it12 ); + VERIFY( it13 == m1.begin() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/find/map1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/find/map1.cc new file mode 100644 index 000000000..906c32628 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/find/map1.cc @@ -0,0 +1,70 @@ +// { dg-do run } + +// 2005-2-18 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 unordered_map +// find, equal_range, count + +#include <string> +#include <iterator> +#include <algorithm> +#include <utility> +#include <tr1/unordered_map> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_map<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + std::pair<Map::iterator, bool> tmp = m.insert(Pair("grape", 3)); + Map::iterator i = tmp.first; + VERIFY(tmp.second); + + Map::iterator i2 = m.find("grape"); + VERIFY(i2 != m.end()); + VERIFY(i2 == i); + VERIFY(i2->first == "grape"); + VERIFY(i2->second == 3); + + Map::iterator i3 = m.find("lime"); + VERIFY(i3 == m.end()); + + std::pair<Map::iterator, Map::iterator> p = m.equal_range("grape"); + VERIFY(std::distance(p.first, p.second) == 1); + VERIFY(p.first == i2); + + std::pair<Map::iterator, Map::iterator> p2 = m.equal_range("lime"); + VERIFY(p2.first == p2.second); + + VERIFY(m.count("grape") == 1); + VERIFY(m.count("lime") == 0); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/24061-map.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/24061-map.cc new file mode 100644 index 000000000..808818048 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/24061-map.cc @@ -0,0 +1,60 @@ +// 2005-10-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 Class template unordered_map + +#include <tr1/unordered_map> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_map<std::string, int> Map; + typedef Map::iterator iterator; + typedef Map::const_iterator const_iterator; + typedef Map::value_type value_type; + + Map m1; + + iterator it1 = m1.insert(m1.begin(), + value_type("all the love in the world", 1)); + VERIFY( m1.size() == 1 ); + VERIFY( *it1 == value_type("all the love in the world", 1) ); + + const_iterator cit1(it1); + const_iterator cit2 = m1.insert(cit1, + value_type("you know what you are?", 2)); + VERIFY( m1.size() == 2 ); + VERIFY( cit2 != cit1 ); + VERIFY( *cit2 == value_type("you know what you are?", 2) ); + + iterator it2 = m1.insert(it1, value_type("all the love in the world", 3)); + VERIFY( m1.size() == 2 ); + VERIFY( it2 == it1 ); + VERIFY( *it2 == value_type("all the love in the world", 1) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/array_syntax.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/array_syntax.cc new file mode 100644 index 000000000..e1f894d60 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/array_syntax.cc @@ -0,0 +1,60 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 unordered_map +// Array version of insert + +#include <string> +#include <iterator> +#include <tr1/unordered_map> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_map<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + m["red"] = 17; + VERIFY(m.size() == 1); + VERIFY(m.begin()->first == "red"); + VERIFY(m.begin()->second == 17); + VERIFY(m["red"] == 17); + + m["blue"] = 9; + VERIFY(m.size() == 2); + VERIFY(m["blue"] == 9); + + m["red"] = 5; + VERIFY(m.size() == 2); + VERIFY(m["red"] == 5); + VERIFY(m["blue"] == 9); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/map_range.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/map_range.cc new file mode 100644 index 000000000..5388a42a4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/map_range.cc @@ -0,0 +1,98 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 unordered_map +// range insert + +#include <string> +#include <iterator> +#include <algorithm> +#include <tr1/unordered_map> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_map<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + Pair A[5] = + { + Pair("red", 5), + Pair("green", 9), + Pair("blue", 3), + Pair("cyan", 8), + Pair("magenta", 7) + }; + + m.insert(A+0, A+5); + VERIFY(m.size() == 5); + VERIFY(std::distance(m.begin(), m.end()) == 5); + + VERIFY(m["red"] == 5); + VERIFY(m["green"] == 9); + VERIFY(m["blue"] == 3); + VERIFY(m["cyan"] == 8); + VERIFY(m["magenta"] == 7); +} + +void test02() +{ + typedef std::tr1::unordered_map<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + Pair A[9] = + { + Pair("red", 5), + Pair("green", 9), + Pair("red", 19), + Pair("blue", 3), + Pair("blue", 60), + Pair("cyan", 8), + Pair("magenta", 7), + Pair("blue", 99), + Pair("green", 33) + }; + + m.insert(A+0, A+9); + VERIFY(m.size() == 5); + VERIFY(std::distance(m.begin(), m.end()) == 5); + + VERIFY(m["red"] == 5); + VERIFY(m["green"] == 9); + VERIFY(m["blue"] == 3); + VERIFY(m["cyan"] == 8); + VERIFY(m["magenta"] == 7); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/map_single.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/map_single.cc new file mode 100644 index 000000000..023c46caf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/insert/map_single.cc @@ -0,0 +1,73 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 unordered_map +// Single-element insert + +#include <string> +#include <iterator> +#include <tr1/unordered_map> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_map<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + std::pair<Map::iterator, bool> p = m.insert(Pair("abcde", 3)); + VERIFY(p.second); + VERIFY(m.size() == 1); + VERIFY(std::distance(m.begin(), m.end()) == 1); + VERIFY(p.first == m.begin()); + VERIFY(p.first->first == "abcde"); + VERIFY(p.first->second == 3); +} + +void test02() +{ + typedef std::tr1::unordered_map<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + std::pair<Map::iterator, bool> p1 = m.insert(Pair("abcde", 3)); + std::pair<Map::iterator, bool> p2 = m.insert(Pair("abcde", 7)); + + VERIFY(p1.second); + VERIFY(!p2.second); + VERIFY(m.size() == 1); + VERIFY(p1.first == p2.first); + VERIFY(p1.first->first == "abcde"); + VERIFY(p2.first->second == 3); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..37c15e5ed --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/explicit_instantiation.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2005-02-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 unordered_map + +#include <string> +#include <tr1/unordered_map> + +using namespace std::tr1; +using std::string; +using std::allocator; +using std::pair; +using std::equal_to; + +template class unordered_map<string, float>; +template class unordered_map<string, int, + hash<string>, equal_to<string>, + allocator<pair<const string, int> > >; +template class unordered_map<string, float, + hash<string>, equal_to<string>, + allocator<char> >; +template class __unordered_map<string, int, + hash<string>, equal_to<string>, + allocator<pair<const string, int> >, true>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/iterator_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/iterator_neg.cc new file mode 100644 index 000000000..bc5881242 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/iterator_neg.cc @@ -0,0 +1,40 @@ +// 2005-10-02 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +#include <tr1/unordered_map> + +void test01() +{ + typedef std::tr1::unordered_map<int, int> Map; + + Map m; + + Map::const_iterator cit = m.begin(); + (*cit).second = 0; // { dg-error "read-only" } + + Map::const_local_iterator clit = m.begin(0); + (*clit).second = 0; // { dg-error "read-only" } + + Map::iterator it = cit; // { dg-error "conversion" } + + Map::local_iterator lit = clit; // { dg-error "conversion" } +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/iterator_null_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/iterator_null_neg.cc new file mode 100644 index 000000000..882ca3643 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/iterator_null_neg.cc @@ -0,0 +1,28 @@ +// 2005-09-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009, 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +// libstdc++/23781 +#include <tr1/unordered_map> +#include <cstddef> + +std::tr1::unordered_map<int, int>::iterator it1 = NULL; // { dg-error "conversion" } +std::tr1::unordered_map<int, int>::const_iterator cit1 = NULL; // { dg-error "conversion" } diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/typedefs.cc new file mode 100644 index 000000000..00bd29053 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/typedefs.cc @@ -0,0 +1,46 @@ +// { dg-do compile } +// 2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> + +// Copyright (C) 2008, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 unordered_map + +#include <tr1/unordered_map> + +void test01() +{ + // Check for required typedefs + typedef std::tr1::unordered_map<int, int> test_type; + + typedef test_type::key_type key_type; + typedef test_type::value_type value_type; + typedef test_type::mapped_type mapped_type; + typedef test_type::hasher hasher; + typedef test_type::key_equal key_equal; + typedef test_type::allocator_type allocator_type; + typedef test_type::pointer pointer; + typedef test_type::const_pointer const_pointer; + typedef test_type::reference reference; + typedef test_type::const_reference const_reference; + typedef test_type::size_type size_type; + typedef test_type::difference_type difference_type; + typedef test_type::iterator iterator; + typedef test_type::const_iterator const_iterator; + typedef test_type::local_iterator local_iterator; + typedef test_type::const_local_iterator const_local_iterator; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/swap/1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/swap/1.cc new file mode 100644 index 000000000..64c730d18 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/swap/1.cc @@ -0,0 +1,163 @@ +// 2005-12-20 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 unordered_map::swap + +#include <tr1/unordered_map> +#include <map> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// uneq_allocator as a non-empty allocator. +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + using std::pair; + using std::equal_to; + using std::map; + + typedef pair<const char, int> my_pair; + typedef __gnu_test::uneq_allocator<my_pair> my_alloc; + typedef unordered_map<char, int, hash<char>, equal_to<char>, my_alloc> + my_umap; + + const char title01[] = "Rivers of sand"; + const char title02[] = "Concret PH"; + const char title03[] = "Sonatas and Interludes for Prepared Piano"; + const char title04[] = "never as tired as when i'm waking up"; + + const size_t N1 = sizeof(title01); + const size_t N2 = sizeof(title02); + const size_t N3 = sizeof(title03); + const size_t N4 = sizeof(title04); + + typedef map<char, int> my_map; + my_map map01_ref; + for (size_t i = 0; i < N1; ++i) + map01_ref.insert(my_pair(title01[i], i)); + my_map map02_ref; + for (size_t i = 0; i < N2; ++i) + map02_ref.insert(my_pair(title02[i], i)); + my_map map03_ref; + for (size_t i = 0; i < N3; ++i) + map03_ref.insert(my_pair(title03[i], i)); + my_map map04_ref; + for (size_t i = 0; i < N4; ++i) + map04_ref.insert(my_pair(title04[i], i)); + + my_umap::size_type size01, size02; + + my_alloc alloc01(1); + + my_umap umap01(10, hash<char>(), equal_to<char>(), alloc01); + size01 = umap01.size(); + my_umap umap02(10, hash<char>(), equal_to<char>(), alloc01); + size02 = umap02.size(); + + umap01.swap(umap02); + VERIFY( umap01.size() == size02 ); + VERIFY( umap01.empty() ); + VERIFY( umap02.size() == size01 ); + VERIFY( umap02.empty() ); + + my_umap umap03(10, hash<char>(), equal_to<char>(), alloc01); + size01 = umap03.size(); + my_umap umap04(map02_ref.begin(), map02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap04.size(); + + umap03.swap(umap04); + VERIFY( umap03.size() == size02 ); + VERIFY( my_map(umap03.begin(), umap03.end()) == map02_ref ); + VERIFY( umap04.size() == size01 ); + VERIFY( umap04.empty() ); + + my_umap umap05(map01_ref.begin(), map01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umap05.size(); + my_umap umap06(map02_ref.begin(), map02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap06.size(); + + umap05.swap(umap06); + VERIFY( umap05.size() == size02 ); + VERIFY( my_map(umap05.begin(), umap05.end()) == map02_ref ); + VERIFY( umap06.size() == size01 ); + VERIFY( my_map(umap06.begin(), umap06.end()) == map01_ref ); + + my_umap umap07(map01_ref.begin(), map01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umap07.size(); + my_umap umap08(map03_ref.begin(), map03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap08.size(); + + umap07.swap(umap08); + VERIFY( umap07.size() == size02 ); + VERIFY( my_map(umap07.begin(), umap07.end()) == map03_ref ); + VERIFY( umap08.size() == size01 ); + VERIFY( my_map(umap08.begin(), umap08.end()) == map01_ref ); + + my_umap umap09(map03_ref.begin(), map03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umap09.size(); + my_umap umap10(map04_ref.begin(), map04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap10.size(); + + umap09.swap(umap10); + VERIFY( umap09.size() == size02 ); + VERIFY( my_map(umap09.begin(), umap09.end()) == map04_ref ); + VERIFY( umap10.size() == size01 ); + VERIFY( my_map(umap10.begin(), umap10.end()) == map03_ref ); + + my_umap umap11(map04_ref.begin(), map04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umap11.size(); + my_umap umap12(map01_ref.begin(), map01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap12.size(); + + umap11.swap(umap12); + VERIFY( umap11.size() == size02 ); + VERIFY( my_map(umap11.begin(), umap11.end()) == map01_ref ); + VERIFY( umap12.size() == size01 ); + VERIFY( my_map(umap12.begin(), umap12.end()) == map04_ref ); + + my_umap umap13(map03_ref.begin(), map03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umap13.size(); + my_umap umap14(map03_ref.begin(), map03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap14.size(); + + umap13.swap(umap14); + VERIFY( umap13.size() == size02 ); + VERIFY( my_map(umap13.begin(), umap13.end()) == map03_ref ); + VERIFY( umap14.size() == size01 ); + VERIFY( my_map(umap14.begin(), umap14.end()) == map03_ref ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/swap/2.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/swap/2.cc new file mode 100644 index 000000000..cac4090c0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/swap/2.cc @@ -0,0 +1,192 @@ +// 2005-12-20 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.4 unordered_map::swap + +#include <tr1/unordered_map> +#include <map> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// uneq_allocator, two different personalities. +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + using std::pair; + using std::equal_to; + using std::map; + + typedef pair<const char, int> my_pair; + typedef __gnu_test::uneq_allocator<my_pair> my_alloc; + typedef unordered_map<char, int, hash<char>, equal_to<char>, my_alloc> + my_umap; + + const char title01[] = "Rivers of sand"; + const char title02[] = "Concret PH"; + const char title03[] = "Sonatas and Interludes for Prepared Piano"; + const char title04[] = "never as tired as when i'm waking up"; + + const size_t N1 = sizeof(title01); + const size_t N2 = sizeof(title02); + const size_t N3 = sizeof(title03); + const size_t N4 = sizeof(title04); + + typedef map<char, int> my_map; + my_map map01_ref; + for (size_t i = 0; i < N1; ++i) + map01_ref.insert(my_pair(title01[i], i)); + my_map map02_ref; + for (size_t i = 0; i < N2; ++i) + map02_ref.insert(my_pair(title02[i], i)); + my_map map03_ref; + for (size_t i = 0; i < N3; ++i) + map03_ref.insert(my_pair(title03[i], i)); + my_map map04_ref; + for (size_t i = 0; i < N4; ++i) + map04_ref.insert(my_pair(title04[i], i)); + + my_umap::size_type size01, size02; + + my_alloc alloc01(1), alloc02(2); + int personality01, personality02; + + my_umap umap01(10, hash<char>(), equal_to<char>(), alloc01); + size01 = umap01.size(); + personality01 = umap01.get_allocator().get_personality(); + my_umap umap02(10, hash<char>(), equal_to<char>(), alloc02); + size02 = umap02.size(); + personality02 = umap02.get_allocator().get_personality(); + + umap01.swap(umap02); + VERIFY( umap01.size() == size02 ); + VERIFY( umap01.empty() ); + VERIFY( umap02.size() == size01 ); + VERIFY( umap02.empty() ); + VERIFY( umap01.get_allocator().get_personality() == personality02 ); + VERIFY( umap02.get_allocator().get_personality() == personality01 ); + + my_umap umap03(10, hash<char>(), equal_to<char>(), alloc02); + size01 = umap03.size(); + personality01 = umap03.get_allocator().get_personality(); + my_umap umap04(map02_ref.begin(), map02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap04.size(); + personality02 = umap04.get_allocator().get_personality(); + + umap03.swap(umap04); + VERIFY( umap03.size() == size02 ); + VERIFY( my_map(umap03.begin(), umap03.end()) == map02_ref ); + VERIFY( umap04.size() == size01 ); + VERIFY( umap04.empty() ); + VERIFY( umap03.get_allocator().get_personality() == personality02 ); + VERIFY( umap04.get_allocator().get_personality() == personality01 ); + + my_umap umap05(map01_ref.begin(), map01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umap05.size(); + personality01 = umap05.get_allocator().get_personality(); + my_umap umap06(map02_ref.begin(), map02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = umap06.size(); + personality02 = umap06.get_allocator().get_personality(); + + umap05.swap(umap06); + VERIFY( umap05.size() == size02 ); + VERIFY( my_map(umap05.begin(), umap05.end()) == map02_ref ); + VERIFY( umap06.size() == size01 ); + VERIFY( my_map(umap06.begin(), umap06.end()) == map01_ref ); + VERIFY( umap05.get_allocator().get_personality() == personality02 ); + VERIFY( umap06.get_allocator().get_personality() == personality01 ); + + my_umap umap07(map01_ref.begin(), map01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size01 = umap07.size(); + personality01 = umap07.get_allocator().get_personality(); + my_umap umap08(map03_ref.begin(), map03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap08.size(); + personality02 = umap08.get_allocator().get_personality(); + + umap07.swap(umap08); + VERIFY( umap07.size() == size02 ); + VERIFY( my_map(umap07.begin(), umap07.end()) == map03_ref ); + VERIFY( umap08.size() == size01 ); + VERIFY( my_map(umap08.begin(), umap08.end()) == map01_ref ); + VERIFY( umap07.get_allocator().get_personality() == personality02 ); + VERIFY( umap08.get_allocator().get_personality() == personality01 ); + + my_umap umap09(map03_ref.begin(), map03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umap09.size(); + personality01 = umap09.get_allocator().get_personality(); + my_umap umap10(map04_ref.begin(), map04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = umap10.size(); + personality02 = umap10.get_allocator().get_personality(); + + umap09.swap(umap10); + VERIFY( umap09.size() == size02 ); + VERIFY( my_map(umap09.begin(), umap09.end()) == map04_ref ); + VERIFY( umap10.size() == size01 ); + VERIFY( my_map(umap10.begin(), umap10.end()) == map03_ref ); + VERIFY( umap09.get_allocator().get_personality() == personality02 ); + VERIFY( umap10.get_allocator().get_personality() == personality01 ); + + my_umap umap11(map04_ref.begin(), map04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size01 = umap11.size(); + personality01 = umap11.get_allocator().get_personality(); + my_umap umap12(map01_ref.begin(), map01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umap12.size(); + personality02 = umap12.get_allocator().get_personality(); + + umap11.swap(umap12); + VERIFY( umap11.size() == size02 ); + VERIFY( my_map(umap11.begin(), umap11.end()) == map01_ref ); + VERIFY( umap12.size() == size01 ); + VERIFY( my_map(umap12.begin(), umap12.end()) == map04_ref ); + VERIFY( umap11.get_allocator().get_personality() == personality02 ); + VERIFY( umap12.get_allocator().get_personality() == personality01 ); + + my_umap umap13(map03_ref.begin(), map03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umap13.size(); + personality01 = umap13.get_allocator().get_personality(); + my_umap umap14(map03_ref.begin(), map03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = umap14.size(); + personality02 = umap14.get_allocator().get_personality(); + + umap13.swap(umap14); + VERIFY( umap13.size() == size02 ); + VERIFY( my_map(umap13.begin(), umap13.end()) == map03_ref ); + VERIFY( umap14.size() == size01 ); + VERIFY( my_map(umap14.begin(), umap14.end()) == map03_ref ); + VERIFY( umap13.get_allocator().get_personality() == personality02 ); + VERIFY( umap14.get_allocator().get_personality() == personality01 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/capacity/29134-multimap.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/capacity/29134-multimap.cc new file mode 100644 index 000000000..970593e0d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/capacity/29134-multimap.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 Class template unordered_multimap + +#include <tr1/unordered_map> +#include <testsuite_hooks.h> + +// libstdc++/29134 +void test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::unordered_multimap<int, int> umm; + + VERIFY( (umm.max_size() == std::allocator<std::tr1::__detail::_Hash_node< + std::pair<const int, int>, false> >().max_size()) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/erase/1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/erase/1.cc new file mode 100644 index 000000000..ef2c18e09 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/erase/1.cc @@ -0,0 +1,130 @@ +// 2007-02-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 Class template unordered_multimap + +#include <tr1/unordered_map> +#include <string> +#include <testsuite_hooks.h> + +// In the occasion of libstdc++/25896 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_multimap<std::string, int> Mmap; + typedef Mmap::iterator iterator; + typedef Mmap::const_iterator const_iterator; + typedef Mmap::value_type value_type; + + Mmap mm1; + + mm1.insert(value_type("because to why", 1)); + mm1.insert(value_type("the stockholm syndrome", 2)); + mm1.insert(value_type("a cereous night", 3)); + mm1.insert(value_type("eeilo", 4)); + mm1.insert(value_type("protean", 5)); + mm1.insert(value_type("the way you are when", 6)); + mm1.insert(value_type("tillsammans", 7)); + mm1.insert(value_type("umbra/penumbra", 8)); + mm1.insert(value_type("belonging (no longer mix)", 9)); + mm1.insert(value_type("one line behind", 10)); + VERIFY( mm1.size() == 10 ); + + VERIFY( mm1.erase("eeilo") == 1 ); + VERIFY( mm1.size() == 9 ); + iterator it1 = mm1.find("eeilo"); + VERIFY( it1 == mm1.end() ); + + VERIFY( mm1.erase("tillsammans") == 1 ); + VERIFY( mm1.size() == 8 ); + iterator it2 = mm1.find("tillsammans"); + VERIFY( it2 == mm1.end() ); + + // Must work (see DR 526) + iterator it3 = mm1.find("belonging (no longer mix)"); + VERIFY( it3 != mm1.end() ); + VERIFY( mm1.erase(it3->first) == 1 ); + VERIFY( mm1.size() == 7 ); + it3 = mm1.find("belonging (no longer mix)"); + VERIFY( it3 == mm1.end() ); + + VERIFY( !mm1.erase("abra") ); + VERIFY( mm1.size() == 7 ); + + VERIFY( !mm1.erase("eeilo") ); + VERIFY( mm1.size() == 7 ); + + VERIFY( mm1.erase("because to why") == 1 ); + VERIFY( mm1.size() == 6 ); + iterator it4 = mm1.find("because to why"); + VERIFY( it4 == mm1.end() ); + + iterator it5 = mm1.find("umbra/penumbra"); + iterator it6 = mm1.find("one line behind"); + VERIFY( it5 != mm1.end() ); + VERIFY( it6 != mm1.end() ); + + VERIFY( mm1.find("the stockholm syndrome") != mm1.end() ); + VERIFY( mm1.find("a cereous night") != mm1.end() ); + VERIFY( mm1.find("the way you are when") != mm1.end() ); + VERIFY( mm1.find("a cereous night") != mm1.end() ); + + VERIFY( mm1.erase(it5->first) == 1 ); + VERIFY( mm1.size() == 5 ); + it5 = mm1.find("umbra/penumbra"); + VERIFY( it5 == mm1.end() ); + + VERIFY( mm1.erase(it6->first) == 1 ); + VERIFY( mm1.size() == 4 ); + it6 = mm1.find("one line behind"); + VERIFY( it6 == mm1.end() ); + + iterator it7 = mm1.begin(); + iterator it8 = it7; + ++it8; + iterator it9 = it8; + ++it9; + + VERIFY( mm1.erase(it8->first) == 1 ); + VERIFY( mm1.size() == 3 ); + VERIFY( ++it7 == it9 ); + + iterator it10 = it9; + ++it10; + iterator it11 = it10; + + VERIFY( mm1.erase(it9->first) == 1 ); + VERIFY( mm1.size() == 2 ); + VERIFY( ++it10 == mm1.end() ); + + VERIFY( mm1.erase(mm1.begin()) != mm1.end() ); + VERIFY( mm1.size() == 1 ); + VERIFY( mm1.begin() == it11 ); + + VERIFY( mm1.erase(mm1.begin()->first) == 1 ); + VERIFY( mm1.size() == 0 ); + VERIFY( mm1.begin() == mm1.end() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/erase/24061-multimap.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/erase/24061-multimap.cc new file mode 100644 index 000000000..3a14f26b2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/erase/24061-multimap.cc @@ -0,0 +1,108 @@ +// 2005-10-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 Class template unordered_multimap + +#include <tr1/unordered_map> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_multimap<std::string, int> Mmap; + typedef Mmap::iterator iterator; + typedef Mmap::const_iterator const_iterator; + typedef Mmap::value_type value_type; + + Mmap mm1; + + mm1.insert(value_type("all the love in the world", 1)); + mm1.insert(value_type("you know what you are?", 2)); + mm1.insert(value_type("the collector", 3)); + mm1.insert(value_type("the hand that feeds", 4)); + mm1.insert(value_type("love is not enough", 5)); + mm1.insert(value_type("every day is exactly the same", 6)); + mm1.insert(value_type("with teeth", 7)); + mm1.insert(value_type("only", 8)); + mm1.insert(value_type("getting smaller", 9)); + mm1.insert(value_type("sunspots", 10)); + + mm1.insert(value_type("you know what you are?", 5)); + mm1.insert(value_type("the collector", 6)); + mm1.insert(value_type("the hand that feeds", 7)); + VERIFY( mm1.size() == 13 ); + + iterator it1 = mm1.begin(); + ++it1; + iterator it2 = it1; + ++it2; + iterator it3 = mm1.erase(it1); + VERIFY( mm1.size() == 12 ); + VERIFY( it3 == it2 ); + VERIFY( *it3 == *it2 ); + + iterator it4 = mm1.begin(); + ++it4; + ++it4; + ++it4; + iterator it5 = it4; + ++it5; + ++it5; + iterator it6 = mm1.erase(it4, it5); + VERIFY( mm1.size() == 10 ); + VERIFY( it6 == it5 ); + VERIFY( *it6 == *it5 ); + + const_iterator it7 = mm1.begin(); + ++it7; + ++it7; + ++it7; + const_iterator it8 = it7; + ++it8; + const_iterator it9 = mm1.erase(it7); + VERIFY( mm1.size() == 9 ); + VERIFY( it9 == it8 ); + VERIFY( *it9 == *it8 ); + + const_iterator it10 = mm1.begin(); + ++it10; + const_iterator it11 = it10; + ++it11; + ++it11; + ++it11; + ++it11; + const_iterator it12 = mm1.erase(it10, it11); + VERIFY( mm1.size() == 5 ); + VERIFY( it12 == it11 ); + VERIFY( *it12 == *it11 ); + + iterator it13 = mm1.erase(mm1.begin(), mm1.end()); + VERIFY( mm1.size() == 0 ); + VERIFY( it13 == mm1.end() ); + VERIFY( it13 == mm1.begin() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/find/multimap1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/find/multimap1.cc new file mode 100644 index 000000000..c1255c10e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/find/multimap1.cc @@ -0,0 +1,84 @@ +// { dg-do run } + +// 2005-2-18 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap +// find, equal_range, count + +#include <string> +#include <iterator> +#include <algorithm> +#include <utility> +#include <tr1/unordered_map> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_multimap<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + m.insert(Pair("grape", 3)); + m.insert(Pair("durian", 8)); + m.insert(Pair("grape", 7)); + + Map::iterator i1 = m.find("grape"); + Map::iterator i2 = m.find("durian"); + Map::iterator i3 = m.find("kiwi"); + + VERIFY(i1 != m.end()); + VERIFY(i1->first == "grape"); + VERIFY(i1->second == 3 || i2->second == 7); + VERIFY(i2 != m.end()); + VERIFY(i2->first == "durian"); + VERIFY(i2->second == 8); + VERIFY(i3 == m.end()); + + std::pair<Map::iterator, Map::iterator> p1 = m.equal_range("grape"); + VERIFY(std::distance(p1.first, p1.second) == 2); + Map::iterator tmp = p1.first; + ++tmp; + VERIFY(p1.first->first == "grape"); + VERIFY(tmp->first == "grape"); + VERIFY((p1.first->second == 3 && tmp->second == 7) || + (p1.first->second == 7 && tmp->second == 3)); + + std::pair<Map::iterator, Map::iterator> p2 = m.equal_range("durian"); + VERIFY(std::distance(p2.first, p2.second) == 1); + VERIFY(p2.first->first == "durian"); + VERIFY(p2.first->second == 8); + + std::pair<Map::iterator, Map::iterator> p3 = m.equal_range("kiwi"); + VERIFY(p3.first == p3.second); + + VERIFY(m.count("grape") == 2); + VERIFY(m.count("durian") == 1); + VERIFY(m.count("kiwi") == 0); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/24061-multimap.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/24061-multimap.cc new file mode 100644 index 000000000..be3e077d8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/24061-multimap.cc @@ -0,0 +1,60 @@ +// 2005-10-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 Class template unordered_multimap + +#include <tr1/unordered_map> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_multimap<std::string, int> Mmap; + typedef Mmap::iterator iterator; + typedef Mmap::const_iterator const_iterator; + typedef Mmap::value_type value_type; + + Mmap mm1; + + iterator it1 = mm1.insert(mm1.begin(), + value_type("all the love in the world", 1)); + VERIFY( mm1.size() == 1 ); + VERIFY( *it1 == value_type("all the love in the world", 1) ); + + const_iterator cit1(it1); + const_iterator cit2 = mm1.insert(cit1, + value_type("you know what you are?", 2)); + VERIFY( mm1.size() == 2 ); + VERIFY( cit2 != cit1 ); + VERIFY( *cit2 == value_type("you know what you are?", 2) ); + + iterator it2 = mm1.insert(it1, value_type("all the love in the world", 3)); + VERIFY( mm1.size() == 3 ); + VERIFY( it2 != it1 ); + VERIFY( *it2 == value_type("all the love in the world", 3) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/multimap_range.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/multimap_range.cc new file mode 100644 index 000000000..0c1d1cec4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/multimap_range.cc @@ -0,0 +1,92 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap +// range insert + +#include <string> +#include <iterator> +#include <algorithm> +#include <tr1/unordered_map> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_multimap<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + Pair A[5] = + { + Pair("red", 5), + Pair("green", 9), + Pair("blue", 3), + Pair("cyan", 8), + Pair("magenta", 7) + }; + + m.insert(A+0, A+5); + VERIFY(m.size() == 5); + VERIFY(std::distance(m.begin(), m.end()) == 5); + + for (int i = 0; i < 5; ++i) + VERIFY(std::find(m.begin(), m.end(), A[i]) != m.end()); +} + +void test02() +{ + typedef std::tr1::unordered_multimap<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + Pair A[9] = + { + Pair("red", 5), + Pair("green", 9), + Pair("red", 19), + Pair("blue", 3), + Pair("blue", 60), + Pair("cyan", 8), + Pair("magenta", 7), + Pair("blue", 99), + Pair("green", 33) + }; + + m.insert(A+0, A+9); + VERIFY(m.size() == 9); + VERIFY(std::distance(m.begin(), m.end()) == 9); + + for (int i = 0; i < 9; ++i) + VERIFY(std::find(m.begin(), m.end(), A[i]) != m.end()); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/multimap_single.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/multimap_single.cc new file mode 100644 index 000000000..f4e1ab968 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/insert/multimap_single.cc @@ -0,0 +1,77 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap +// Single-element insert + +#include <string> +#include <iterator> +#include <tr1/unordered_map> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_multimap<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + Map::iterator i = m.insert(Pair("abcde", 3)); + VERIFY(m.size() == 1); + VERIFY(std::distance(m.begin(), m.end()) == 1); + VERIFY(i == m.begin()); + VERIFY(i->first == "abcde"); + VERIFY(i->second == 3); +} + +void test02() +{ + typedef std::tr1::unordered_multimap<std::string, int> Map; + typedef std::pair<const std::string, int> Pair; + + Map m; + VERIFY(m.empty()); + + m.insert(Pair("abcde", 3)); + m.insert(Pair("abcde", 7)); + + VERIFY(m.size() == 2); + VERIFY(std::distance(m.begin(), m.end()) == 2); + + Map::iterator i1 = m.begin(); + Map::iterator i2 = i1; + ++i2; + + VERIFY(i1->first == "abcde"); + VERIFY(i2->first == "abcde"); + VERIFY((i1->second == 3 && i2->second == 7) || + (i1->second == 7 && i2->second == 3)); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..0eec033ce --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2005-02-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap + +#include <string> +#include <tr1/unordered_map> + +using namespace std::tr1; +using std::string; +using std::equal_to; +using std::allocator; +using std::pair; + +template class unordered_multimap<string, float>; +template class unordered_multimap<string, int, + hash<string>, equal_to<string>, + allocator<pair<const string, int> > >; +template class unordered_multimap<string, float, + hash<string>, equal_to<string>, + allocator<char> >; +template class __unordered_multimap<string, int, + hash<string>, equal_to<string>, + allocator<pair<const string, int> >, true>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_neg.cc new file mode 100644 index 000000000..fb0db99cf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_neg.cc @@ -0,0 +1,40 @@ +// 2005-10-02 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +#include <tr1/unordered_map> + +void test01() +{ + typedef std::tr1::unordered_multimap<int, int> Mmap; + + Mmap mm; + + Mmap::const_iterator cit = mm.begin(); + (*cit).second = 0; // { dg-error "read-only" } + + Mmap::const_local_iterator clit = mm.begin(0); + (*clit).second = 0; // { dg-error "read-only" } + + Mmap::iterator it = cit; // { dg-error "conversion" } + + Mmap::local_iterator lit = clit; // { dg-error "conversion" } +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_null_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_null_neg.cc new file mode 100644 index 000000000..1709816c3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/iterator_null_neg.cc @@ -0,0 +1,28 @@ +// 2005-09-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +// libstdc++/23781 +#include <tr1/unordered_map> +#include <cstddef> + +std::tr1::unordered_multimap<int, int>::iterator it2 = NULL; // { dg-error "conversion" } +std::tr1::unordered_multimap<int, int>::const_iterator cit2 = NULL; // { dg-error "conversion" } diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/typedefs.cc new file mode 100644 index 000000000..54ae610e6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/typedefs.cc @@ -0,0 +1,46 @@ +// { dg-do compile } +// 2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> + +// Copyright (C) 2008, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap + +#include <tr1/unordered_map> + +void test01() +{ + // Check for required typedefs + typedef std::tr1::unordered_multimap<int, int> test_type; + + typedef test_type::key_type key_type; + typedef test_type::value_type value_type; + typedef test_type::mapped_type mapped_type; + typedef test_type::hasher hasher; + typedef test_type::key_equal key_equal; + typedef test_type::allocator_type allocator_type; + typedef test_type::pointer pointer; + typedef test_type::const_pointer const_pointer; + typedef test_type::reference reference; + typedef test_type::const_reference const_reference; + typedef test_type::size_type size_type; + typedef test_type::difference_type difference_type; + typedef test_type::iterator iterator; + typedef test_type::const_iterator const_iterator; + typedef test_type::local_iterator local_iterator; + typedef test_type::const_local_iterator const_local_iterator; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/swap/1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/swap/1.cc new file mode 100644 index 000000000..590e85ec8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/swap/1.cc @@ -0,0 +1,177 @@ +// 2005-12-20 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap::swap + +#include <tr1/unordered_map> +#include <map> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// uneq_allocator as a non-empty allocator. +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + using std::pair; + using std::equal_to; + using std::map; + using std::multimap; + + typedef pair<const char, int> my_pair; + typedef __gnu_test::uneq_allocator<my_pair> my_alloc; + typedef unordered_multimap<char, int, hash<char>, equal_to<char>, my_alloc> + my_ummap; + + const char title01[] = "Rivers of sand"; + const char title02[] = "Concret PH"; + const char title03[] = "Sonatas and Interludes for Prepared Piano"; + const char title04[] = "never as tired as when i'm waking up"; + + const size_t N1 = sizeof(title01); + const size_t N2 = sizeof(title02); + const size_t N3 = sizeof(title03); + const size_t N4 = sizeof(title04); + + typedef multimap<char, int> my_mmap; + my_mmap mmap01_ref; + for (size_t i = 0; i < N1; ++i) + mmap01_ref.insert(my_pair(title01[i], i)); + my_mmap mmap02_ref; + for (size_t i = 0; i < N2; ++i) + mmap02_ref.insert(my_pair(title02[i], i)); + my_mmap mmap03_ref; + for (size_t i = 0; i < N3; ++i) + mmap03_ref.insert(my_pair(title03[i], i)); + my_mmap mmap04_ref; + for (size_t i = 0; i < N4; ++i) + mmap04_ref.insert(my_pair(title04[i], i)); + + typedef map<char, int> my_map; + + my_ummap::size_type size01, size02; + + my_alloc alloc01(1); + + my_ummap ummap01(10, hash<char>(), equal_to<char>(), alloc01); + size01 = ummap01.size(); + my_ummap ummap02(10, hash<char>(), equal_to<char>(), alloc01); + size02 = ummap02.size(); + + ummap01.swap(ummap02); + VERIFY( ummap01.size() == size02 ); + VERIFY( ummap01.empty() ); + VERIFY( ummap02.size() == size01 ); + VERIFY( ummap02.empty() ); + + my_ummap ummap03(10, hash<char>(), equal_to<char>(), alloc01); + size01 = ummap03.size(); + my_ummap ummap04(mmap02_ref.begin(), mmap02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap04.size(); + + ummap03.swap(ummap04); + VERIFY( ummap03.size() == size02 ); + VERIFY( my_map(ummap03.begin(), ummap03.end()) + == my_map(mmap02_ref.begin(), mmap02_ref.end()) ); + VERIFY( ummap04.size() == size01 ); + VERIFY( ummap04.empty() ); + + my_ummap ummap05(mmap01_ref.begin(), mmap01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = ummap05.size(); + my_ummap ummap06(mmap02_ref.begin(), mmap02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap06.size(); + + ummap05.swap(ummap06); + VERIFY( ummap05.size() == size02 ); + VERIFY( my_map(ummap05.begin(), ummap05.end()) + == my_map(mmap02_ref.begin(), mmap02_ref.end()) ); + VERIFY( ummap06.size() == size01 ); + VERIFY( my_map(ummap06.begin(), ummap06.end()) + == my_map(mmap01_ref.begin(), mmap01_ref.end()) ); + + my_ummap ummap07(mmap01_ref.begin(), mmap01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = ummap07.size(); + my_ummap ummap08(mmap03_ref.begin(), mmap03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap08.size(); + + ummap07.swap(ummap08); + VERIFY( ummap07.size() == size02 ); + VERIFY( my_map(ummap07.begin(), ummap07.end()) + == my_map(mmap03_ref.begin(), mmap03_ref.end()) ); + VERIFY( ummap08.size() == size01 ); + VERIFY( my_map(ummap08.begin(), ummap08.end()) + == my_map(mmap01_ref.begin(), mmap01_ref.end()) ); + + my_ummap ummap09(mmap03_ref.begin(), mmap03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = ummap09.size(); + my_ummap ummap10(mmap04_ref.begin(), mmap04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap10.size(); + + ummap09.swap(ummap10); + VERIFY( ummap09.size() == size02 ); + VERIFY( my_map(ummap09.begin(), ummap09.end()) + == my_map(mmap04_ref.begin(), mmap04_ref.end()) ); + VERIFY( ummap10.size() == size01 ); + VERIFY( my_map(ummap10.begin(), ummap10.end()) + == my_map(mmap03_ref.begin(), mmap03_ref.end()) ); + + my_ummap ummap11(mmap04_ref.begin(), mmap04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = ummap11.size(); + my_ummap ummap12(mmap01_ref.begin(), mmap01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap12.size(); + + ummap11.swap(ummap12); + VERIFY( ummap11.size() == size02 ); + VERIFY( my_map(ummap11.begin(), ummap11.end()) + == my_map(mmap01_ref.begin(), mmap01_ref.end()) ); + VERIFY( ummap12.size() == size01 ); + VERIFY( my_map(ummap12.begin(), ummap12.end()) + == my_map(mmap04_ref.begin(), mmap04_ref.end()) ); + + my_ummap ummap13(mmap03_ref.begin(), mmap03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = ummap13.size(); + my_ummap ummap14(mmap03_ref.begin(), mmap03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap14.size(); + + ummap13.swap(ummap14); + VERIFY( ummap13.size() == size02 ); + VERIFY( my_map(ummap13.begin(), ummap13.end()) + == my_map(mmap03_ref.begin(), mmap03_ref.end()) ); + VERIFY( ummap14.size() == size01 ); + VERIFY( my_map(ummap14.begin(), ummap14.end()) + == my_map(mmap03_ref.begin(), mmap03_ref.end()) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/swap/2.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/swap/2.cc new file mode 100644 index 000000000..56528b820 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/swap/2.cc @@ -0,0 +1,206 @@ +// 2005-12-20 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.6 unordered_multimap::swap + +#include <tr1/unordered_map> +#include <map> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// uneq_allocator, two different personalities. +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + using std::pair; + using std::equal_to; + using std::map; + using std::multimap; + + typedef pair<const char, int> my_pair; + typedef __gnu_test::uneq_allocator<my_pair> my_alloc; + typedef unordered_multimap<char, int, hash<char>, equal_to<char>, my_alloc> + my_ummap; + + const char title01[] = "Rivers of sand"; + const char title02[] = "Concret PH"; + const char title03[] = "Sonatas and Interludes for Prepared Piano"; + const char title04[] = "never as tired as when i'm waking up"; + + const size_t N1 = sizeof(title01); + const size_t N2 = sizeof(title02); + const size_t N3 = sizeof(title03); + const size_t N4 = sizeof(title04); + + typedef multimap<char, int> my_mmap; + my_mmap mmap01_ref; + for (size_t i = 0; i < N1; ++i) + mmap01_ref.insert(my_pair(title01[i], i)); + my_mmap mmap02_ref; + for (size_t i = 0; i < N2; ++i) + mmap02_ref.insert(my_pair(title02[i], i)); + my_mmap mmap03_ref; + for (size_t i = 0; i < N3; ++i) + mmap03_ref.insert(my_pair(title03[i], i)); + my_mmap mmap04_ref; + for (size_t i = 0; i < N4; ++i) + mmap04_ref.insert(my_pair(title04[i], i)); + + typedef map<char, int> my_map; + + my_ummap::size_type size01, size02; + + my_alloc alloc01(1), alloc02(2); + int personality01, personality02; + + my_ummap ummap01(10, hash<char>(), equal_to<char>(), alloc01); + size01 = ummap01.size(); + personality01 = ummap01.get_allocator().get_personality(); + my_ummap ummap02(10, hash<char>(), equal_to<char>(), alloc02); + size02 = ummap02.size(); + personality02 = ummap02.get_allocator().get_personality(); + + ummap01.swap(ummap02); + VERIFY( ummap01.size() == size02 ); + VERIFY( ummap01.empty() ); + VERIFY( ummap02.size() == size01 ); + VERIFY( ummap02.empty() ); + VERIFY( ummap01.get_allocator().get_personality() == personality02 ); + VERIFY( ummap02.get_allocator().get_personality() == personality01 ); + + my_ummap ummap03(10, hash<char>(), equal_to<char>(), alloc02); + size01 = ummap03.size(); + personality01 = ummap03.get_allocator().get_personality(); + my_ummap ummap04(mmap02_ref.begin(), mmap02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap04.size(); + personality02 = ummap04.get_allocator().get_personality(); + + ummap03.swap(ummap04); + VERIFY( ummap03.size() == size02 ); + VERIFY( my_map(ummap03.begin(), ummap03.end()) + == my_map(mmap02_ref.begin(), mmap02_ref.end()) ); + VERIFY( ummap04.size() == size01 ); + VERIFY( ummap04.empty() ); + VERIFY( ummap03.get_allocator().get_personality() == personality02 ); + VERIFY( ummap04.get_allocator().get_personality() == personality01 ); + + my_ummap ummap05(mmap01_ref.begin(), mmap01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = ummap05.size(); + personality01 = ummap05.get_allocator().get_personality(); + my_ummap ummap06(mmap02_ref.begin(), mmap02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = ummap06.size(); + personality02 = ummap06.get_allocator().get_personality(); + + ummap05.swap(ummap06); + VERIFY( ummap05.size() == size02 ); + VERIFY( my_map(ummap05.begin(), ummap05.end()) + == my_map(mmap02_ref.begin(), mmap02_ref.end()) ); + VERIFY( ummap06.size() == size01 ); + VERIFY( my_map(ummap06.begin(), ummap06.end()) + == my_map(mmap01_ref.begin(), mmap01_ref.end()) ); + VERIFY( ummap05.get_allocator().get_personality() == personality02 ); + VERIFY( ummap06.get_allocator().get_personality() == personality01 ); + + my_ummap ummap07(mmap01_ref.begin(), mmap01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size01 = ummap07.size(); + personality01 = ummap07.get_allocator().get_personality(); + my_ummap ummap08(mmap03_ref.begin(), mmap03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap08.size(); + personality02 = ummap08.get_allocator().get_personality(); + + ummap07.swap(ummap08); + VERIFY( ummap07.size() == size02 ); + VERIFY( my_map(ummap07.begin(), ummap07.end()) + == my_map(mmap03_ref.begin(), mmap03_ref.end()) ); + VERIFY( ummap08.size() == size01 ); + VERIFY( my_map(ummap08.begin(), ummap08.end()) + == my_map(mmap01_ref.begin(), mmap01_ref.end()) ); + VERIFY( ummap07.get_allocator().get_personality() == personality02 ); + VERIFY( ummap08.get_allocator().get_personality() == personality01 ); + + my_ummap ummap09(mmap03_ref.begin(), mmap03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = ummap09.size(); + personality01 = ummap09.get_allocator().get_personality(); + my_ummap ummap10(mmap04_ref.begin(), mmap04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = ummap10.size(); + personality02 = ummap10.get_allocator().get_personality(); + + ummap09.swap(ummap10); + VERIFY( ummap09.size() == size02 ); + VERIFY( my_map(ummap09.begin(), ummap09.end()) + == my_map(mmap04_ref.begin(), mmap04_ref.end()) ); + VERIFY( ummap10.size() == size01 ); + VERIFY( my_map(ummap10.begin(), ummap10.end()) + == my_map(mmap03_ref.begin(), mmap03_ref.end()) ); + VERIFY( ummap09.get_allocator().get_personality() == personality02 ); + VERIFY( ummap10.get_allocator().get_personality() == personality01 ); + + my_ummap ummap11(mmap04_ref.begin(), mmap04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size01 = ummap11.size(); + personality01 = ummap11.get_allocator().get_personality(); + my_ummap ummap12(mmap01_ref.begin(), mmap01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = ummap12.size(); + personality02 = ummap12.get_allocator().get_personality(); + + ummap11.swap(ummap12); + VERIFY( ummap11.size() == size02 ); + VERIFY( my_map(ummap11.begin(), ummap11.end()) + == my_map(mmap01_ref.begin(), mmap01_ref.end()) ); + VERIFY( ummap12.size() == size01 ); + VERIFY( my_map(ummap12.begin(), ummap12.end()) + == my_map(mmap04_ref.begin(), mmap04_ref.end()) ); + VERIFY( ummap11.get_allocator().get_personality() == personality02 ); + VERIFY( ummap12.get_allocator().get_personality() == personality01 ); + + my_ummap ummap13(mmap03_ref.begin(), mmap03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = ummap13.size(); + personality01 = ummap13.get_allocator().get_personality(); + my_ummap ummap14(mmap03_ref.begin(), mmap03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = ummap14.size(); + personality02 = ummap14.get_allocator().get_personality(); + + ummap13.swap(ummap14); + VERIFY( ummap13.size() == size02 ); + VERIFY( my_map(ummap13.begin(), ummap13.end()) + == my_map(mmap03_ref.begin(), mmap03_ref.end()) ); + VERIFY( ummap14.size() == size01 ); + VERIFY( my_map(ummap14.begin(), ummap14.end()) + == my_map(mmap03_ref.begin(), mmap03_ref.end()) ); + VERIFY( ummap13.get_allocator().get_personality() == personality02 ); + VERIFY( ummap14.get_allocator().get_personality() == personality01 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/24054.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/24054.cc new file mode 100644 index 000000000..9b9572012 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/24054.cc @@ -0,0 +1,52 @@ +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3 Unordered associative containers + +#include <tr1/unordered_set> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24054 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_multiset<std::string> Set; + + Set s; + + s.insert("etaoin"); + s.insert("etaoin"); + s.insert("etaoin"); + s.insert("shrdlu"); + + VERIFY( s.erase("") == 0 ); + VERIFY( s.size() == 4 ); + + VERIFY( s.erase("etaoin") == 3 ); + VERIFY( s.size() == 1 ); + + VERIFY( s.erase("shrdlu") == 1 ); + VERIFY( s.size() == 0 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/capacity/29134-multiset.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/capacity/29134-multiset.cc new file mode 100644 index 000000000..a0b3fd85c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/capacity/29134-multiset.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 Class template unordered_multiset + +#include <tr1/unordered_set> +#include <testsuite_hooks.h> + +// libstdc++/29134 +void test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::unordered_multiset<int> ums; + + VERIFY( (ums.max_size() == std::allocator<std::tr1::__detail::_Hash_node< + int, false> >().max_size()) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/erase/1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/erase/1.cc new file mode 100644 index 000000000..5f7ec8930 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/erase/1.cc @@ -0,0 +1,129 @@ +// 2007-02-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 Class template unordered_multiset + +#include <tr1/unordered_set> +#include <string> +#include <testsuite_hooks.h> + +// In the occasion of libstdc++/25896 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_multiset<std::string> Mset; + typedef Mset::iterator iterator; + typedef Mset::const_iterator const_iterator; + + Mset ms1; + + ms1.insert("because to why"); + ms1.insert("the stockholm syndrome"); + ms1.insert("a cereous night"); + ms1.insert("eeilo"); + ms1.insert("protean"); + ms1.insert("the way you are when"); + ms1.insert("tillsammans"); + ms1.insert("umbra/penumbra"); + ms1.insert("belonging (no longer mix)"); + ms1.insert("one line behind"); + VERIFY( ms1.size() == 10 ); + + VERIFY( ms1.erase("eeilo") == 1 ); + VERIFY( ms1.size() == 9 ); + iterator it1 = ms1.find("eeilo"); + VERIFY( it1 == ms1.end() ); + + VERIFY( ms1.erase("tillsammans") == 1 ); + VERIFY( ms1.size() == 8 ); + iterator it2 = ms1.find("tillsammans"); + VERIFY( it2 == ms1.end() ); + + // Must work (see DR 526) + iterator it3 = ms1.find("belonging (no longer mix)"); + VERIFY( it3 != ms1.end() ); + VERIFY( ms1.erase(*it3) == 1 ); + VERIFY( ms1.size() == 7 ); + it3 = ms1.find("belonging (no longer mix)"); + VERIFY( it3 == ms1.end() ); + + VERIFY( !ms1.erase("abra") ); + VERIFY( ms1.size() == 7 ); + + VERIFY( !ms1.erase("eeilo") ); + VERIFY( ms1.size() == 7 ); + + VERIFY( ms1.erase("because to why") == 1 ); + VERIFY( ms1.size() == 6 ); + iterator it4 = ms1.find("because to why"); + VERIFY( it4 == ms1.end() ); + + iterator it5 = ms1.find("umbra/penumbra"); + iterator it6 = ms1.find("one line behind"); + VERIFY( it5 != ms1.end() ); + VERIFY( it6 != ms1.end() ); + + VERIFY( ms1.find("the stockholm syndrome") != ms1.end() ); + VERIFY( ms1.find("a cereous night") != ms1.end() ); + VERIFY( ms1.find("the way you are when") != ms1.end() ); + VERIFY( ms1.find("a cereous night") != ms1.end() ); + + VERIFY( ms1.erase(*it5) == 1 ); + VERIFY( ms1.size() == 5 ); + it5 = ms1.find("umbra/penumbra"); + VERIFY( it5 == ms1.end() ); + + VERIFY( ms1.erase(*it6) == 1 ); + VERIFY( ms1.size() == 4 ); + it6 = ms1.find("one line behind"); + VERIFY( it6 == ms1.end() ); + + iterator it7 = ms1.begin(); + iterator it8 = it7; + ++it8; + iterator it9 = it8; + ++it9; + + VERIFY( ms1.erase(*it8) == 1 ); + VERIFY( ms1.size() == 3 ); + VERIFY( ++it7 == it9 ); + + iterator it10 = it9; + ++it10; + iterator it11 = it10; + + VERIFY( ms1.erase(*it9) == 1 ); + VERIFY( ms1.size() == 2 ); + VERIFY( ++it10 == ms1.end() ); + + VERIFY( ms1.erase(ms1.begin()) != ms1.end() ); + VERIFY( ms1.size() == 1 ); + VERIFY( ms1.begin() == it11 ); + + VERIFY( ms1.erase(*ms1.begin()) == 1 ); + VERIFY( ms1.size() == 0 ); + VERIFY( ms1.begin() == ms1.end() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/erase/24061-multiset.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/erase/24061-multiset.cc new file mode 100644 index 000000000..625ed4eb3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/erase/24061-multiset.cc @@ -0,0 +1,107 @@ +// 2005-10-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 Class template unordered_multiset + +#include <tr1/unordered_set> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_multiset<std::string> Mset; + typedef Mset::iterator iterator; + typedef Mset::const_iterator const_iterator; + + Mset ms1; + + ms1.insert("all the love in the world"); + ms1.insert("you know what you are?"); + ms1.insert("the collector"); + ms1.insert("the hand that feeds"); + ms1.insert("love is not enough"); + ms1.insert("every day is exactly the same"); + ms1.insert("with teeth"); + ms1.insert("only"); + ms1.insert("getting smaller"); + ms1.insert("sunspots"); + + ms1.insert("the hand that feeds"); + ms1.insert("love is not enough"); + ms1.insert("every day is exactly the same"); + VERIFY( ms1.size() == 13 ); + + iterator it1 = ms1.begin(); + ++it1; + iterator it2 = it1; + ++it2; + iterator it3 = ms1.erase(it1); + VERIFY( ms1.size() == 12 ); + VERIFY( it3 == it2 ); + VERIFY( *it3 == *it2 ); + + iterator it4 = ms1.begin(); + ++it4; + ++it4; + ++it4; + iterator it5 = it4; + ++it5; + ++it5; + iterator it6 = ms1.erase(it4, it5); + VERIFY( ms1.size() == 10 ); + VERIFY( it6 == it5 ); + VERIFY( *it6 == *it5 ); + + const_iterator it7 = ms1.begin(); + ++it7; + ++it7; + ++it7; + const_iterator it8 = it7; + ++it8; + const_iterator it9 = ms1.erase(it7); + VERIFY( ms1.size() == 9 ); + VERIFY( it9 == it8 ); + VERIFY( *it9 == *it8 ); + + const_iterator it10 = ms1.begin(); + ++it10; + const_iterator it11 = it10; + ++it11; + ++it11; + ++it11; + ++it11; + const_iterator it12 = ms1.erase(it10, it11); + VERIFY( ms1.size() == 5 ); + VERIFY( it12 == it11 ); + VERIFY( *it12 == *it11 ); + + iterator it13 = ms1.erase(ms1.begin(), ms1.end()); + VERIFY( ms1.size() == 0 ); + VERIFY( it13 == ms1.end() ); + VERIFY( it13 == ms1.begin() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/find/multiset1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/find/multiset1.cc new file mode 100644 index 000000000..848cce3f3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/find/multiset1.cc @@ -0,0 +1,66 @@ +// { dg-do run } + +// 2005-2-18 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 unordered_set +// find, equal_range, count + +#include <string> +#include <iterator> +#include <algorithm> +#include <tr1/unordered_set> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_multiset<std::string> Set; + Set s; + VERIFY(s.empty()); + + s.insert("grape"); + s.insert("banana"); + s.insert("grape"); + + Set::iterator i2 = s.find("banana"); + VERIFY(i2 != s.end()); + VERIFY(*i2 == "banana"); + + std::pair<Set::iterator, Set::iterator> p = s.equal_range("grape"); + VERIFY(std::distance(p.first, p.second) == 2); + Set::iterator i3 = p.first; + ++i3; + VERIFY(*p.first == "grape"); + VERIFY(*i3 == "grape"); + + Set::iterator i4 = s.find("lime"); + VERIFY(i4 == s.end()); + + VERIFY(s.count("grape") == 2); + VERIFY(s.count("banana") == 1); + VERIFY(s.count("lime") == 0); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/24061-multiset.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/24061-multiset.cc new file mode 100644 index 000000000..496126754 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/24061-multiset.cc @@ -0,0 +1,57 @@ +// 2005-10-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 Class template unordered_multiset + +#include <tr1/unordered_set> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_multiset<std::string> Mset; + typedef Mset::iterator iterator; + typedef Mset::const_iterator const_iterator; + + Mset ms1; + + iterator it1 = ms1.insert(ms1.begin(), "all the love in the world"); + VERIFY( ms1.size() == 1 ); + VERIFY( *it1 == "all the love in the world" ); + + const_iterator cit1(it1); + const_iterator cit2 = ms1.insert(cit1, "you know what you are?"); + VERIFY( ms1.size() == 2 ); + VERIFY( cit2 != cit1 ); + VERIFY( *cit2 == "you know what you are?" ); + + iterator it2 = ms1.insert(it1, "all the love in the world"); + VERIFY( ms1.size() == 3 ); + VERIFY( it2 != it1 ); + VERIFY( *it2 == "all the love in the world" ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/multiset_range.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/multiset_range.cc new file mode 100644 index 000000000..512b4a0bf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/multiset_range.cc @@ -0,0 +1,80 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 unordered_multiset +// range insert + +#include <string> +#include <iterator> +#include <algorithm> +#include <tr1/unordered_set> +#include <testsuite_hooks.h> + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_multiset<std::string> Set; + Set s; + VERIFY(s.empty()); + + const int N = 10; + const std::string A[N] = { "red", "green", "blue", "violet", "cyan", + "magenta", "yellow", "orange", "pink", "gray" }; + + s.insert(A+0, A+N); + VERIFY(s.size() == static_cast<unsigned int>(N)); + VERIFY(std::distance(s.begin(), s.end()) == N); + + for (int i = 0; i < N; ++i) { + std::string str = A[i]; + Set::iterator it = std::find(s.begin(), s.end(), str); + VERIFY(it != s.end()); + } +} + +void test02() +{ + typedef std::tr1::unordered_multiset<int> Set; + Set s; + VERIFY(s.empty()); + + const int N = 8; + const int A[N] = { 3, 7, 4, 8, 2, 4, 6, 7 }; + + s.insert(A+0, A+N); + VERIFY(s.size() == static_cast<unsigned int>(N)); + VERIFY(std::distance(s.begin(), s.end()) == N); + + VERIFY(std::count(s.begin(), s.end(), 2) == 1); + VERIFY(std::count(s.begin(), s.end(), 3) == 1); + VERIFY(std::count(s.begin(), s.end(), 4) == 2); + VERIFY(std::count(s.begin(), s.end(), 6) == 1); + VERIFY(std::count(s.begin(), s.end(), 7) == 2); + VERIFY(std::count(s.begin(), s.end(), 8) == 1); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/multiset_single.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/multiset_single.cc new file mode 100644 index 000000000..aa70459c7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/insert/multiset_single.cc @@ -0,0 +1,68 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 unordered_multiset +// Single-element insert + +#include <string> +#include <iterator> +#include <tr1/unordered_set> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_multiset<std::string> Set; + Set s; + VERIFY(s.empty()); + + Set::iterator i = s.insert("abcde"); + VERIFY(s.size() == 1); + VERIFY(std::distance(s.begin(), s.end()) == 1); + VERIFY(i == s.begin()); + VERIFY(*i == "abcde"); +} + +void test02() +{ + typedef std::tr1::unordered_multiset<std::string> Set; + Set s; + VERIFY(s.empty()); + + s.insert("abcde"); + Set::iterator i = s.insert("abcde"); + VERIFY(s.size() == 2); + VERIFY(std::distance(s.begin(), s.end()) == 2); + VERIFY(*i == "abcde"); + + Set::iterator i2 = s.begin(); + ++i2; + VERIFY(i == s.begin() || i == i2); + VERIFY(*(s.begin()) == "abcde" && *i2 == "abcde"); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..cb22c632e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/explicit_instantiation.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2005-02-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 unordered_multiset + +#include <tr1/unordered_set> + +using namespace std::tr1; +using std::equal_to; +using std::allocator; + +template class unordered_multiset<int>; +template class unordered_multiset<float, hash<float>, equal_to<float>, + allocator<float> >; +template class unordered_multiset<int, hash<int>, equal_to<int>, + allocator<char> >; +template class __unordered_multiset<float, hash<float>, equal_to<float>, + allocator<float>, true>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/iterator_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/iterator_neg.cc new file mode 100644 index 000000000..f73ca5bbf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/iterator_neg.cc @@ -0,0 +1,36 @@ +// 2005-10-02 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +#include <tr1/unordered_set> + +void test01() +{ + typedef std::tr1::unordered_multiset<int> Mset; + + Mset ms; + + Mset::const_iterator cit = ms.begin(); + *cit = 0; // { dg-error "read-only" } + + Mset::const_local_iterator clit = ms.begin(0); + *clit = 0; // { dg-error "read-only" } +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/iterator_null_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/iterator_null_neg.cc new file mode 100644 index 000000000..2201b2d29 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/iterator_null_neg.cc @@ -0,0 +1,28 @@ +// 2005-09-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +// libstdc++/23781 +#include <tr1/unordered_set> +#include <cstddef> + +std::tr1::unordered_multiset<int>::iterator it3 = NULL; // { dg-error "conversion" } +std::tr1::unordered_multiset<int>::const_iterator cit3 = NULL; // { dg-error "conversion" } diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/typedefs.cc new file mode 100644 index 000000000..36cc16dc3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/typedefs.cc @@ -0,0 +1,45 @@ +// { dg-do compile } +// 2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> + +// Copyright (C) 2008, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 unordered_multiset + +#include <tr1/unordered_set> + +void test01() +{ + // Check for required typedefs + typedef std::tr1::unordered_multiset<int> test_type; + + typedef test_type::key_type key_type; + typedef test_type::value_type value_type; + typedef test_type::hasher hasher; + typedef test_type::key_equal key_equal; + typedef test_type::allocator_type allocator_type; + typedef test_type::pointer pointer; + typedef test_type::const_pointer const_pointer; + typedef test_type::reference reference; + typedef test_type::const_reference const_reference; + typedef test_type::size_type size_type; + typedef test_type::difference_type difference_type; + typedef test_type::iterator iterator; + typedef test_type::const_iterator const_iterator; + typedef test_type::local_iterator local_iterator; + typedef test_type::const_local_iterator const_local_iterator; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/swap/1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/swap/1.cc new file mode 100644 index 000000000..c164be4ff --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/swap/1.cc @@ -0,0 +1,153 @@ +// 2005-12-20 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 unordered_multiset::swap + +#include <tr1/unordered_set> +#include <set> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// uneq_allocator as a non-empty allocator. +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + using std::equal_to; + using std::multiset; + + typedef __gnu_test::uneq_allocator<char> my_alloc; + typedef unordered_multiset<char, hash<char>, equal_to<char>, my_alloc> + my_umset; + + const char title01[] = "Rivers of sand"; + const char title02[] = "Concret PH"; + const char title03[] = "Sonatas and Interludes for Prepared Piano"; + const char title04[] = "never as tired as when i'm waking up"; + + const size_t N1 = sizeof(title01); + const size_t N2 = sizeof(title02); + const size_t N3 = sizeof(title03); + const size_t N4 = sizeof(title04); + + typedef multiset<char> my_mset; + const my_mset mset01_ref(title01, title01 + N1); + const my_mset mset02_ref(title02, title02 + N2); + const my_mset mset03_ref(title03, title03 + N3); + const my_mset mset04_ref(title04, title04 + N4); + + my_umset::size_type size01, size02; + + my_alloc alloc01(1); + + my_umset umset01(10, hash<char>(), equal_to<char>(), alloc01); + size01 = umset01.size(); + my_umset umset02(10, hash<char>(), equal_to<char>(), alloc01); + size02 = umset02.size(); + + umset01.swap(umset02); + VERIFY( umset01.size() == size02 ); + VERIFY( umset01.empty() ); + VERIFY( umset02.size() == size01 ); + VERIFY( umset02.empty() ); + + my_umset umset03(10, hash<char>(), equal_to<char>(), alloc01); + size01 = umset03.size(); + my_umset umset04(mset02_ref.begin(), mset02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset04.size(); + + umset03.swap(umset04); + VERIFY( umset03.size() == size02 ); + VERIFY( my_mset(umset03.begin(), umset03.end()) == mset02_ref ); + VERIFY( umset04.size() == size01 ); + VERIFY( umset04.empty() ); + + my_umset umset05(mset01_ref.begin(), mset01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umset05.size(); + my_umset umset06(mset02_ref.begin(), mset02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset06.size(); + + umset05.swap(umset06); + VERIFY( umset05.size() == size02 ); + VERIFY( my_mset(umset05.begin(), umset05.end()) == mset02_ref ); + VERIFY( umset06.size() == size01 ); + VERIFY( my_mset(umset06.begin(), umset06.end()) == mset01_ref ); + + my_umset umset07(mset01_ref.begin(), mset01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umset07.size(); + my_umset umset08(mset03_ref.begin(), mset03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset08.size(); + + umset07.swap(umset08); + VERIFY( umset07.size() == size02 ); + VERIFY( my_mset(umset07.begin(), umset07.end()) == mset03_ref ); + VERIFY( umset08.size() == size01 ); + VERIFY( my_mset(umset08.begin(), umset08.end()) == mset01_ref ); + + my_umset umset09(mset03_ref.begin(), mset03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umset09.size(); + my_umset umset10(mset04_ref.begin(), mset04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset10.size(); + + umset09.swap(umset10); + VERIFY( umset09.size() == size02 ); + VERIFY( my_mset(umset09.begin(), umset09.end()) == mset04_ref ); + VERIFY( umset10.size() == size01 ); + VERIFY( my_mset(umset10.begin(), umset10.end()) == mset03_ref ); + + my_umset umset11(mset04_ref.begin(), mset04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umset11.size(); + my_umset umset12(mset01_ref.begin(), mset01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset12.size(); + + umset11.swap(umset12); + VERIFY( umset11.size() == size02 ); + VERIFY( my_mset(umset11.begin(), umset11.end()) == mset01_ref ); + VERIFY( umset12.size() == size01 ); + VERIFY( my_mset(umset12.begin(), umset12.end()) == mset04_ref ); + + my_umset umset13(mset03_ref.begin(), mset03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umset13.size(); + my_umset umset14(mset03_ref.begin(), mset03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset14.size(); + + umset13.swap(umset14); + VERIFY( umset13.size() == size02 ); + VERIFY( my_mset(umset13.begin(), umset13.end()) == mset03_ref ); + VERIFY( umset14.size() == size01 ); + VERIFY( my_mset(umset14.begin(), umset14.end()) == mset03_ref ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/swap/2.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/swap/2.cc new file mode 100644 index 000000000..a4328f919 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/swap/2.cc @@ -0,0 +1,182 @@ +// 2005-12-20 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.5 unordered_multiset::swap + +#include <tr1/unordered_set> +#include <set> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// uneq_allocator, two different personalities. +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + using std::equal_to; + using std::multiset; + + typedef __gnu_test::uneq_allocator<char> my_alloc; + typedef unordered_multiset<char, hash<char>, equal_to<char>, my_alloc> + my_umset; + + const char title01[] = "Rivers of sand"; + const char title02[] = "Concret PH"; + const char title03[] = "Sonatas and Interludes for Prepared Piano"; + const char title04[] = "never as tired as when i'm waking up"; + + const size_t N1 = sizeof(title01); + const size_t N2 = sizeof(title02); + const size_t N3 = sizeof(title03); + const size_t N4 = sizeof(title04); + + typedef multiset<char> my_mset; + const my_mset mset01_ref(title01, title01 + N1); + const my_mset mset02_ref(title02, title02 + N2); + const my_mset mset03_ref(title03, title03 + N3); + const my_mset mset04_ref(title04, title04 + N4); + + my_umset::size_type size01, size02; + + my_alloc alloc01(1), alloc02(2); + int personality01, personality02; + + my_umset umset01(10, hash<char>(), equal_to<char>(), alloc01); + size01 = umset01.size(); + personality01 = umset01.get_allocator().get_personality(); + my_umset umset02(10, hash<char>(), equal_to<char>(), alloc02); + size02 = umset02.size(); + personality02 = umset02.get_allocator().get_personality(); + + umset01.swap(umset02); + VERIFY( umset01.size() == size02 ); + VERIFY( umset01.empty() ); + VERIFY( umset02.size() == size01 ); + VERIFY( umset02.empty() ); + VERIFY( umset01.get_allocator().get_personality() == personality02 ); + VERIFY( umset02.get_allocator().get_personality() == personality01 ); + + my_umset umset03(10, hash<char>(), equal_to<char>(), alloc02); + size01 = umset03.size(); + personality01 = umset03.get_allocator().get_personality(); + my_umset umset04(mset02_ref.begin(), mset02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset04.size(); + personality02 = umset04.get_allocator().get_personality(); + + umset03.swap(umset04); + VERIFY( umset03.size() == size02 ); + VERIFY( my_mset(umset03.begin(), umset03.end()) == mset02_ref ); + VERIFY( umset04.size() == size01 ); + VERIFY( umset04.empty() ); + VERIFY( umset03.get_allocator().get_personality() == personality02 ); + VERIFY( umset04.get_allocator().get_personality() == personality01 ); + + my_umset umset05(mset01_ref.begin(), mset01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umset05.size(); + personality01 = umset05.get_allocator().get_personality(); + my_umset umset06(mset02_ref.begin(), mset02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = umset06.size(); + personality02 = umset06.get_allocator().get_personality(); + + umset05.swap(umset06); + VERIFY( umset05.size() == size02 ); + VERIFY( my_mset(umset05.begin(), umset05.end()) == mset02_ref ); + VERIFY( umset06.size() == size01 ); + VERIFY( my_mset(umset06.begin(), umset06.end()) == mset01_ref ); + VERIFY( umset05.get_allocator().get_personality() == personality02 ); + VERIFY( umset06.get_allocator().get_personality() == personality01 ); + + my_umset umset07(mset01_ref.begin(), mset01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size01 = umset07.size(); + personality01 = umset07.get_allocator().get_personality(); + my_umset umset08(mset03_ref.begin(), mset03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset08.size(); + personality02 = umset08.get_allocator().get_personality(); + + umset07.swap(umset08); + VERIFY( umset07.size() == size02 ); + VERIFY( my_mset(umset07.begin(), umset07.end()) == mset03_ref ); + VERIFY( umset08.size() == size01 ); + VERIFY( my_mset(umset08.begin(), umset08.end()) == mset01_ref ); + VERIFY( umset07.get_allocator().get_personality() == personality02 ); + VERIFY( umset08.get_allocator().get_personality() == personality01 ); + + my_umset umset09(mset03_ref.begin(), mset03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umset09.size(); + personality01 = umset09.get_allocator().get_personality(); + my_umset umset10(mset04_ref.begin(), mset04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = umset10.size(); + personality02 = umset10.get_allocator().get_personality(); + + umset09.swap(umset10); + VERIFY( umset09.size() == size02 ); + VERIFY( my_mset(umset09.begin(), umset09.end()) == mset04_ref ); + VERIFY( umset10.size() == size01 ); + VERIFY( my_mset(umset10.begin(), umset10.end()) == mset03_ref ); + VERIFY( umset09.get_allocator().get_personality() == personality02 ); + VERIFY( umset10.get_allocator().get_personality() == personality01 ); + + my_umset umset11(mset04_ref.begin(), mset04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size01 = umset11.size(); + personality01 = umset11.get_allocator().get_personality(); + my_umset umset12(mset01_ref.begin(), mset01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = umset12.size(); + personality02 = umset12.get_allocator().get_personality(); + + umset11.swap(umset12); + VERIFY( umset11.size() == size02 ); + VERIFY( my_mset(umset11.begin(), umset11.end()) == mset01_ref ); + VERIFY( umset12.size() == size01 ); + VERIFY( my_mset(umset12.begin(), umset12.end()) == mset04_ref ); + VERIFY( umset11.get_allocator().get_personality() == personality02 ); + VERIFY( umset12.get_allocator().get_personality() == personality01 ); + + my_umset umset13(mset03_ref.begin(), mset03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = umset13.size(); + personality01 = umset13.get_allocator().get_personality(); + my_umset umset14(mset03_ref.begin(), mset03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = umset14.size(); + personality02 = umset14.get_allocator().get_personality(); + + umset13.swap(umset14); + VERIFY( umset13.size() == size02 ); + VERIFY( my_mset(umset13.begin(), umset13.end()) == mset03_ref ); + VERIFY( umset14.size() == size01 ); + VERIFY( my_mset(umset14.begin(), umset14.end()) == mset03_ref ); + VERIFY( umset13.get_allocator().get_personality() == personality02 ); + VERIFY( umset14.get_allocator().get_personality() == personality01 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/23053.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/23053.cc new file mode 100644 index 000000000..b828c2799 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/23053.cc @@ -0,0 +1,38 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3 Unordered associative containers + +#include <tr1/unordered_set> + +// libstdc++/23053 +void test01() +{ + std::tr1::unordered_set<int> s; + + const std::tr1::unordered_set<int> &s_ref = s; + + s_ref.find(27); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/23465.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/23465.cc new file mode 100644 index 000000000..19bc2ff5b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/23465.cc @@ -0,0 +1,63 @@ +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3 Unordered associative containers + +#include <tr1/unordered_set> +#include <testsuite_hooks.h> + +// libstdc++/23465 +void test01() +{ + bool test __attribute__((unused)) = true; + + for (float lf = 0.1; lf < 101.0; lf *= 10.0) + for (int size = 1; size <= 6561; size *= 3) + { + std::tr1::unordered_set<int> us1, us2; + typedef std::tr1::unordered_set<int>::local_iterator local_iterator; + typedef std::tr1::unordered_set<int>::size_type size_type; + + us1.max_load_factor(lf); + + for (int i = 0; i < size; ++i) + us1.insert(i); + + us2 = us1; + + VERIFY( us2.size() == us1.size() ); + VERIFY( us2.bucket_count() == us1.bucket_count() ); + + for (size_type b = 0; b < us1.bucket_count(); ++b) + { + size_type cnt = 0; + for (local_iterator it1 = us1.begin(b), it2 = us2.begin(b); + it1 != us1.end(b) && it2 != us2.end(b); ++it1, ++it2) + { + VERIFY( *it1 == *it2 ); + ++cnt; + } + VERIFY( cnt == us1.bucket_size(b) ); + } + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/26127.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/26127.cc new file mode 100644 index 000000000..435418608 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/26127.cc @@ -0,0 +1,38 @@ +// { dg-do compile } + +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3 Unordered associative containers + +#include <tr1/unordered_set> + +// libstdc++/26127 +void test01() +{ + std::tr1::unordered_set<int> s; + + s.bucket(42); + s.key_eq(); + s.max_load_factor(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/26132.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/26132.cc new file mode 100644 index 000000000..8fd846410 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/26132.cc @@ -0,0 +1,57 @@ +// 2006-02-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3 Unordered associative containers + +#include <tr1/unordered_set> +#include <testsuite_hooks.h> + +// libstdc++/26132 +void test01() +{ + bool test __attribute__((unused)) = true; + + for (float lf = 1.0; lf < 101.0; lf *= 10.0) + for (int size = 1; size <= 6561; size *= 3) + { + std::tr1::unordered_set<int> us1; + typedef std::tr1::unordered_set<int>::size_type size_type; + + us1.max_load_factor(10.0); + + for (int i = 0; i < size; ++i) + us1.insert(i); + + us1.max_load_factor(lf); + + for (int i = 1; i <= 6561; i *= 81) + { + const size_type n = size * 81 / i; + us1.rehash(n); + VERIFY( us1.bucket_count() > us1.size() / us1.max_load_factor() ); + VERIFY( us1.bucket_count() >= n ); + } + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/capacity/29134-set.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/capacity/29134-set.cc new file mode 100644 index 000000000..63abcd41e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/capacity/29134-set.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 Class template unordered_set + +#include <tr1/unordered_set> +#include <testsuite_hooks.h> + +// libstdc++/29134 +void test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::unordered_set<int> us; + + VERIFY( (us.max_size() == std::allocator<std::tr1::__detail::_Hash_node< + int, false> >().max_size()) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/erase/1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/erase/1.cc new file mode 100644 index 000000000..5eebef314 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/erase/1.cc @@ -0,0 +1,129 @@ +// 2007-02-22 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 Class template unordered_set + +#include <tr1/unordered_set> +#include <string> +#include <testsuite_hooks.h> + +// In the occasion of libstdc++/25896 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_set<std::string> Set; + typedef Set::iterator iterator; + typedef Set::const_iterator const_iterator; + + Set s1; + + s1.insert("because to why"); + s1.insert("the stockholm syndrome"); + s1.insert("a cereous night"); + s1.insert("eeilo"); + s1.insert("protean"); + s1.insert("the way you are when"); + s1.insert("tillsammans"); + s1.insert("umbra/penumbra"); + s1.insert("belonging (no longer mix)"); + s1.insert("one line behind"); + VERIFY( s1.size() == 10 ); + + VERIFY( s1.erase("eeilo") == 1 ); + VERIFY( s1.size() == 9 ); + iterator it1 = s1.find("eeilo"); + VERIFY( it1 == s1.end() ); + + VERIFY( s1.erase("tillsammans") == 1 ); + VERIFY( s1.size() == 8 ); + iterator it2 = s1.find("tillsammans"); + VERIFY( it2 == s1.end() ); + + // Must work (see DR 526) + iterator it3 = s1.find("belonging (no longer mix)"); + VERIFY( it3 != s1.end() ); + VERIFY( s1.erase(*it3) == 1 ); + VERIFY( s1.size() == 7 ); + it3 = s1.find("belonging (no longer mix)"); + VERIFY( it3 == s1.end() ); + + VERIFY( !s1.erase("abra") ); + VERIFY( s1.size() == 7 ); + + VERIFY( !s1.erase("eeilo") ); + VERIFY( s1.size() == 7 ); + + VERIFY( s1.erase("because to why") == 1 ); + VERIFY( s1.size() == 6 ); + iterator it4 = s1.find("because to why"); + VERIFY( it4 == s1.end() ); + + iterator it5 = s1.find("umbra/penumbra"); + iterator it6 = s1.find("one line behind"); + VERIFY( it5 != s1.end() ); + VERIFY( it6 != s1.end() ); + + VERIFY( s1.find("the stockholm syndrome") != s1.end() ); + VERIFY( s1.find("a cereous night") != s1.end() ); + VERIFY( s1.find("the way you are when") != s1.end() ); + VERIFY( s1.find("a cereous night") != s1.end() ); + + VERIFY( s1.erase(*it5) == 1 ); + VERIFY( s1.size() == 5 ); + it5 = s1.find("umbra/penumbra"); + VERIFY( it5 == s1.end() ); + + VERIFY( s1.erase(*it6) == 1 ); + VERIFY( s1.size() == 4 ); + it6 = s1.find("one line behind"); + VERIFY( it6 == s1.end() ); + + iterator it7 = s1.begin(); + iterator it8 = it7; + ++it8; + iterator it9 = it8; + ++it9; + + VERIFY( s1.erase(*it8) == 1 ); + VERIFY( s1.size() == 3 ); + VERIFY( ++it7 == it9 ); + + iterator it10 = it9; + ++it10; + iterator it11 = it10; + + VERIFY( s1.erase(*it9) == 1 ); + VERIFY( s1.size() == 2 ); + VERIFY( ++it10 == s1.end() ); + + VERIFY( s1.erase(s1.begin()) != s1.end() ); + VERIFY( s1.size() == 1 ); + VERIFY( s1.begin() == it11 ); + + VERIFY( s1.erase(*s1.begin()) == 1 ); + VERIFY( s1.size() == 0 ); + VERIFY( s1.begin() == s1.end() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/erase/24061-set.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/erase/24061-set.cc new file mode 100644 index 000000000..8ff3cad55 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/erase/24061-set.cc @@ -0,0 +1,104 @@ +// 2005-10-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 Class template unordered_set + +#include <tr1/unordered_set> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_set<std::string> Set; + typedef Set::iterator iterator; + typedef Set::const_iterator const_iterator; + + Set s1; + + s1.insert("all the love in the world"); + s1.insert("you know what you are?"); + s1.insert("the collector"); + s1.insert("the hand that feeds"); + s1.insert("love is not enough"); + s1.insert("every day is exactly the same"); + s1.insert("with teeth"); + s1.insert("only"); + s1.insert("getting smaller"); + s1.insert("sunspots"); + VERIFY( s1.size() == 10 ); + + iterator it1 = s1.begin(); + ++it1; + iterator it2 = it1; + ++it2; + iterator it3 = s1.erase(it1); + VERIFY( s1.size() == 9 ); + VERIFY( it3 == it2 ); + VERIFY( *it3 == *it2 ); + + iterator it4 = s1.begin(); + ++it4; + ++it4; + ++it4; + iterator it5 = it4; + ++it5; + ++it5; + iterator it6 = s1.erase(it4, it5); + VERIFY( s1.size() == 7 ); + VERIFY( it6 == it5 ); + VERIFY( *it6 == *it5 ); + + const_iterator it7 = s1.begin(); + ++it7; + ++it7; + ++it7; + const_iterator it8 = it7; + ++it8; + const_iterator it9 = s1.erase(it7); + VERIFY( s1.size() == 6 ); + VERIFY( it9 == it8 ); + VERIFY( *it9 == *it8 ); + + const_iterator it10 = s1.begin(); + ++it10; + const_iterator it11 = it10; + ++it11; + ++it11; + ++it11; + ++it11; + const_iterator it12 = s1.erase(it10, it11); + VERIFY( s1.size() == 2 ); + VERIFY( it12 == it11 ); + VERIFY( *it12 == *it11 ); + VERIFY( ++it12 == s1.end() ); + + iterator it13 = s1.erase(s1.begin(), s1.end()); + VERIFY( s1.size() == 0 ); + VERIFY( it13 == s1.end() ); + VERIFY( it13 == s1.begin() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/find/set1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/find/set1.cc new file mode 100644 index 000000000..67dd20546 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/find/set1.cc @@ -0,0 +1,65 @@ +// { dg-do run } + +// 2005-2-18 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 unordered_set +// find, equal_range, count + +#include <string> +#include <iterator> +#include <algorithm> +#include <tr1/unordered_set> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_set<std::string> Set; + Set s; + VERIFY(s.empty()); + + std::pair<Set::iterator, bool> tmp = s.insert("grape"); + Set::iterator i = tmp.first; + + Set::iterator i2 = s.find("grape"); + VERIFY(i2 != s.end()); + VERIFY(i2 == i); + VERIFY(*i2 == "grape"); + + std::pair<Set::iterator, Set::iterator> p = s.equal_range("grape"); + VERIFY(p.first == i2); + VERIFY(std::distance(p.first, p.second) == 1); + + Set::iterator i3 = s.find("lime"); + VERIFY(i3 == s.end()); + + std::pair<Set::iterator, Set::iterator> p2 = s.equal_range("lime"); + VERIFY(p2.first == p2.second); + + VERIFY(s.count("grape") == 1); + VERIFY(s.count("lime") == 0); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/24061-set.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/24061-set.cc new file mode 100644 index 000000000..f5cb09938 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/24061-set.cc @@ -0,0 +1,57 @@ +// 2005-10-08 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 Class template unordered_set + +#include <tr1/unordered_set> +#include <string> +#include <testsuite_hooks.h> + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::tr1::unordered_set<std::string> Set; + typedef Set::iterator iterator; + typedef Set::const_iterator const_iterator; + + Set s1; + + iterator it1 = s1.insert(s1.begin(), "all the love in the world"); + VERIFY( s1.size() == 1 ); + VERIFY( *it1 == "all the love in the world" ); + + const_iterator cit1(it1); + const_iterator cit2 = s1.insert(cit1, "you know what you are?"); + VERIFY( s1.size() == 2 ); + VERIFY( cit2 != cit1 ); + VERIFY( *cit2 == "you know what you are?" ); + + iterator it2 = s1.insert(it1, "all the love in the world"); + VERIFY( s1.size() == 2 ); + VERIFY( it2 == it1 ); + VERIFY( *it2 == "all the love in the world" ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/set_range.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/set_range.cc new file mode 100644 index 000000000..9d7bcbf8a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/set_range.cc @@ -0,0 +1,80 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 unordered_set +// range insert + +#include <string> +#include <iterator> +#include <algorithm> +#include <tr1/unordered_set> +#include <testsuite_hooks.h> + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_set<std::string> Set; + Set s; + VERIFY(s.empty()); + + const int N = 10; + const std::string A[N] = { "red", "green", "blue", "violet", "cyan", + "magenta", "yellow", "orange", "pink", "gray" }; + + s.insert(A+0, A+N); + VERIFY(s.size() == static_cast<unsigned int>(N)); + VERIFY(std::distance(s.begin(), s.end()) == N); + + for (int i = 0; i < N; ++i) { + std::string str = A[i]; + Set::iterator it = std::find(s.begin(), s.end(), str); + VERIFY(it != s.end()); + } +} + +void test02() +{ + typedef std::tr1::unordered_set<int> Set; + Set s; + VERIFY(s.empty()); + + const int N = 8; + const int A[N] = { 3, 7, 4, 8, 2, 4, 6, 7 }; + + s.insert(A+0, A+N); + VERIFY(s.size() == 6); + VERIFY(std::distance(s.begin(), s.end()) == 6); + + VERIFY(std::count(s.begin(), s.end(), 2) == 1); + VERIFY(std::count(s.begin(), s.end(), 3) == 1); + VERIFY(std::count(s.begin(), s.end(), 4) == 1); + VERIFY(std::count(s.begin(), s.end(), 6) == 1); + VERIFY(std::count(s.begin(), s.end(), 7) == 1); + VERIFY(std::count(s.begin(), s.end(), 8) == 1); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/set_single.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/set_single.cc new file mode 100644 index 000000000..d298b9e7a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/insert/set_single.cc @@ -0,0 +1,66 @@ +// { dg-do run } + +// 2005-2-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 unordered_set +// Single-element insert + +#include <string> +#include <iterator> +#include <tr1/unordered_set> +#include "testsuite_hooks.h" + +bool test __attribute__((unused)) = true; + +void test01() +{ + typedef std::tr1::unordered_set<std::string> Set; + Set s; + VERIFY(s.empty()); + + std::pair<Set::iterator, bool> p = s.insert("abcde"); + VERIFY(p.second); + VERIFY(s.size() == 1); + VERIFY(std::distance(s.begin(), s.end()) == 1); + VERIFY(p.first == s.begin()); + VERIFY(*p.first == "abcde"); +} + +void test02() +{ + typedef std::tr1::unordered_set<std::string> Set; + Set s; + VERIFY(s.empty()); + + std::pair<Set::iterator, bool> p1 = s.insert("abcde"); + std::pair<Set::iterator, bool> p2 = s.insert("abcde"); + VERIFY(p1.second); + VERIFY(!p2.second); + VERIFY(s.size() == 1); + VERIFY(p1.first == p2.first); + VERIFY(*p1.first == "abcde"); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..6c6ec2e17 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/explicit_instantiation.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2005-02-17 Matt Austern <austern@apple.com> +// +// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 unordered_set + +#include <tr1/unordered_set> + +using namespace std::tr1; +using std::equal_to; +using std::allocator; + +template class unordered_set<int>; +template class unordered_set<float, hash<float>, equal_to<float>, + allocator<float> >; +template class unordered_set<int, hash<int>, equal_to<int>, + allocator<char> >; +template class __unordered_set<float, hash<float>, equal_to<float>, + allocator<float>, true>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterator_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterator_neg.cc new file mode 100644 index 000000000..b06ef15eb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterator_neg.cc @@ -0,0 +1,36 @@ +// 2005-10-02 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +#include <tr1/unordered_set> + +void test01() +{ + typedef std::tr1::unordered_set<int> Set; + + Set s; + + Set::const_iterator cit = s.begin(); + *cit = 0; // { dg-error "read-only" } + + Set::const_local_iterator clit = s.begin(0); + *clit = 0; // { dg-error "read-only" } +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterator_null_neg.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterator_null_neg.cc new file mode 100644 index 000000000..a0747ec47 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterator_null_neg.cc @@ -0,0 +1,28 @@ +// 2005-09-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2005, 2009, 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. +// + +// { dg-do compile } + +// libstdc++/23781 +#include <tr1/unordered_set> +#include <cstddef> + +std::tr1::unordered_set<int>::iterator it4 = NULL; // { dg-error "conversion" } +std::tr1::unordered_set<int>::const_iterator cit4 = NULL; // { dg-error "conversion" } diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterators_default_constructor.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterators_default_constructor.cc new file mode 100644 index 000000000..ecada3dd2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/iterators_default_constructor.cc @@ -0,0 +1,31 @@ +// { dg-do compile } + +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3 Unordered associative containers + +#include <tr1/unordered_set> + +void +test01() +{ + std::tr1::unordered_set<int>::iterator it; + std::tr1::unordered_set<int>::const_iterator cit; + std::tr1::unordered_set<int>::local_iterator lit; + std::tr1::unordered_set<int>::const_local_iterator clit; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/typedefs.cc new file mode 100644 index 000000000..a1f4a31f9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/typedefs.cc @@ -0,0 +1,45 @@ +// { dg-do compile } +// 2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> + +// Copyright (C) 2008, 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 unordered_set + +#include <tr1/unordered_set> + +void test01() +{ + // Check for required typedefs + typedef std::tr1::unordered_set<int> test_type; + + typedef test_type::key_type key_type; + typedef test_type::value_type value_type; + typedef test_type::hasher hasher; + typedef test_type::key_equal key_equal; + typedef test_type::allocator_type allocator_type; + typedef test_type::pointer pointer; + typedef test_type::const_pointer const_pointer; + typedef test_type::reference reference; + typedef test_type::const_reference const_reference; + typedef test_type::size_type size_type; + typedef test_type::difference_type difference_type; + typedef test_type::iterator iterator; + typedef test_type::const_iterator const_iterator; + typedef test_type::local_iterator local_iterator; + typedef test_type::const_local_iterator const_local_iterator; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/swap/1.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/swap/1.cc new file mode 100644 index 000000000..d14be65de --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/swap/1.cc @@ -0,0 +1,152 @@ +// 2005-12-20 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 unordered_set::swap + +#include <tr1/unordered_set> +#include <set> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// uneq_allocator as a non-empty allocator. +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + using std::equal_to; + using std::set; + + typedef __gnu_test::uneq_allocator<char> my_alloc; + typedef unordered_set<char, hash<char>, equal_to<char>, my_alloc> my_uset; + + const char title01[] = "Rivers of sand"; + const char title02[] = "Concret PH"; + const char title03[] = "Sonatas and Interludes for Prepared Piano"; + const char title04[] = "never as tired as when i'm waking up"; + + const size_t N1 = sizeof(title01); + const size_t N2 = sizeof(title02); + const size_t N3 = sizeof(title03); + const size_t N4 = sizeof(title04); + + typedef set<char> my_set; + const my_set set01_ref(title01, title01 + N1); + const my_set set02_ref(title02, title02 + N2); + const my_set set03_ref(title03, title03 + N3); + const my_set set04_ref(title04, title04 + N4); + + my_uset::size_type size01, size02; + + my_alloc alloc01(1); + + my_uset uset01(10, hash<char>(), equal_to<char>(), alloc01); + size01 = uset01.size(); + my_uset uset02(10, hash<char>(), equal_to<char>(), alloc01); + size02 = uset02.size(); + + uset01.swap(uset02); + VERIFY( uset01.size() == size02 ); + VERIFY( uset01.empty() ); + VERIFY( uset02.size() == size01 ); + VERIFY( uset02.empty() ); + + my_uset uset03(10, hash<char>(), equal_to<char>(), alloc01); + size01 = uset03.size(); + my_uset uset04(set02_ref.begin(), set02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset04.size(); + + uset03.swap(uset04); + VERIFY( uset03.size() == size02 ); + VERIFY( my_set(uset03.begin(), uset03.end()) == set02_ref ); + VERIFY( uset04.size() == size01 ); + VERIFY( uset04.empty() ); + + my_uset uset05(set01_ref.begin(), set01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = uset05.size(); + my_uset uset06(set02_ref.begin(), set02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset06.size(); + + uset05.swap(uset06); + VERIFY( uset05.size() == size02 ); + VERIFY( my_set(uset05.begin(), uset05.end()) == set02_ref ); + VERIFY( uset06.size() == size01 ); + VERIFY( my_set(uset06.begin(), uset06.end()) == set01_ref ); + + my_uset uset07(set01_ref.begin(), set01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = uset07.size(); + my_uset uset08(set03_ref.begin(), set03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset08.size(); + + uset07.swap(uset08); + VERIFY( uset07.size() == size02 ); + VERIFY( my_set(uset07.begin(), uset07.end()) == set03_ref ); + VERIFY( uset08.size() == size01 ); + VERIFY( my_set(uset08.begin(), uset08.end()) == set01_ref ); + + my_uset uset09(set03_ref.begin(), set03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = uset09.size(); + my_uset uset10(set04_ref.begin(), set04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset10.size(); + + uset09.swap(uset10); + VERIFY( uset09.size() == size02 ); + VERIFY( my_set(uset09.begin(), uset09.end()) == set04_ref ); + VERIFY( uset10.size() == size01 ); + VERIFY( my_set(uset10.begin(), uset10.end()) == set03_ref ); + + my_uset uset11(set04_ref.begin(), set04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = uset11.size(); + my_uset uset12(set01_ref.begin(), set01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset12.size(); + + uset11.swap(uset12); + VERIFY( uset11.size() == size02 ); + VERIFY( my_set(uset11.begin(), uset11.end()) == set01_ref ); + VERIFY( uset12.size() == size01 ); + VERIFY( my_set(uset12.begin(), uset12.end()) == set04_ref ); + + my_uset uset13(set03_ref.begin(), set03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = uset13.size(); + my_uset uset14(set03_ref.begin(), set03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset14.size(); + + uset13.swap(uset14); + VERIFY( uset13.size() == size02 ); + VERIFY( my_set(uset13.begin(), uset13.end()) == set03_ref ); + VERIFY( uset14.size() == size01 ); + VERIFY( my_set(uset14.begin(), uset14.end()) == set03_ref ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/swap/2.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/swap/2.cc new file mode 100644 index 000000000..93477f615 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/swap/2.cc @@ -0,0 +1,181 @@ +// 2005-12-20 Paolo Carlini <pcarlini@suse.de> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 6.3.4.3 unordered_set::swap + +#include <tr1/unordered_set> +#include <set> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// uneq_allocator, two different personalities. +void +test01() +{ + bool test __attribute__((unused)) = true; + using namespace std::tr1; + using std::equal_to; + using std::set; + + typedef __gnu_test::uneq_allocator<char> my_alloc; + typedef unordered_set<char, hash<char>, equal_to<char>, my_alloc> my_uset; + + const char title01[] = "Rivers of sand"; + const char title02[] = "Concret PH"; + const char title03[] = "Sonatas and Interludes for Prepared Piano"; + const char title04[] = "never as tired as when i'm waking up"; + + const size_t N1 = sizeof(title01); + const size_t N2 = sizeof(title02); + const size_t N3 = sizeof(title03); + const size_t N4 = sizeof(title04); + + typedef set<char> my_set; + const my_set set01_ref(title01, title01 + N1); + const my_set set02_ref(title02, title02 + N2); + const my_set set03_ref(title03, title03 + N3); + const my_set set04_ref(title04, title04 + N4); + + my_uset::size_type size01, size02; + + my_alloc alloc01(1), alloc02(2); + int personality01, personality02; + + my_uset uset01(10, hash<char>(), equal_to<char>(), alloc01); + size01 = uset01.size(); + personality01 = uset01.get_allocator().get_personality(); + my_uset uset02(10, hash<char>(), equal_to<char>(), alloc02); + size02 = uset02.size(); + personality02 = uset02.get_allocator().get_personality(); + + uset01.swap(uset02); + VERIFY( uset01.size() == size02 ); + VERIFY( uset01.empty() ); + VERIFY( uset02.size() == size01 ); + VERIFY( uset02.empty() ); + VERIFY( uset01.get_allocator().get_personality() == personality02 ); + VERIFY( uset02.get_allocator().get_personality() == personality01 ); + + my_uset uset03(10, hash<char>(), equal_to<char>(), alloc02); + size01 = uset03.size(); + personality01 = uset03.get_allocator().get_personality(); + my_uset uset04(set02_ref.begin(), set02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset04.size(); + personality02 = uset04.get_allocator().get_personality(); + + uset03.swap(uset04); + VERIFY( uset03.size() == size02 ); + VERIFY( my_set(uset03.begin(), uset03.end()) == set02_ref ); + VERIFY( uset04.size() == size01 ); + VERIFY( uset04.empty() ); + VERIFY( uset03.get_allocator().get_personality() == personality02 ); + VERIFY( uset04.get_allocator().get_personality() == personality01 ); + + my_uset uset05(set01_ref.begin(), set01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = uset05.size(); + personality01 = uset05.get_allocator().get_personality(); + my_uset uset06(set02_ref.begin(), set02_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = uset06.size(); + personality02 = uset06.get_allocator().get_personality(); + + uset05.swap(uset06); + VERIFY( uset05.size() == size02 ); + VERIFY( my_set(uset05.begin(), uset05.end()) == set02_ref ); + VERIFY( uset06.size() == size01 ); + VERIFY( my_set(uset06.begin(), uset06.end()) == set01_ref ); + VERIFY( uset05.get_allocator().get_personality() == personality02 ); + VERIFY( uset06.get_allocator().get_personality() == personality01 ); + + my_uset uset07(set01_ref.begin(), set01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size01 = uset07.size(); + personality01 = uset07.get_allocator().get_personality(); + my_uset uset08(set03_ref.begin(), set03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset08.size(); + personality02 = uset08.get_allocator().get_personality(); + + uset07.swap(uset08); + VERIFY( uset07.size() == size02 ); + VERIFY( my_set(uset07.begin(), uset07.end()) == set03_ref ); + VERIFY( uset08.size() == size01 ); + VERIFY( my_set(uset08.begin(), uset08.end()) == set01_ref ); + VERIFY( uset07.get_allocator().get_personality() == personality02 ); + VERIFY( uset08.get_allocator().get_personality() == personality01 ); + + my_uset uset09(set03_ref.begin(), set03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = uset09.size(); + personality01 = uset09.get_allocator().get_personality(); + my_uset uset10(set04_ref.begin(), set04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = uset10.size(); + personality02 = uset10.get_allocator().get_personality(); + + uset09.swap(uset10); + VERIFY( uset09.size() == size02 ); + VERIFY( my_set(uset09.begin(), uset09.end()) == set04_ref ); + VERIFY( uset10.size() == size01 ); + VERIFY( my_set(uset10.begin(), uset10.end()) == set03_ref ); + VERIFY( uset09.get_allocator().get_personality() == personality02 ); + VERIFY( uset10.get_allocator().get_personality() == personality01 ); + + my_uset uset11(set04_ref.begin(), set04_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size01 = uset11.size(); + personality01 = uset11.get_allocator().get_personality(); + my_uset uset12(set01_ref.begin(), set01_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size02 = uset12.size(); + personality02 = uset12.get_allocator().get_personality(); + + uset11.swap(uset12); + VERIFY( uset11.size() == size02 ); + VERIFY( my_set(uset11.begin(), uset11.end()) == set01_ref ); + VERIFY( uset12.size() == size01 ); + VERIFY( my_set(uset12.begin(), uset12.end()) == set04_ref ); + VERIFY( uset11.get_allocator().get_personality() == personality02 ); + VERIFY( uset12.get_allocator().get_personality() == personality01 ); + + my_uset uset13(set03_ref.begin(), set03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc01); + size01 = uset13.size(); + personality01 = uset13.get_allocator().get_personality(); + my_uset uset14(set03_ref.begin(), set03_ref.end(), 10, hash<char>(), + equal_to<char>(), alloc02); + size02 = uset14.size(); + personality02 = uset14.get_allocator().get_personality(); + + uset13.swap(uset14); + VERIFY( uset13.size() == size02 ); + VERIFY( my_set(uset13.begin(), uset13.end()) == set03_ref ); + VERIFY( uset14.size() == size01 ); + VERIFY( my_set(uset14.begin(), uset14.end()) == set03_ref ); + VERIFY( uset13.get_allocator().get_personality() == personality02 ); + VERIFY( uset14.get_allocator().get_personality() == personality01 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/utility/19535.cc b/libstdc++-v3/testsuite/tr1/6_containers/utility/19535.cc new file mode 100644 index 000000000..82a3dbf3f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/utility/19535.cc @@ -0,0 +1,41 @@ +// 2005-01-19 Petur Runolfsson <peturr02@ru.is> + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 additions to pair + +#include <tr1/utility> + +struct A { }; +struct B { }; + +// libstdc++/19535 +void test01() +{ + std::pair<A, B> p; + std::tr1::get<1>(p); + + const std::pair<B, A> q; + std::tr1::get<1>(q); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/6_containers/utility/pair.cc b/libstdc++-v3/testsuite/tr1/6_containers/utility/pair.cc new file mode 100644 index 000000000..3189e7f81 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/6_containers/utility/pair.cc @@ -0,0 +1,55 @@ +// 2004-09-23 Chris Jefferson <chris@bubblescope.net> + +// Copyright (C) 2004, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 additions to pair + +#include <tr1/utility> +#include <testsuite_hooks.h> + +using namespace std::tr1; +using std::pair; + +struct blank_class +{ }; + +int +main() +{ + bool test __attribute__((unused)) = true; + typedef pair<int,int> test_pair_type; + VERIFY(tuple_size<test_pair_type>::value == 2); + // Test if tuple_element::type returns the correct type + blank_class blank; + tuple_element<0, pair<blank_class, int> >::type + blank2 __attribute__((unused)) = blank; + tuple_element<1, pair<int ,blank_class> >::type + blank3 __attribute__((unused)) = blank; + pair<int,int> test_pair(1, 2); + VERIFY(get<0>(test_pair) == 1); + VERIFY(get<1>(test_pair) == 2); + get<0>(test_pair) = 3; + get<1>(test_pair) = 4; + VERIFY(get<0>(test_pair) == 3); + VERIFY(get<1>(test_pair) == 4); + + const pair<int,int> test_pair2(1,2); + VERIFY(get<0>(test_pair2) == 1); + VERIFY(get<1>(test_pair2) == 2); +} + diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring.cc new file mode 100644 index 000000000..4a387dee3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests assign operation from a C-style null-terminated-string. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char* cs = "aab"; + test_type re; + re.assign(cs); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring_op.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring_op.cc new file mode 100644 index 000000000..1cbc2f94c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring_op.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests basic_regex assign operator from a C-style null-terminated-string. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char* cs = "aab"; + test_type re; + re = cs; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/pstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/pstring.cc new file mode 100644 index 000000000..534fb4b87 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/pstring.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests assign operation from a Pascal-style counted-string. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char cs[] = "aab"; + test_type re; + re.assign(cs, sizeof(cs)-1, std::tr1::regex_constants::basic); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/range.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/range.cc new file mode 100644 index 000000000..3f8595de9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/range.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests range assign of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + char s[] = "a+b|c"; + test_type re; + re.assign(s, s + 5); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string.cc new file mode 100644 index 000000000..d80c5676b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests C++ string assignment of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + std::string s("a*b"); + test_type re; + re.assign(s); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string_op.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string_op.cc new file mode 100644 index 000000000..67b806842 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string_op.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests basic_regex assignment operator from a C++ string; +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + std::string s("a*b"); + test_type re; + re = s; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring.cc new file mode 100644 index 000000000..4de61bda3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests assign operation from a C-style null-terminated-string. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t* cs = L"aab"; + test_type re; + re.assign(cs); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring_op.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring_op.cc new file mode 100644 index 000000000..9e1dfaa0a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring_op.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests basic_regex assign operator from a C-style null-terminated-string. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t* cs = L"aab"; + test_type re; + re = cs; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/pstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/pstring.cc new file mode 100644 index 000000000..91a9e6ea6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/pstring.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests assign operation from a Pascal-style counted-string. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t cs[] = L"aab"; + test_type re; + re.assign(cs, sizeof(cs)-1, std::tr1::regex_constants::basic); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/range.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/range.cc new file mode 100644 index 000000000..2ec474bc6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/range.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests range assign of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + wchar_t s[] = L"a+b|c"; + test_type re; + re.assign(s, s + 5); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string.cc new file mode 100644 index 000000000..c5332a32c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests C++ string assignment of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + std::wstring s(L"a*b"); + test_type re; + re.assign(s); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string_op.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string_op.cc new file mode 100644 index 000000000..a19bd524a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string_op.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests basic_regex assignment operator from a C++ string; +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + std::wstring s(L"a*b"); + test_type re; + re = s; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/cstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/cstring.cc new file mode 100644 index 000000000..9a160b09f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/cstring.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests C-style null-terminated-string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char* cs = "aab"; + test_type re(cs); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/default.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/default.cc new file mode 100644 index 000000000..1797dbcb0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/default.cc @@ -0,0 +1,46 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + // default constructor + test_type re; + + // Check for required typedefs + typedef test_type::value_type value_type; + typedef test_type::flag_type flag_type; + typedef test_type::locale_type locale_type; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/pstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/pstring.cc new file mode 100644 index 000000000..8315a59e2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/pstring.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests Pascal-style counted-string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char* cs = "aab"; + test_type re(cs, 3, std::tr1::regex_constants::basic); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/range.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/range.cc new file mode 100644 index 000000000..0f09f6c69 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/range.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests range constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + char s[] = "a+b|c"; + test_type re(s, s + 5); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc new file mode 100644 index 000000000..16adebfe2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc @@ -0,0 +1,53 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// Tests C++ string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + std::string s("a*b"); + test_type re(s); +} + +void test02() +{ + typedef std::tr1::basic_regex<char> test_type; + typedef __gnu_test::tracker_allocator<char> alloc_type; + + std::basic_string<char, std::char_traits<char>, alloc_type> s("a*b"); + test_type re(s); +} + +int +main() +{ + test01(); + test02(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/cstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/cstring.cc new file mode 100644 index 000000000..71ae03a0f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/cstring.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests C-style null-terminated-string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t* cs = L"aab"; + test_type re(cs); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/default.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/default.cc new file mode 100644 index 000000000..06333e96a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/default.cc @@ -0,0 +1,46 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + // default constructor + test_type re; + + // Check for required typedefs + typedef test_type::value_type value_type; + typedef test_type::flag_type flag_type; + typedef test_type::locale_type locale_type; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/pstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/pstring.cc new file mode 100644 index 000000000..9c8a7db8e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/pstring.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests Pascal-style counted-string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t* cs = L"aab"; + test_type re(cs, 3, std::tr1::regex_constants::basic); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/range.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/range.cc new file mode 100644 index 000000000..ac45cdd17 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/range.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests range constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + wchar_t s[] = L"a+b|c"; + test_type re(s, s + 5); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc new file mode 100644 index 000000000..83eddb033 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc @@ -0,0 +1,53 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// Tests C++ string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + std::wstring s(L"a*b"); + test_type re(s); +} + +void test02() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + typedef __gnu_test::tracker_allocator<wchar_t> alloc_type; + + std::basic_string<wchar_t, std::char_traits<wchar_t>, alloc_type> s(L"a*b"); + test_type re(s); +} + +int +main() +{ + test01(); + test02(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/match_results/ctors/char/default.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/match_results/ctors/char/default.cc new file mode 100644 index 000000000..9c28a0c86 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/match_results/ctors/char/default.cc @@ -0,0 +1,57 @@ +// { dg-do link } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.10.1] class template match_results constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the match_result class. +void test01() +{ + bool test __attribute__((unused)) = true; + typedef std::tr1::match_results<char*> test_type; + + // default constructor + test_type m; + + // Check for required typedefs + typedef test_type::value_type value_type; + typedef test_type::const_reference const_reference; + typedef test_type::reference reference; + typedef test_type::const_iterator const_iterator; + typedef test_type::iterator iterator; + typedef test_type::difference_type difference_type; + typedef test_type::size_type size_type; + typedef test_type::allocator_type allocator_type; + typedef test_type::char_type char_type; + typedef test_type::string_type string_type; + + VERIFY( m.size() == 0 ); + VERIFY( m.str() == std::basic_string<char_type>() ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_awk.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_awk.cc new file mode 100644 index 000000000..be8b51b8c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_awk.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 7.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re("(a|b)*abb", std::tr1::regex::awk); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_basic.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_basic.cc new file mode 100644 index 000000000..0ea45c7d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_basic.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 7.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re("(a|b)*abb", std::tr1::regex::basic); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_ecma.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_ecma.cc new file mode 100644 index 000000000..241cf6b0d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_ecma.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 7.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re("(a|b)*abb"); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_egrep.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_egrep.cc new file mode 100644 index 000000000..0a78af9c4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_egrep.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 7.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re("(a|b)*abb", std::tr1::regex::egrep); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_extended.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_extended.cc new file mode 100644 index 000000000..899361d33 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_extended.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 7.8.2 basic_regex constructors + +#include <tr1/regex> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::regex re("(wee|week)(knights|night)", std::tr1::regex::extended); + + VERIFY( re.flags() == std::tr1::regex::extended ); + VERIFY( re.mark_count() == 0 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_grep.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_grep.cc new file mode 100644 index 000000000..5053294ab --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_grep.cc @@ -0,0 +1,38 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 7.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + using std::tr1::regex; + + regex re("(a|b)*abb", regex::grep); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/default.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/default.cc new file mode 100644 index 000000000..8b410652f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/default.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 7.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/ctor.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/ctor.cc new file mode 100644 index 000000000..3f7552f55 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/ctor.cc @@ -0,0 +1,48 @@ +// { dg-do link } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.7] class template regex_traits + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the regex_traits class. There is only the +// default constructor. +void test01() +{ + typedef std::tr1::regex_traits<char> test_type; + + // required default constructor + test_type t; + + // Check for required typedefs + typedef test_type::char_type char_type; + typedef test_type::string_type string_type; + typedef test_type::locale_type locale_type; + typedef test_type::char_class_type char_class_type; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/translate_nocase.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/translate_nocase.cc new file mode 100644 index 000000000..73fce8272 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/translate_nocase.cc @@ -0,0 +1,41 @@ +// { dg-do run } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.7] class template regex_traits (5) translate_nocase + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the regex_traits class. There is only the +// default constructor. +void test01() +{ + bool test __attribute__((unused)) = true; + std::tr1::regex_traits<char> t; + VERIFY( t.translate_nocase('A') == 'a' ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc new file mode 100644 index 000000000..4f89afb61 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc @@ -0,0 +1,48 @@ +// { dg-do run } + +// 2008-08-11 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.7] class template regex_traits value() function + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests the value() function of the regex_traits<char> class. +void test01() +{ + bool test __attribute__((unused)) = true; + std::tr1::regex_traits<char> t; + VERIFY( t.value('7', 8) == 7 ); + VERIFY( t.value('7', 10) == 7 ); + VERIFY( t.value('7', 16) == 7 ); + VERIFY( t.value('9', 8) == -1 ); + VERIFY( t.value('9', 10) == 9 ); + VERIFY( t.value('9', 16) == 9 ); + VERIFY( t.value('d', 8) == -1 ); + VERIFY( t.value('d', 10) == -1 ); + VERIFY( t.value('d', 16) == 13 ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/ctor.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/ctor.cc new file mode 100644 index 000000000..3c430ef4c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/ctor.cc @@ -0,0 +1,48 @@ +// { dg-do link } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.7] class template regex_traits + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the regex_traits class. There is only the +// default constructor. +void test01() +{ + typedef std::tr1::regex_traits<wchar_t> test_type; + + // required default constructor + test_type t; + + // Check for required typedefs + typedef test_type::char_type char_type; + typedef test_type::string_type string_type; + typedef test_type::locale_type locale_type; + typedef test_type::char_class_type char_class_type; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/translate_nocase.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/translate_nocase.cc new file mode 100644 index 000000000..0404d0952 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/translate_nocase.cc @@ -0,0 +1,41 @@ +// { dg-do run } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.7] class template regex_traits (5) translate_nocase + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the regex_traits class. There is only the +// default constructor. +void test01() +{ + bool test __attribute__((unused)) = true; + std::tr1::regex_traits<wchar_t> t; + VERIFY( t.translate_nocase(L'A') == L'a' ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc new file mode 100644 index 000000000..4f89afb61 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc @@ -0,0 +1,48 @@ +// { dg-do run } + +// 2008-08-11 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// tr1 [7.7] class template regex_traits value() function + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests the value() function of the regex_traits<char> class. +void test01() +{ + bool test __attribute__((unused)) = true; + std::tr1::regex_traits<char> t; + VERIFY( t.value('7', 8) == 7 ); + VERIFY( t.value('7', 10) == 7 ); + VERIFY( t.value('7', 16) == 7 ); + VERIFY( t.value('9', 8) == -1 ); + VERIFY( t.value('9', 10) == 9 ); + VERIFY( t.value('9', 16) == 9 ); + VERIFY( t.value('d', 8) == -1 ); + VERIFY( t.value('d', 10) == -1 ); + VERIFY( t.value('d', 16) == 13 ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc new file mode 100644 index 000000000..862b0419f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc @@ -0,0 +1,35 @@ +// { dg-do compile } + +// 2006-01-25 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.4 Additions to header <cctype> + +#include <tr1/cctype> + +void test01() +{ +#if _GLIBCXX_USE_C99_CTYPE_TR1 + + int ch = 0, ret; + ret = std::tr1::isblank(ch); + ret = ret; // Suppress unused warning. + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc new file mode 100644 index 000000000..5bffa0ef3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc @@ -0,0 +1,52 @@ +// { dg-do compile } + +// 2006-01-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.6 Header <cfenv> + +#include <tr1/cfenv> + +void test01() +{ +#if _GLIBCXX_USE_C99_FENV_TR1 + + int except = 0, mode = 0; + std::tr1::fexcept_t* pflag = 0; + std::tr1::fenv_t* penv = 0; + + int ret; + + ret = std::tr1::feclearexcept(except); + ret = std::tr1::fegetexceptflag(pflag, except); + ret = std::tr1::feraiseexcept(except); + ret = std::tr1::fesetexceptflag(pflag, except); + ret = std::tr1::fetestexcept(except); + + ret = std::tr1::fegetround(); + ret = std::tr1::fesetround(mode); + + ret = std::tr1::fegetenv(penv); + ret = std::tr1::feholdexcept(penv); + ret = std::tr1::fesetenv(penv); + ret = std::tr1::feupdateenv(penv); + ret = ret; // Suppress unused warning. + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types_std_tr1.cc new file mode 100644 index 000000000..f16ccdad3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types_std_tr1.cc @@ -0,0 +1,34 @@ +// { dg-do compile } + +// 2006-01-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.6 Header <cfenv> + +#include <tr1/cfenv> + +void test01() +{ +#if _GLIBCXX_USE_C99_FENV_TR1 + + typedef std::tr1::fenv_t my_fenv_t; + typedef std::tr1::fexcept_t my_fexcept_t; + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc new file mode 100644 index 000000000..30c7b789f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc @@ -0,0 +1,61 @@ +// { dg-do compile } + +// 2006-01-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.11 Header <cinttypes> + +#include <tr1/cinttypes> + +void test01() +{ +#if _GLIBCXX_USE_C99_INTTYPES_TR1 + + std::tr1::intmax_t i = 0, numer = 0, denom = 0, base = 0; + const char* s = 0; + char** endptr = 0; +#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 + const wchar_t* ws = 0; + wchar_t** wendptr = 0; +#endif + + std::tr1::intmax_t ret; + std::tr1::uintmax_t uret; + std::tr1::imaxdiv_t dret; + + ret = std::tr1::imaxabs(i); + // ret = std::tr1::abs(i); + + dret = std::tr1::imaxdiv(numer, denom); + // dret = std::tr1::div(numer, denom); + + ret = std::tr1::strtoimax(s, endptr, base); + uret = std::tr1::strtoumax(s, endptr, base); + +#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 + ret = std::tr1::wcstoimax(ws, wendptr, base); + uret = std::tr1::wcstoumax(ws, wendptr, base); +#endif + + ret = ret; // Suppress unused warnings. + dret = dret; + uret = uret; + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/types_std_tr1.cc new file mode 100644 index 000000000..1bd230a4d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/types_std_tr1.cc @@ -0,0 +1,33 @@ +// { dg-do compile } + +// 2006-01-30 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.11 Header <cinttypes> + +#include <tr1/cinttypes> + +void test01() +{ +#if _GLIBCXX_USE_C99_INTTYPES_TR1 + + typedef std::tr1::imaxdiv_t my_imaxdiv_t; + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc new file mode 100644 index 000000000..504305a30 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc @@ -0,0 +1,62 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/cmath> + +namespace a +{ + template<typename> class Mat { }; + + template<typename T> struct Mat2 : Mat<T> { }; + + template<typename T> + int fdim(Mat<T>) { return 1; } + + template<typename T, typename U> + int floor(Mat<T>, U) { return 1; } + template<typename T, typename U> + int floor(T, Mat<U>) { return 1; } + + template<typename T, typename U, typename V> + int fma(Mat<T>, U, V) { return 1; } + template<typename T, typename U, typename V> + int fma(T, Mat<U>, V) { return 1; } + template<typename T, typename U, typename V> + int fma(T, U, Mat<V>) { return 1; } +} + +int main() +{ + int __attribute__((unused)) i; + + using namespace std::tr1; + + a::Mat2<double> c; + i = fdim(c); + i = floor(c, 0.); + i = floor(0., c); + i = floor(c, 1); + i = floor(1, c); + i = fma(c, 0., 1.); + i = fma(0., c, 1.); + i = fma(0., 1., c); + i = fma(c, 0., 1); + i = fma(0., c, 1); + i = fma(0., 1, c); +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc new file mode 100644 index 000000000..ae31a48ec --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc @@ -0,0 +1,193 @@ +// { dg-do compile } + +// 2006-02-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.16 Additions to header <cmath> + +#include <tr1/cmath> + +void test01() +{ +#if _GLIBCXX_USE_C99_MATH_TR1 + + double d0 = 0.0; + float f0 = 0.0f; + long double ld0 = 0.0l; + const char* str = "NAN"; + int* pquo = 0; + long lex = 0l; + int ex = 0; + + double ret; + float fret; + long double ldret; + int iret; + long lret; + long long llret; + + ret = std::tr1::acosh(d0); + fret = std::tr1::acoshf(f0); + ldret = std::tr1::acoshl(ld0); + + ret = std::tr1::asinh(d0); + fret = std::tr1::asinhf(f0); + ldret = std::tr1::asinhl(ld0); + + ret = std::tr1::atanh(d0); + fret = std::tr1::atanhf(f0); + ldret = std::tr1::atanhl(ld0); + + ret = std::tr1::cbrt(d0); + fret = std::tr1::cbrtf(f0); + ldret = std::tr1::cbrtl(ld0); + + ret = std::tr1::copysign(d0, d0); + fret = std::tr1::copysignf(f0, f0); + ldret = std::tr1::copysignl(ld0, ld0); + + ret = std::tr1::erf(d0); + fret = std::tr1::erff(f0); + ldret = std::tr1::erfl(ld0); + + ret = std::tr1::erfc(d0); + fret = std::tr1::erfcf(f0); + ldret = std::tr1::erfcl(ld0); + + ret = std::tr1::exp2(d0); + fret = std::tr1::exp2f(f0); + ldret = std::tr1::exp2l(ld0); + + ret = std::tr1::expm1(d0); + fret = std::tr1::expm1f(f0); + ldret = std::tr1::expm1l(ld0); + + ret = std::tr1::fdim(d0, d0); + fret = std::tr1::fdimf(f0, f0); + ldret = std::tr1::fdiml(ld0, ld0); + + ret = std::tr1::fma(d0, d0, d0); + fret = std::tr1::fmaf(f0, f0, f0); + ldret = std::tr1::fmal(ld0, ld0, ld0); + + ret = std::tr1::fmax(d0, d0); + fret = std::tr1::fmaxf(f0, f0); + ldret = std::tr1::fmaxl(ld0, ld0); + + ret = std::tr1::fmin(d0, d0); + fret = std::tr1::fminf(f0, f0); + ldret = std::tr1::fminl(ld0, ld0); + + ret = std::tr1::hypot(d0, d0); + fret = std::tr1::hypotf(f0, f0); + ldret = std::tr1::hypotl(ld0, ld0); + + iret = std::tr1::ilogb(d0); + iret = std::tr1::ilogbf(f0); + iret = std::tr1::ilogbl(ld0); + + ret = std::tr1::lgamma(d0); + fret = std::tr1::lgammaf(f0); + ldret = std::tr1::lgammal(ld0); + + llret = std::tr1::llrint(d0); + llret = std::tr1::llrintf(f0); + llret = std::tr1::llrintl(ld0); + + llret = std::tr1::llround(d0); + llret = std::tr1::llroundf(f0); + llret = std::tr1::llroundl(ld0); + + ret = std::tr1::log1p(d0); + fret = std::tr1::log1pf(f0); + ldret = std::tr1::log1pl(ld0); + + ret = std::tr1::log2(d0); + fret = std::tr1::log2f(f0); + ldret = std::tr1::log2l(ld0); + + ret = std::tr1::logb(d0); + fret = std::tr1::logbf(f0); + ldret = std::tr1::logbl(ld0); + + lret = std::tr1::lrint(d0); + lret = std::tr1::lrintf(f0); + lret = std::tr1::lrintl(ld0); + + lret = std::tr1::lround(d0); + lret = std::tr1::lroundf(f0); + lret = std::tr1::lroundl(ld0); + + ret = std::tr1::nan(str); + fret = std::tr1::nanf(str); + ldret = std::tr1::nanl(str); + + ret = std::tr1::nearbyint(d0); + fret = std::tr1::nearbyintf(f0); + ldret = std::tr1::nearbyintl(ld0); + + ret = std::tr1::nextafter(d0, d0); + fret = std::tr1::nextafterf(f0, f0); + ldret = std::tr1::nextafterl(ld0, ld0); + + ret = std::tr1::nexttoward(d0, ld0); + fret = std::tr1::nexttowardf(f0, ld0); + ldret = std::tr1::nexttowardl(ld0, ld0); + + ret = std::tr1::remainder(d0, d0); + fret = std::tr1::remainderf(f0, f0); + ldret = std::tr1::remainderl(ld0, ld0); + + ret = std::tr1::remquo(d0, d0, pquo); + fret = std::tr1::remquof(f0, f0, pquo); + ldret = std::tr1::remquol(ld0, ld0, pquo); + + ret = std::tr1::rint(d0); + fret = std::tr1::rintf(f0); + ldret = std::tr1::rintl(ld0); + + ret = std::tr1::round(d0); + fret = std::tr1::roundf(f0); + ldret = std::tr1::roundl(ld0); + + ret = std::tr1::scalbln(d0, lex); + fret = std::tr1::scalblnf(f0, lex); + ldret = std::tr1::scalblnl(ld0, lex); + + ret = std::tr1::scalbn(d0, ex); + fret = std::tr1::scalbnf(f0, ex); + ldret = std::tr1::scalbnl(ld0, ex); + + ret = std::tr1::tgamma(d0); + fret = std::tr1::tgammaf(f0); + ldret = std::tr1::tgammal(ld0); + + ret = std::tr1::trunc(d0); + fret = std::tr1::truncf(f0); + ldret = std::tr1::truncl(ld0); + + ret = ret; // Suppress unused warnings. + iret = iret; + lret = lret; + llret = llret; + fret = fret; + ldret = ldret; + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/overloads.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/overloads.cc new file mode 100644 index 000000000..04bc91275 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/overloads.cc @@ -0,0 +1,257 @@ +// { dg-do compile } + +// 2006-03-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.16.4 Additional overloads + +#include <tr1/cmath> +#include <testsuite_tr1.h> + +void test01() +{ +#if _GLIBCXX_USE_C99_MATH_TR1 + + using namespace __gnu_test; + + double d0 = 0.0; + float f0 = 0.0f; + long double ld0 = 0.0l; + int i0 = 0; + int* pquo = 0; + long lex = 0l; + int ex = 0; + + check_ret_type<double>(std::tr1::atan2(d0, d0)); + check_ret_type<double>(std::tr1::atan2(d0, f0)); + check_ret_type<float>(std::tr1::atan2(f0, f0)); + check_ret_type<long double>(std::tr1::atan2(ld0, ld0)); + check_ret_type<long double>(std::tr1::atan2(ld0, d0)); + check_ret_type<double>(std::tr1::atan2(i0, i0)); + check_ret_type<double>(std::tr1::atan2(d0, i0)); + + check_ret_type<double>(std::tr1::acosh(d0)); + check_ret_type<float>(std::tr1::acosh(f0)); + check_ret_type<long double>(std::tr1::acosh(ld0)); + check_ret_type<double>(std::tr1::acosh(i0)); + + check_ret_type<double>(std::tr1::asinh(d0)); + check_ret_type<float>(std::tr1::asinh(f0)); + check_ret_type<long double>(std::tr1::asinh(ld0)); + check_ret_type<double>(std::tr1::asinh(i0)); + + check_ret_type<double>(std::tr1::atanh(d0)); + check_ret_type<float>(std::tr1::atanh(f0)); + check_ret_type<long double>(std::tr1::atanh(ld0)); + check_ret_type<double>(std::tr1::atanh(i0)); + + check_ret_type<double>(std::tr1::cbrt(d0)); + check_ret_type<float>(std::tr1::cbrt(f0)); + check_ret_type<long double>(std::tr1::cbrt(ld0)); + check_ret_type<double>(std::tr1::cbrt(i0)); + + check_ret_type<double>(std::tr1::copysign(d0, d0)); + check_ret_type<double>(std::tr1::copysign(d0, f0)); + check_ret_type<float>(std::tr1::copysign(f0, f0)); + check_ret_type<long double>(std::tr1::copysign(ld0, ld0)); + check_ret_type<long double>(std::tr1::copysign(ld0, d0)); + check_ret_type<double>(std::tr1::copysign(i0, i0)); + check_ret_type<double>(std::tr1::copysign(d0, i0)); + + check_ret_type<double>(std::tr1::erf(d0)); + check_ret_type<float>(std::tr1::erf(f0)); + check_ret_type<long double>(std::tr1::erf(ld0)); + check_ret_type<double>(std::tr1::erf(i0)); + + check_ret_type<double>(std::tr1::erfc(d0)); + check_ret_type<float>(std::tr1::erfc(f0)); + check_ret_type<long double>(std::tr1::erfc(ld0)); + check_ret_type<double>(std::tr1::erfc(i0)); + + check_ret_type<double>(std::tr1::exp2(d0)); + check_ret_type<float>(std::tr1::exp2(f0)); + check_ret_type<long double>(std::tr1::exp2(ld0)); + check_ret_type<double>(std::tr1::exp2(i0)); + + check_ret_type<double>(std::tr1::expm1(d0)); + check_ret_type<float>(std::tr1::expm1(f0)); + check_ret_type<long double>(std::tr1::expm1(ld0)); + check_ret_type<double>(std::tr1::expm1(i0)); + + check_ret_type<double>(std::tr1::fdim(d0, d0)); + check_ret_type<double>(std::tr1::fdim(d0, f0)); + check_ret_type<float>(std::tr1::fdim(f0, f0)); + check_ret_type<long double>(std::tr1::fdim(ld0, ld0)); + check_ret_type<long double>(std::tr1::fdim(ld0, d0)); + check_ret_type<double>(std::tr1::fdim(i0, i0)); + check_ret_type<double>(std::tr1::fdim(d0, i0)); + + check_ret_type<double>(std::tr1::fma(d0, d0, d0)); + check_ret_type<double>(std::tr1::fma(d0, f0, d0)); + check_ret_type<float>(std::tr1::fma(f0, f0, f0)); + check_ret_type<long double>(std::tr1::fma(ld0, ld0, ld0)); + check_ret_type<long double>(std::tr1::fma(ld0, d0, f0)); + check_ret_type<double>(std::tr1::fma(i0, i0, i0)); + check_ret_type<double>(std::tr1::fma(d0, i0, f0)); + + check_ret_type<double>(std::tr1::fmax(d0, d0)); + check_ret_type<double>(std::tr1::fmax(d0, f0)); + check_ret_type<float>(std::tr1::fmax(f0, f0)); + check_ret_type<long double>(std::tr1::fmax(ld0, ld0)); + check_ret_type<long double>(std::tr1::fmax(ld0, d0)); + check_ret_type<double>(std::tr1::fmax(i0, i0)); + check_ret_type<double>(std::tr1::fmax(d0, i0)); + + check_ret_type<double>(std::tr1::fmin(d0, d0)); + check_ret_type<double>(std::tr1::fmin(d0, f0)); + check_ret_type<float>(std::tr1::fmin(f0, f0)); + check_ret_type<long double>(std::tr1::fmin(ld0, ld0)); + check_ret_type<long double>(std::tr1::fmin(ld0, d0)); + check_ret_type<double>(std::tr1::fmin(i0, i0)); + check_ret_type<double>(std::tr1::fmin(d0, i0)); + + check_ret_type<double>(std::tr1::hypot(d0, d0)); + check_ret_type<double>(std::tr1::hypot(d0, f0)); + check_ret_type<float>(std::tr1::hypot(f0, f0)); + check_ret_type<long double>(std::tr1::hypot(ld0, ld0)); + check_ret_type<long double>(std::tr1::hypot(ld0, d0)); + check_ret_type<double>(std::tr1::hypot(i0, i0)); + check_ret_type<double>(std::tr1::hypot(d0, i0)); + + check_ret_type<int>(std::tr1::ilogb(d0)); + check_ret_type<int>(std::tr1::ilogb(f0)); + check_ret_type<int>(std::tr1::ilogb(ld0)); + check_ret_type<int>(std::tr1::ilogb(i0)); + + check_ret_type<double>(std::tr1::lgamma(d0)); + check_ret_type<float>(std::tr1::lgamma(f0)); + check_ret_type<long double>(std::tr1::lgamma(ld0)); + check_ret_type<double>(std::tr1::lgamma(i0)); + + check_ret_type<long long>(std::tr1::llrint(d0)); + check_ret_type<long long>(std::tr1::llrint(f0)); + check_ret_type<long long>(std::tr1::llrint(ld0)); + check_ret_type<long long>(std::tr1::llrint(i0)); + + check_ret_type<long long>(std::tr1::llround(d0)); + check_ret_type<long long>(std::tr1::llround(f0)); + check_ret_type<long long>(std::tr1::llround(ld0)); + check_ret_type<long long>(std::tr1::llround(i0)); + + check_ret_type<double>(std::tr1::log1p(d0)); + check_ret_type<float>(std::tr1::log1p(f0)); + check_ret_type<long double>(std::tr1::log1p(ld0)); + check_ret_type<double>(std::tr1::log1p(i0)); + + // DR 568. + check_ret_type<double>(std::tr1::log2(d0)); + check_ret_type<float>(std::tr1::log2(f0)); + check_ret_type<long double>(std::tr1::log2(ld0)); + check_ret_type<double>(std::tr1::log2(i0)); + + check_ret_type<double>(std::tr1::logb(d0)); + check_ret_type<float>(std::tr1::logb(f0)); + check_ret_type<long double>(std::tr1::logb(ld0)); + check_ret_type<double>(std::tr1::logb(i0)); + + check_ret_type<long>(std::tr1::lrint(d0)); + check_ret_type<long>(std::tr1::lrint(f0)); + check_ret_type<long>(std::tr1::lrint(ld0)); + check_ret_type<long>(std::tr1::lrint(i0)); + + check_ret_type<long>(std::tr1::lround(d0)); + check_ret_type<long>(std::tr1::lround(f0)); + check_ret_type<long>(std::tr1::lround(ld0)); + check_ret_type<long>(std::tr1::lround(i0)); + + check_ret_type<double>(std::tr1::nearbyint(d0)); + check_ret_type<float>(std::tr1::nearbyint(f0)); + check_ret_type<long double>(std::tr1::nearbyint(ld0)); + check_ret_type<double>(std::tr1::nearbyint(i0)); + + check_ret_type<double>(std::tr1::nextafter(d0, d0)); + check_ret_type<double>(std::tr1::nextafter(d0, f0)); + check_ret_type<float>(std::tr1::nextafter(f0, f0)); + check_ret_type<long double>(std::tr1::nextafter(ld0, ld0)); + check_ret_type<long double>(std::tr1::nextafter(ld0, d0)); + check_ret_type<double>(std::tr1::nextafter(i0, i0)); + check_ret_type<double>(std::tr1::nextafter(d0, i0)); + + check_ret_type<double>(std::tr1::nexttoward(d0, ld0)); + check_ret_type<float>(std::tr1::nexttoward(f0, ld0)); + check_ret_type<long double>(std::tr1::nexttoward(ld0, ld0)); + check_ret_type<double>(std::tr1::nexttoward(i0, ld0)); + + check_ret_type<double>(std::tr1::pow(d0, d0)); + check_ret_type<double>(std::tr1::pow(d0, f0)); + check_ret_type<float>(std::tr1::pow(f0, f0)); + check_ret_type<long double>(std::tr1::pow(ld0, ld0)); + check_ret_type<long double>(std::tr1::pow(ld0, d0)); + check_ret_type<double>(std::tr1::pow(i0, i0)); + check_ret_type<double>(std::tr1::pow(d0, i0)); + check_ret_type<double>(std::tr1::pow(f0, i0)); + + check_ret_type<double>(std::tr1::remainder(d0, d0)); + check_ret_type<double>(std::tr1::remainder(d0, f0)); + check_ret_type<float>(std::tr1::remainder(f0, f0)); + check_ret_type<long double>(std::tr1::remainder(ld0, ld0)); + check_ret_type<long double>(std::tr1::remainder(ld0, d0)); + check_ret_type<double>(std::tr1::remainder(i0, i0)); + check_ret_type<double>(std::tr1::remainder(d0, i0)); + + check_ret_type<double>(std::tr1::remquo(d0, d0, pquo)); + check_ret_type<double>(std::tr1::remquo(d0, f0, pquo)); + check_ret_type<float>(std::tr1::remquo(f0, f0, pquo)); + check_ret_type<long double>(std::tr1::remquo(ld0, ld0, pquo)); + check_ret_type<long double>(std::tr1::remquo(ld0, d0, pquo)); + check_ret_type<double>(std::tr1::remquo(i0, i0, pquo)); + check_ret_type<double>(std::tr1::remquo(d0, i0, pquo)); + + check_ret_type<double>(std::tr1::rint(d0)); + check_ret_type<float>(std::tr1::rint(f0)); + check_ret_type<long double>(std::tr1::rint(ld0)); + check_ret_type<double>(std::tr1::rint(i0)); + + check_ret_type<double>(std::tr1::round(d0)); + check_ret_type<float>(std::tr1::round(f0)); + check_ret_type<long double>(std::tr1::round(ld0)); + check_ret_type<double>(std::tr1::round(i0)); + + check_ret_type<double>(std::tr1::scalbln(d0, lex)); + check_ret_type<float>(std::tr1::scalbln(f0, lex)); + check_ret_type<long double>(std::tr1::scalbln(ld0, lex)); + check_ret_type<double>(std::tr1::scalbln(i0, lex)); + + check_ret_type<double>(std::tr1::scalbn(d0, ex)); + check_ret_type<float>(std::tr1::scalbn(f0, ex)); + check_ret_type<long double>(std::tr1::scalbn(ld0, ex)); + check_ret_type<double>(std::tr1::scalbn(i0, ex)); + + check_ret_type<double>(std::tr1::tgamma(d0)); + check_ret_type<float>(std::tr1::tgamma(f0)); + check_ret_type<long double>(std::tr1::tgamma(ld0)); + check_ret_type<double>(std::tr1::tgamma(i0)); + + check_ret_type<double>(std::tr1::trunc(d0)); + check_ret_type<float>(std::tr1::trunc(f0)); + check_ret_type<long double>(std::tr1::trunc(ld0)); + check_ret_type<double>(std::tr1::trunc(i0)); + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc new file mode 100644 index 000000000..cbf8c9592 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc @@ -0,0 +1,64 @@ +// { dg-do compile } + +// 2006-02-26 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.16 Additions to header <cmath> + +#include <tr1/cmath> + +#if _GLIBCXX_USE_C99 +#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC + +template<typename T> + void test01_do() + { + T x = T(); + + bool ret; + int iret; + + ret = std::tr1::signbit(x); + + iret = std::tr1::fpclassify(x); + iret = iret; // Suppress unused warning. + + ret = std::tr1::isfinite(x); + ret = std::tr1::isinf(x); + ret = std::tr1::isnan(x); + ret = std::tr1::isnormal(x); + + ret = std::tr1::isgreater(x, x); + ret = std::tr1::isgreaterequal(x, x); + ret = std::tr1::isless(x, x); + ret = std::tr1::islessequal(x, x); + ret = std::tr1::islessgreater(x, x); + ret = std::tr1::isunordered(x, x); + ret = ret; // Suppress unused warning. + } + +void test01() +{ + test01_do<float>(); + test01_do<double>(); + test01_do<long double>(); +} + +#endif +#endif diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/types_std_tr1.cc new file mode 100644 index 000000000..8786c8eff --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/types_std_tr1.cc @@ -0,0 +1,34 @@ +// { dg-do compile } + +// 2006-03-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.16 Additions to header <cmath> + +#include <tr1/cmath> + +void test01() +{ +#if _GLIBCXX_USE_C99_MATH_TR1 + + typedef std::tr1::double_t my_double_t; + typedef std::tr1::float_t my_float_t; + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/50880.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/50880.cc new file mode 100644 index 000000000..eaa2f3d81 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/50880.cc @@ -0,0 +1,51 @@ +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/complex> +#include <testsuite_hooks.h> + +template<typename T> + void test01_do() + { + bool test __attribute__((unused)) = true; + + const std::complex<T> ca(T(-2), T(2)); + const std::complex<T> cb(T(-2), T(0)); + const std::complex<T> cc(T(-2), T(-2)); + + std::complex<T> cra = std::tr1::acosh(ca); + std::complex<T> crb = std::tr1::acosh(cb); + std::complex<T> crc = std::tr1::acosh(cc); + + VERIFY( cra.real() > T(0) ); + VERIFY( crb.real() > T(0) ); + VERIFY( crc.real() > T(0) ); + } + +// libstdc++/50880 +void test01() +{ + test01_do<float>(); + test01_do<double>(); + test01_do<long double>(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/51083.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/51083.cc new file mode 100644 index 000000000..f41914ee9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/51083.cc @@ -0,0 +1,54 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/complex> + +namespace a +{ + template<typename> class Mat { }; + + template<typename T> struct Mat2 : Mat<T> { }; + + template<typename T> int arg(Mat<T>) { return 1; } + template<typename T> int conj(Mat<T>) { return 1; } + template<typename T> int imag(Mat<T>) { return 1; } + template<typename T> int norm(Mat<T>) { return 1; } + template<typename T> int proj(Mat<T>) { return 1; } + template<typename T> int real(Mat<T>) { return 1; } + + template<typename T, typename U> int pow(Mat<T>, U) { return 1; } + template<typename T, typename U> int pow(T, Mat<U>) { return 1; } +} + +int main() +{ + int __attribute__((unused)) i; + + using namespace std::tr1; + + a::Mat2< std::complex<double> > c; + i = arg(c); + i = conj(c); + i = imag(c); + i = norm(c); + i = proj(c); + i = real(c); + i = pow(std::complex<float>(), c); + i = pow(c, std::complex<float>()); +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc new file mode 100644 index 000000000..3560d4fd4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc @@ -0,0 +1,48 @@ +// { dg-do compile } + +// 2006-01-10 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.1 Additions to header <complex> + +#include <tr1/complex> + +template<typename T> + void test01_do() + { + typedef std::complex<T> cmplx_type; + + cmplx_type ans; + + ans = std::tr1::acos(cmplx_type(1.0, 1.0)); + ans = std::tr1::asin(cmplx_type(1.0, 1.0)); + ans = std::tr1::atan(cmplx_type(1.0, 1.0)); + + ans = std::tr1::acosh(cmplx_type(1.0, 1.0)); + ans = std::tr1::asinh(cmplx_type(1.0, 1.0)); + ans = std::tr1::atanh(cmplx_type(1.0, 1.0)); + ans = std::tr1::fabs(cmplx_type(1.0, 1.0)); + } + +void test01() +{ + test01_do<float>(); + test01_do<double>(); + test01_do<long double>(); +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/overloads_float.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/overloads_float.cc new file mode 100644 index 000000000..1e12cdba2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/overloads_float.cc @@ -0,0 +1,102 @@ +// { dg-do compile } + +// 2006-01-12 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.1 Additions to header <complex> + +#include <tr1/complex> +#include <testsuite_tr1.h> + +void test01() +{ + using __gnu_test::check_ret_type; + + typedef std::complex<float> cmplx_f_type; + typedef std::complex<double> cmplx_d_type; + typedef std::complex<long double> cmplx_ld_type; + + const float f1 = 1.0f; + const double d1 = 1.0; + const long double ld1 = 1.0l; + + const cmplx_f_type c_f1(f1, f1); + const cmplx_d_type c_d1(d1, d1); + const cmplx_ld_type c_ld1(ld1, ld1); + + check_ret_type<float>(std::tr1::arg(f1)); + check_ret_type<double>(std::tr1::arg(d1)); + check_ret_type<long double>(std::tr1::arg(ld1)); + + check_ret_type<cmplx_f_type>(std::tr1::conj(f1)); + check_ret_type<cmplx_d_type>(std::tr1::conj(d1)); + check_ret_type<cmplx_ld_type>(std::tr1::conj(ld1)); + + check_ret_type<float>(std::tr1::imag(f1)); + check_ret_type<double>(std::tr1::imag(d1)); + check_ret_type<long double>(std::tr1::imag(ld1)); + + check_ret_type<float>(std::tr1::norm(f1)); + check_ret_type<double>(std::tr1::norm(d1)); + check_ret_type<long double>(std::tr1::norm(ld1)); + + check_ret_type<cmplx_f_type>(std::tr1::polar(f1, f1)); + check_ret_type<cmplx_d_type>(std::tr1::polar(d1, f1)); + check_ret_type<cmplx_d_type>(std::tr1::polar(f1, d1)); + check_ret_type<cmplx_d_type>(std::tr1::polar(d1, d1)); + check_ret_type<cmplx_ld_type>(std::tr1::polar(ld1, d1)); + check_ret_type<cmplx_ld_type>(std::tr1::polar(d1, ld1)); + check_ret_type<cmplx_ld_type>(std::tr1::polar(ld1, f1)); + check_ret_type<cmplx_ld_type>(std::tr1::polar(f1, ld1)); + check_ret_type<cmplx_ld_type>(std::tr1::polar(ld1, ld1)); + + check_ret_type<cmplx_f_type>(std::tr1::pow(c_f1, f1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(c_d1, f1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(c_f1, d1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(c_d1, d1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_ld1, d1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_d1, ld1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_ld1, f1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_f1, ld1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_ld1, ld1)); + + check_ret_type<cmplx_f_type>(std::tr1::pow(f1, c_f1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(d1, c_f1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(f1, c_d1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(d1, c_d1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(ld1, c_d1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(d1, c_ld1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(ld1, c_f1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(f1, c_ld1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(ld1, c_ld1)); + + check_ret_type<cmplx_f_type>(std::tr1::pow(c_f1, c_f1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(c_d1, c_f1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(c_f1, c_d1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(c_d1, c_d1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_ld1, c_d1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_d1, c_ld1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_ld1, c_f1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_f1, c_ld1)); + check_ret_type<cmplx_ld_type>(std::tr1::pow(c_ld1, c_ld1)); + + check_ret_type<float>(std::tr1::real(f1)); + check_ret_type<double>(std::tr1::real(d1)); + check_ret_type<long double>(std::tr1::real(ld1)); +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/overloads_int.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/overloads_int.cc new file mode 100644 index 000000000..a8a9bfba3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/overloads_int.cc @@ -0,0 +1,98 @@ +// 2006-01-12 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.1 Additions to header <complex> + +#include <tr1/complex> +#include <testsuite_hooks.h> +#include <testsuite_tr1.h> + +void test01() +{ + bool test __attribute__((unused)) = true; + using __gnu_test::check_ret_type; + + typedef std::complex<float> cmplx_f_type; + typedef std::complex<double> cmplx_d_type; + + const int i1 = 1; + const unsigned u1 = 1; + const long l1 = 1; + const double f1 = 1.0f; + const double d1 = 1.0; + + check_ret_type<double>(std::tr1::arg(i1)); + VERIFY( std::tr1::arg(i1) == std::tr1::arg(double(i1)) ); + VERIFY( std::tr1::arg(i1) == std::tr1::arg(cmplx_d_type(double(i1))) ); + + check_ret_type<cmplx_d_type>(std::tr1::conj(i1)); + VERIFY( std::tr1::conj(i1) == std::tr1::conj(double(i1)) ); + VERIFY( std::tr1::conj(i1) == std::tr1::conj(cmplx_d_type(double(i1))) ); + + check_ret_type<double>(std::tr1::imag(i1)); + VERIFY( std::tr1::imag(i1) == std::tr1::imag(double(i1)) ); + VERIFY( std::tr1::imag(i1) == std::tr1::imag(cmplx_d_type(double(i1))) ); + + check_ret_type<double>(std::tr1::norm(i1)); + VERIFY( std::tr1::norm(i1) == std::tr1::norm(double(i1)) ); + // std::norm<const complex<>&) is mathematically equivalent to just + // this for a real, but the general algorithm goes through std::abs + // and a multiplication. + VERIFY( std::tr1::norm(i1) == double(i1) * double(i1) ); + + // NB: The existing std::polar wins and a cmplx_i_type is returned. + // check_ret_type<cmplx_d_type>(std::tr1::polar(i1, i1)); + // VERIFY( std::tr1::polar(i1, i1) + // == std::tr1::polar(double(i1), double(i1)) ); + typedef std::complex<int> cmplx_i_type; + check_ret_type<cmplx_i_type>(std::tr1::polar(i1, i1)); + + check_ret_type<cmplx_d_type>(std::tr1::pow(cmplx_f_type(f1, f1), i1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(cmplx_f_type(f1, f1), u1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(cmplx_f_type(f1, f1), l1)); + check_ret_type<cmplx_d_type>(std::tr1::pow(cmplx_d_type(d1, d1), i1)); + + VERIFY( std::tr1::pow(cmplx_d_type(d1, d1), i1) + == std::tr1::pow(cmplx_d_type(d1, d1), double(i1)) ); + VERIFY( std::tr1::pow(cmplx_d_type(d1, d1), u1) + == std::tr1::pow(cmplx_d_type(d1, d1), double(u1)) ); + VERIFY( std::tr1::pow(cmplx_d_type(d1, d1), l1) + == std::tr1::pow(cmplx_d_type(d1, d1), double(l1)) ); + + check_ret_type<cmplx_d_type>(std::tr1::pow(i1, cmplx_f_type(f1, f1))); + check_ret_type<cmplx_d_type>(std::tr1::pow(u1, cmplx_f_type(f1, f1))); + check_ret_type<cmplx_d_type>(std::tr1::pow(l1, cmplx_f_type(f1, f1))); + check_ret_type<cmplx_d_type>(std::tr1::pow(i1, cmplx_d_type(d1, d1))); + VERIFY( std::tr1::pow(i1, cmplx_d_type(d1, d1)) + == std::tr1::pow(double(i1), cmplx_d_type(d1, d1)) ); + VERIFY( std::tr1::pow(u1, cmplx_d_type(d1, d1)) + == std::tr1::pow(double(u1), cmplx_d_type(d1, d1)) ); + VERIFY( std::tr1::pow(l1, cmplx_d_type(d1, d1)) + == std::tr1::pow(double(l1), cmplx_d_type(d1, d1)) ); + + check_ret_type<double>(std::tr1::real(i1)); + VERIFY( std::tr1::real(i1) == std::tr1::real(double(i1)) ); + VERIFY( std::tr1::real(i1) == std::tr1::real(cmplx_d_type(double(i1))) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc new file mode 100644 index 000000000..34cd791bc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc @@ -0,0 +1,57 @@ +// { dg-do compile } +// { dg-require-cstdint "" } + +// 2006-01-29 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.22 Header <cstdint> + +#include <tr1/cstdint> + +void test01() +{ + typedef std::tr1::int8_t my_int8_t; + typedef std::tr1::int16_t my_int16_t; + typedef std::tr1::int32_t my_int32_t; + typedef std::tr1::int64_t my_int64_t; + typedef std::tr1::int_fast8_t my_int_fast8_t; + typedef std::tr1::int_fast16_t my_int_fast16_t; + typedef std::tr1::int_fast32_t my_int_fast32_t; + typedef std::tr1::int_fast64_t my_int_fast64_t; + typedef std::tr1::int_least8_t my_int_least8_t; + typedef std::tr1::int_least16_t my_int_least16_t; + typedef std::tr1::int_least32_t my_int_least32_t; + typedef std::tr1::int_least64_t my_int_least64_t; + typedef std::tr1::intmax_t my_intmax_t; + typedef std::tr1::intptr_t my_intptr_t; + typedef std::tr1::uint8_t my_uint8_t; + typedef std::tr1::uint16_t my_uint16_t; + typedef std::tr1::uint32_t my_uint32_t; + typedef std::tr1::uint64_t my_uint64_t; + typedef std::tr1::uint_fast8_t my_uint_fast8_t; + typedef std::tr1::uint_fast16_t my_uint_fast16_t; + typedef std::tr1::uint_fast32_t my_uint_fast32_t; + typedef std::tr1::uint_fast64_t my_uint_fast64_t; + typedef std::tr1::uint_least8_t my_uint_least8_t; + typedef std::tr1::uint_least16_t my_uint_least16_t; + typedef std::tr1::uint_least32_t my_uint_least32_t; + typedef std::tr1::uint_least64_t my_uint_least64_t; + typedef std::tr1::uintmax_t my_uintmax_t; + typedef std::tr1::uintptr_t my_uintptr_t; +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdio/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdio/functions.cc new file mode 100644 index 000000000..338902522 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdio/functions.cc @@ -0,0 +1,52 @@ +// { dg-do compile } + +// 2006-02-05 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.24 Additions to header <cstdio> + +#include <tr1/cstdio> +#include <cstdarg> +#include <cstddef> + +void test01(int dummy, ...) +{ + std::va_list ap; + va_start(ap, dummy); + +#if _GLIBCXX_USE_C99 + + char* s = 0; + const char* cs = 0; + const char* format = "%i"; + FILE* stream = 0; + std::size_t n = 0; + + int ret; + + ret = std::tr1::snprintf(s, n, format, dummy); + ret = std::tr1::vsnprintf(s, n, format, ap); + + ret = std::tr1::vfscanf(stream, format, ap); + ret = std::tr1::vscanf(format, ap); + ret = std::tr1::vsscanf(cs, format, ap); + ret = ret; // Suppress unused warning. + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/functions.cc new file mode 100644 index 000000000..f9b88dca9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/functions.cc @@ -0,0 +1,73 @@ +// { dg-do compile } + +// 2006-02-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.25 Additions to header <cstdlib> + +#include <tr1/cstdlib> + +#if _GLIBCXX_HOSTED + +void test01() +{ +#if _GLIBCXX_USE_C99 + + long long i = 0; + const char* s = 0; + char** endptr = 0; + int base = 0; + + long long ret; + unsigned long long uret; + float fret; + long double ldret; + +#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC + long long numer = 0, denom = 0; + std::tr1::lldiv_t dret; + + ret = std::tr1::llabs(i); + dret = std::tr1::lldiv(numer, denom); +#endif + + ret = std::tr1::atoll(s); + ret = std::tr1::strtoll(s, endptr, base); + uret = std::tr1::strtoull(s, endptr, base); + + fret = std::tr1::strtof(s, endptr); + ldret = std::tr1::strtold(s, endptr); + + ret = std::tr1::abs(i); + + ret = ret; // Suppress unused warning. + uret = uret; + fret = fret; + ldret = ldret; + +#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC + dret = std::tr1::div(numer, denom); + + dret = dret; +#endif + +#endif +} + +#endif diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc new file mode 100644 index 000000000..cb00cf4b8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc @@ -0,0 +1,37 @@ +// { dg-do compile } + +// 2006-02-07 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.25 Additions to header <cstdlib> + +#include <tr1/cstdlib> + +#if _GLIBCXX_HOSTED + +void test01() +{ +#if _GLIBCXX_USE_C99 + + typedef std::tr1::lldiv_t my_lldiv_t; + +#endif +} + +#endif diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc new file mode 100644 index 000000000..0320c9a5a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc @@ -0,0 +1,90 @@ +// { dg-do compile } + +// 2006-02-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.6 Additions to header <cwchar> + +#include <tr1/cwchar> +#include <cstdio> +#include <cstdarg> + +#if _GLIBCXX_USE_WCHAR_T + +void test01(int dummy, ...) +{ + std::va_list arg; + va_start(arg, dummy); + +#if _GLIBCXX_HAVE_WCSTOF + const wchar_t* nptr1 = 0; + wchar_t** endptr1 = 0; + float fret; + fret = std::tr1::wcstof(nptr1, endptr1); + + fret = fret; // Suppress unused warning. +#endif + +#if _GLIBCXX_HAVE_VFWSCANF + FILE* stream = 0; + const wchar_t* format1 = 0; + int ret1; + ret1 = std::tr1::vfwscanf(stream, format1, arg); + + ret1 = ret1; // Suppress unused warning. +#endif + +#if _GLIBCXX_HAVE_VSWSCANF + const wchar_t* s = 0; + const wchar_t* format2 = 0; + int ret2; + ret2 = std::tr1::vswscanf(s, format2, arg); + + ret2 = ret2; // Suppress unused warning. +#endif + +#if _GLIBCXX_HAVE_VWSCANF + const wchar_t* format3 = 0; + int ret3; + ret3 = std::tr1::vwscanf(format3, arg); + + ret3 = ret3; // Suppress unused warning. +#endif + +#if _GLIBCXX_USE_C99 + + const wchar_t* nptr2 = 0; + wchar_t** endptr2 = 0; + long double ldret; + ldret = std::tr1::wcstold(nptr2, endptr2); + + int base = 0; + long long llret; + unsigned long long ullret; + llret = std::tr1::wcstoll(nptr2, endptr2, base); + ullret = std::tr1::wcstoull(nptr2, endptr2, base); + + ldret = ldret; // Suppress unused warnings. + llret = llret; + ullret = ullret; + +#endif +} + +#endif diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwctype/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwctype/functions.cc new file mode 100644 index 000000000..031b3ac16 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwctype/functions.cc @@ -0,0 +1,40 @@ +// { dg-do compile } + +// 2006-02-03 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 8.32 Additions to header <cwctype> + +#include <tr1/cwctype> + +#if _GLIBCXX_USE_WCHAR_T + +void test01() +{ +#if _GLIBCXX_HAVE_ISWBLANK + + std::wint_t ch = 0; + int ret; + ret = std::tr1::iswblank(ch); + ret = ret; // Suppress unused warning. + +#endif +} + +#endif diff --git a/libstdc++-v3/testsuite/tr1/headers/all.cc b/libstdc++-v3/testsuite/tr1/headers/all.cc new file mode 100644 index 000000000..279872a7f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/headers/all.cc @@ -0,0 +1,63 @@ +// { dg-do compile } + +// 2006-02-02 Paolo Carlini <pcarlini@suse.de> +// +// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/array> +#include <tr1/ccomplex> +#include <tr1/cctype> +#include <tr1/cfenv> +#include <tr1/cfloat> +#include <tr1/cinttypes> +#include <tr1/climits> +#include <tr1/cmath> +#include <tr1/complex> +#include <tr1/complex.h> +#include <tr1/cstdarg> +#include <tr1/cstdbool> +#include <tr1/cstdint> +#include <tr1/cstdio> +#include <tr1/cstdlib> +#include <tr1/ctgmath> +#include <tr1/ctime> +#include <tr1/ctype.h> +#include <tr1/cwchar> +#include <tr1/cwctype> +#include <tr1/fenv.h> +#include <tr1/float.h> +#include <tr1/functional> +#include <tr1/inttypes.h> +#include <tr1/limits.h> +#include <tr1/math.h> +#include <tr1/memory> +#include <tr1/random> +#include <tr1/regex> +#include <tr1/stdarg.h> +#include <tr1/stdbool.h> +#include <tr1/stdint.h> +#include <tr1/stdio.h> +#include <tr1/stdlib.h> +#include <tr1/tgmath.h> +#include <tr1/tuple> +#include <tr1/type_traits> +#include <tr1/unordered_set> +#include <tr1/unordered_map> +#include <tr1/utility> +#include <tr1/wchar.h> +#include <tr1/wctype.h> diff --git a/libstdc++-v3/testsuite/tr1/headers/c++200x/complex.cc b/libstdc++-v3/testsuite/tr1/headers/c++200x/complex.cc new file mode 100644 index 000000000..1df97013a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/headers/c++200x/complex.cc @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// check for duplicates of complex overloads of acos, asin, atan and fabs + +#include <complex> +#include <tr1/cmath> +#include <tr1/complex> + diff --git a/libstdc++-v3/testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc b/libstdc++-v3/testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc new file mode 100644 index 000000000..01056624e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc @@ -0,0 +1,26 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/tuple> + +namespace gnu +{ + using namespace std::tr1; +} diff --git a/libstdc++-v3/testsuite/tr1/headers/using_namespace_std_tr1.cc b/libstdc++-v3/testsuite/tr1/headers/using_namespace_std_tr1.cc new file mode 100644 index 000000000..9136c7ac4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/headers/using_namespace_std_tr1.cc @@ -0,0 +1,25 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <tr1/tuple> + +namespace gnu +{ + using namespace std::tr1; +} |