🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #292

Re: Revised version of zzeta.4th

#292
From: Krishna Myneni
Date: Sun, 06 Dec 2026 00:59
145 lines
7333 bytes
On 12/5/26 5:58 AM, albert@spenarnc.xs4all.nl wrote:
> In article <11evfi7$247ho$1@dont-email.me>,
> Krishna Myneni  <krishna.myneni@ccreweb.org> wrote:
>> On 12/4/26 4:09 AM, albert@spenarnc.xs4all.nl wrote:
>>> In article <11esorj$t3h2$1@dont-email.me>,
>>> Krishna Myneni  <krishna.myneni@ccreweb.org> wrote:
>>> <SNIP>
>>>> I expect the relative error numbers will improve substantially with
>>>> better knowledge of how the number of terms should grow as we move
>>>> farther from the real axis, for the algorithm used here.
>>>
>>> A little of a side note. Riemann himself succeeded to calculate
>>> the first zero with two decimal places: 13.14. (A youtube video about
>>> this.)
>>> Does anybody understand how he does it, and is it related to the
>>> method used in the Forth words?
>>
>> In order to calculate the roots he first had to be able to calculate the
>> complex function, which he gave as a series sum. I remember reading
>> about how he actually calculated the complex zeta function in the
>> wikipedia article (see Riemann Zeta Function), but it might have been a
>> brute force evaluation of terms. The root finding will involve many
>> iterations of computing the function.
> 
> I have brute forced some of the Euler problems at the expense of
> days calculation time. It is certain that Riemann couldn't have done
> that.
> 

Agreed. Upon further reading, it looks like he used what is referred to 
now as the Riemann-Siegel formula for the zeta function. That is not the 
algorithm used in zzeta.4th (it uses Borwein's method). The 
Riemann-Siegel method is apparently better suited to finding the roots 
along the critical line, for large offsets from the real axis.

> What I understood, that you start with transforming the zeta function.
> Terms grow in absolute as sqrt(N) (on the critical line)
> where only the cos(N...) +i.sin(N..) serves to cancel each other out.
> The transformation trick is (as far I can see) to get minus signs on
> terms, such that some cancellation occurs.
>

There are alternating signs as well in the Borwein formula; however, it 
is not easily apparent from the code.
>>
>> I haven't used a root finder to actually find the roots. I evaluated the
>> complex function (with a complex argument) using the known roots to
>> verify that the real and imaginary parts of the zeta function go to zero
>> at those points. That was the table of 11 evaluations which I posted
>> earlier in a separate thread.
>>
>> IIRC David Williams wrote a root finder which could obtain complex
>> roots, but I don't remember if it generalized to complex functions. It
>> is in the FSL and it is called lagroots.x.
>> ...

lagroots.4th is not suitable. It is specifically for roots of 
polynomials with complex coefficients. See below.
> Now that the Riemann hypothesis is proved, you are entitled to restrict the
> calculation to the critical line.
>I won't go that far yet. There are some 70,000 machine-generated lines 
to check by humans (originally 18 million lines, but later simplified to 
70,000 with the aid of AI). It will take months or years for people to 
verify the AI proof.

I have written and tested a root finder for use with zzeta.4th v 1.1, 
using FSL #7, regfalsi.4th. It demonstrates finding the first ten roots 
to a precision of about 15 digits, using double precision floating 
point. The output of the code is shown below, and the notes from the 
code are also shown. Because of the length, I will add the program, 
zeta-roots.4th, to the kForth repos and post a link once it is available 
online.

--
Krishna

=== begin output ===
... [Startup output with includes omitted]

Finding zeta function roots between t = 1 and 50
'1.0e0 50.0e0 0.1e zeta-roots'
   10 roots found:
'print-roots'
    1  1/2  +  i 14.13472514173477
    2  1/2  +  i 21.02203963877155
    3  1/2  +  i 25.01085758014571
    4  1/2  +  i 30.42487612585951
    5  1/2  +  i 32.93506158773986
    6  1/2  +  i 37.58617815882567
    7  1/2  +  i 40.91871901214692
    8  1/2  +  i 43.32707328091517
    9  1/2  +  i 48.00515124233806
   10  1/2  +  i 49.77383247767230
  ok
=== end output ===

=== begin code zeta-roots.4th ===
\ zeta-roots.4th
\
\ Find the first 10 roots of the Riemann Zeta function
\ along the critical line, s = 1/2 + i t
\
\ K. Myneni, krishna.myneni@ccreweb.org
\ Last revised: 2026-12-05
\
\ Notes:
\
\ 1. Algorithm:
\    a) Find intervals of zero crossings of Re{ Zeta(s) }.
\    b) Find intervals of zero crossings of Im{ Zeta(s) }.
\    c) Find common zero crossing intervals for both
\       Re{Zeta} and Im{Zeta}.
\    d) Compute the roots within the common intervals.
\    e) Keep only roots of Re{ Zeta(s) } and Im{ Zeta(s) }
\       which are the same to within a given tolerance.
\
\ 2. Find the roots of the real functions, Re{ Zeta(s) }
\    and Im{ Zeta(s) } using FSL algorithm #7, regfalsi.4th.
\
\ 3. The interval width passed to the main word ZETA-ROOTS
\    must be chosen carefully. This parameter controls the
\    number of intervals used over the range of 't' along
\    the critical line, and it should be small enough to
\    bracket each root separately. I found a width of 0.1
\    was sufficient for the first ten roots.
\
\ 4. The present zzeta.4th (v1.1) code blows up past
\    t = 53. At most, 11 roots may be found by extending
\    the range of t.
\
\ 5. This code demonstrates use of several portable Forth
\    libraries:
\      a) use of FSL integer, floating point, and
\         complex arrays and matrices,
\      b) use of both static ALLOTment and dynamic
\         ALLOCATEion of matrices,
\      c) utility of the IEEE 754 word FSIGNBIT for
\         finding zero crossings,
\      d) use of the floating point output word F.N.
\
\ 6. Runs under kForth-64/32/Win32 using the files
\    INCLUDEd below.
...
=== output truncated ===
Technical Details
Message-ID: <11f2c2e$3h304$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11esorj$t3h2$1@dont-email.me> <nnd$7e778b0b$494c64ab@f355f0a92757abc7> <11evfi7$247ho$1@dont-email.me> <nnd$696a84bd$20809f2a@34fe3af6e1aea5b2>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Krishna Myneni <krishna.myneni@ccreweb.org>
Newsgroups: comp.lang.forth
Subject: Re: Revised version of zzeta.4th
Date: Sat, 5 Dec 2026 18:59:58 -0600
Organization: A noiseless patient Spider
Lines: 145
Message-ID: <11f2c2e$3h304$1@dont-email.me>
References: <11esorj$t3h2$1@dont-email.me>
 <nnd$7e778b0b$494c64ab@f355f0a92757abc7> <11evfi7$247ho$1@dont-email.me>
 <nnd$696a84bd$20809f2a@34fe3af6e1aea5b2>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 06 Dec 2026 00:59:59 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3705860"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/mGzNeKJuSTKwxuteAZWE1"; posting-host="566af3133771ccbd0b783b2e37713b6a"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nHXqNXC/fbhffRSRHWnJj8MYA3s= sha256:Pe2s8yEQHq0xdz8hKBfSH8bQKMLn7bXNC1r8298BYDA=
	sha1:633FYG0dAvNy4J8hDpD55va3x2U= sha256:ere4fSE4Rxxjp+GnLorVCf5iCyLkCEpKz7ncWNShs0c=
In-Reply-To: <nnd$696a84bd$20809f2a@34fe3af6e1aea5b2>
Content-Language: en-US