Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.math > #325439

Fast computation of first Chebyshev function theta(x) in quad precision

From David Bernier <david250@videotron.ca>
Newsgroups sci.math
Subject Fast computation of first Chebyshev function theta(x) in quad precision
Date 2016-01-03 10:19 -0500
Organization A noiseless patient Spider
Message-ID <n6be0d$krd$1@dont-email.me> (permalink)

Show all headers | View raw


I use Primesieve siever by Kim Walisch.

The argument 'x' is always such that pi(x) is a
multiple of 256, at the moment.

The Program finds in  2 minutes 11 seconds :

k = 32767996298 ...
vartheta(32767996298) = 32767816566.011100421399628405938

theta(32767996298) =    32767816566.011100421399628405895
// gp calculator

Chebyshev first function :

< https://en.wikipedia.org/wiki/Chebyshev_function > .


Right now, the C source code used is below:

---------- synthesis24.c ----------------------

#include <primesieve.h>
#include <stdio.h>
#include <stdlib.h>
#include <quadmath.h>

int main(void) {
  unsigned long long lastp;
  unsigned long long k;
  int dogo;
   __float128 f0;
   __float128 f1;
  int counter;
  primesieve_iterator pi;
  __float128 product_primes;
  __float128 sum_log_primes;

  primesieve_init(&pi);
  uint64_t prime = 0;
  f0 = (__float128) 0;
  f1 = (__float128) 1;

  dogo = 1;
  product_primes = f1;
  sum_log_primes  = f0;

  k = 32767996298ull;

  printf("k = %ld ...\n", k);
  fflush(stdout);

  while(dogo == 1)
  {
        for(counter = 0; counter < 256; counter++)
        {
           prime = primesieve_next_prime(&pi);
           lastp = prime;
           if(lastp <= k )
           {
              product_primes  = product_primes*((__float128)lastp) ;
           }
        }

        sum_log_primes = sum_log_primes + logq(product_primes);

        if(lastp > k)
        {
           dogo = 0;
        }

        product_primes = f1;
  }


  printf("vartheta(%ld) = %.32Qf\n", k, sum_log_primes);


  primesieve_free_iterator(&pi);
  return 0;
}

---------------------------------------------------------------


David Bernier



-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

Back to sci.math | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Fast computation of first Chebyshev function theta(x) in quad precision David Bernier <david250@videotron.ca> - 2016-01-03 10:19 -0500
  Re: Fast computation of first Chebyshev function theta(x) in quad precision David Bernier <david250@videotron.ca> - 2016-01-03 13:32 -0500
    Re: Fast computation of first Chebyshev function theta(x) in quad precision David Bernier <david250@videotron.ca> - 2016-01-05 12:16 -0500
      Re: Fast computation of first Chebyshev function theta(x) in quad precision David Bernier <david250@videotron.ca> - 2016-01-26 11:50 -0500

csiph-web