OKlibrary  0.2.1.6
Asymptotics.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 8.5.2010 (Swansea) */
00002 /* Copyright 2010 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007
00022 oklib_include("OKlib/ComputerAlgebra/TestSystem/Lisp/Asserts.mac")\$
00023
00024
00025 kill(f)\$
00026
00027 /* *********************************************
00028    * The formula from [Grosswald. Hagis, 1979] *
00029    *********************************************
00030 */
00031
00032 okltest_C_gh_fin(f) := (
00033   assert(f(2) = 1),
00034   assert(f(3) = 3/2),
00035   assert(f(4) = 9/2),
00036   assert(f(5) = 3375/512),
00037   /* XXX */
00038   true)\$
00039
00040 okltest_C_gh_inf(f) := (
00041   for max_p : 2 thru 7 do
00042     assert(f(2,max_p) = 1),
00043   assert(f(3,3) = 1),
00044   assert(f(3,4) = 1),
00045   assert(f(3,5) = 5^1*(5-3+1)/4^2),
00046   assert(f(3,6) = f(3,5)),
00047   /* XXX */
00048   true)\$
00049
00050 okltest_C_gh_inf_hp(f) := block([fpprec : 30],
00051   for max_p : 2 thru 7 do
00052     assert_bfloat_equal(f(2,max_p), bfloat(1), fpprec),
00053   assert_bfloat_equal(f(3,3), bfloat(1), fpprec),
00054   assert_bfloat_equal(f(3,4), bfloat(1), fpprec),
00055   assert_bfloat_equal(f(3,5), bfloat(5^1*(5-3+1)/4^2), fpprec),
00056   assert(f(3,6) = f(3,5)),
00057   /* XXX */
00058   true)\$
00059
00060
00061
```