@@ -371,14 +371,14 @@ periods_via_lfchi::periods_via_lfchi (const level* iN, const newform* f)
371371 rootmod = sqrt (to_bigfloat (N));
372372 factor1 = exp (-(TWOPI)/ (to_bigfloat (chi1.modulus ()) * rootmod));
373373 factor2 = exp (-(TWOPI)/ (to_bigfloat (chi2.modulus ()) * rootmod));
374- long dp = decimal_precision ();
374+ long bp = bit_precision ();
375375 // MUST keep brackets around TWOPI!:
376- bigfloat rootlimit1=(dp*LOG10 -log (1 -factor1))*rootmod/(TWOPI) ;
377- bigfloat rootlimit2=(dp*LOG10 -log (1 -factor1))*rootmod/(TWOPI) ;
376+ bigfloat rootlimit1=(bp -log (1 -factor1))*rootmod/(TWOPI) ;
377+ bigfloat rootlimit2=(bp -log (1 -factor1))*rootmod/(TWOPI) ;
378378 Iasb (limit1,rootlimit1);
379379 Iasb (limit2,rootlimit2);
380380#ifdef TRACE_USE
381- cout << " Decimal precision = " <<dp <<endl;
381+ cout << " Bit precision = " <<bp <<endl;
382382 cout << " Basic limits on n in sums = " << limit << endl;
383383#endif
384384 limit1=chi1.modulus ()*limit1;
@@ -390,7 +390,7 @@ periods_via_lfchi::periods_via_lfchi (const level* iN, const newform* f)
390390#endif
391391/*
392392 if(primelist[primelist.size()-1]<limit)
393- cout<<"\nLARGEST PRIME "<<primelist[primelist.size()-1]<<" IS BELOW LIMIT "<< limit <<" required for decimal precision "<<dp <<endl;
393+ cout<<"\nLARGEST PRIME "<<primelist[primelist.size()-1]<<" IS BELOW LIMIT "<< limit <<" required for bit precision "<<bp <<endl;
394394*/
395395 rootlimit=sqrt (to_bigfloat (limit));
396396 an_cache.resize (I2long (Ifloor (rootlimit+1 )),0 );
@@ -465,9 +465,9 @@ void periods_direct::compute(void)
465465 b = posmod (b,d);
466466 c = posmod (c,d);
467467 factor2 = factor1 * drecip;
468- long dp = decimal_precision ();
469- Iasb (limit1,(-dp*LOG10 -log ((1 -exp (factor1))/3 ))/(factor1)) ;
470- Iasb (limit2,(-dp*LOG10 -log ((1 -exp (factor2))/3 ))/(factor2)) ;
468+ long bp = bit_precision ();
469+ Iasb (limit1,(-bp -log ((1 -exp (factor1))/3 ))/(factor1)) ;
470+ Iasb (limit2,(-bp -log ((1 -exp (factor2))/3 ))/(factor2)) ;
471471
472472 limit = limit2;
473473 rootlimit=sqrt (to_bigfloat (limit));
@@ -479,7 +479,7 @@ void periods_direct::compute(void)
479479#endif
480480/*
481481 if(primelist[primelist.size()-1]<limit)
482- cout<<"\nLARGEST PRIME "<<primelist[primelist.size()-1]<<" IS BELOW LIMIT "<< limit <<" required for decimal precision "<<dp <<endl;
482+ cout<<"\nLARGEST PRIME "<<primelist[primelist.size()-1]<<" IS BELOW LIMIT "<< limit <<" required for bit precision "<<bp <<endl;
483483*/
484484#ifdef TRACE_CACHE
485485 cout << " Initial an_cache = " <<an_cache<<endl;
@@ -555,8 +555,8 @@ void part_period::compute(const bigcomplex& z0)
555555
556556void part_period::compute ()
557557{
558- long dp = decimal_precision ();
559- Iasb (limit,dp*LOG10 /y0);
558+ long bp = bit_precision ();
559+ Iasb (limit,bp /y0);
560560 limit1=limit2=limit;
561561 rootlimit=sqrt (to_bigfloat (limit));
562562 an_cache.resize (I2long (Ifloor (rootlimit+1 )),0 );
@@ -595,7 +595,7 @@ void ldash1::init(const level* iN, const vector<long>& f_aplist, long f_sfe, con
595595 rootmod=sqrt (to_bigfloat (N));
596596 factor1 = (TWOPI)/rootmod;
597597 long maxp = prime_number (nap);
598- limit = I2long (Ifloor ((15 + decimal_precision ())* log ( 10 )/factor1));
598+ limit = I2long (Ifloor ((30 + bit_precision () )/factor1));
599599 if (limit>maxp) limit=maxp;
600600 limit1 = limit;
601601 rootlimit=sqrt (to_bigfloat (limit));
@@ -636,8 +636,8 @@ lfchi::lfchi (const level* iN, const newform* f)
636636{
637637 initaplist (iN, f->aplist );
638638 rootmod = sqrt (to_bigfloat (N));
639- long dp = decimal_precision ();
640- Iasb (limit0,dp*LOG10 *rootmod/(TWOPI)) ; // brackets essential
639+ long bp = bit_precision ();
640+ Iasb (limit0,bp *rootmod/(TWOPI)) ; // brackets essential
641641}
642642
643643void lfchi::compute (long ell)
@@ -843,7 +843,7 @@ Curve newforms::getcurve(long i, int method, bigfloat& rperiod, int verbose)
843843 if ((abs ((wR-wRC)/wRC)>0.0001 ))
844844 {
845845 cout<<" Real period of constructed curve does not match that"
846- <<" of the newform (using decimal precision " <<decimal_precision ()<<" )" <<endl;
846+ <<" of the newform (using bit precision " <<bit_precision ()<<" )" <<endl;
847847 cout<<" Real period of C: " <<real (wRC)<<endl;
848848 cout<<" Real period of f: " <<real (wR)<<endl;
849849 cout<<" Ratio = " <<real (wR)/real (wRC)<<endl;
@@ -852,7 +852,7 @@ Curve newforms::getcurve(long i, int method, bigfloat& rperiod, int verbose)
852852 if ((abs ((wRI-wRIC)/wRIC)>0.0001 ))
853853 {
854854 cout<<" Second period of constructed curve does not match that"
855- <<" of the newform (using decimal precision " <<decimal_precision ()<<" )" <<endl;
855+ <<" of the newform (using bit precision " << bit_precision ()<<" )" <<endl;
856856 cout<<" Imag part of second period of C: " <<real (wRIC)<<endl;
857857 cout<<" Imag part of second period of f: " <<real (wRI)<<endl;
858858 cout<<" Ratio of imaginary parts = " <<real (wRI)/real (wRIC)<<endl;
@@ -1034,7 +1034,8 @@ bigfloat G(int r, bigfloat x) // G_r(x)
10341034#ifndef MPFP // Multi-Precision Floating Point
10351035 static const bigfloat x0 = to_bigfloat (14 );
10361036#else
1037- static const bigfloat x0 = to_bigfloat (log (10 )*decimal_precision ());
1037+ // log(2) = 0.69314718
1038+ static const bigfloat x0 = to_bigfloat (0.69314718 *bit_precision ());
10381039#endif
10391040 // cout<<"switch point = "<<x0<<endl;
10401041 // cout<<"x="<<x<<endl;
@@ -1058,7 +1059,7 @@ bigfloat ldash1::G(bigfloat x) // G_r(x)
10581059}
10591060
10601061#if (0) // myg2 and myg3 were inaccurate and now replaced by general
1061- // G(r,x) -- whcih also works for r>3!
1062+ // G(r,x) -- which also works for r>3!
10621063bigfloat myg2 (bigfloat x)
10631064{
10641065 static bigfloat zero=to_bigfloat (0 );
0 commit comments