Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/math/tools/generate_test_values.cpp @ 33

Last change on this file since 33 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 901 bytes
Line 
1//  (C) Copyright John Maddock 2005.
2//  Use, modification and distribution are subject to the
3//  Boost Software License, Version 1.0. (See accompanying file
4//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6#ifndef NTL_STD_CXX
7#  define NTL_STD_CXX
8#endif
9
10#include <ntl/RR.h>
11#include <iostream>
12#include <iomanip>
13
14int main()
15{
16   NTL::RR r, root_two;
17   r.SetPrecision(256);
18   root_two.SetPrecision(256);
19   r = 1.0;
20   root_two = 2.0;
21   root_two = NTL::sqrt(root_two);
22   r /= root_two;
23   NTL::RR lim = NTL::pow(NTL::RR(NTL::INIT_VAL, 2.0), NTL::RR(NTL::INIT_VAL, -128));
24   NTL::RR::SetOutputPrecision(40);
25   while(r > lim)
26   {
27      std::cout << "   { " << r << "L, " << NTL::log1p(r) << "L, " << NTL::expm1(r) << "L, }, \n";
28      std::cout << "   { " << -r << "L, " << NTL::log1p(-r) << "L, " << NTL::expm1(-r) << "L, }, \n";
29      r /= root_two;
30   }
31   return 0;
32}
Note: See TracBrowser for help on using the repository browser.