News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Riemann Zeta Function

Started by six_L, May 09, 2025, 11:06:09 PM

Previous topic - Next topic

six_L

The Zeta(z) Nontrivial Zero looks like this(Attachment).
Say you, Say me, Say the codes together for ever.

TimoVJL

And what was code for it ?

Long time ago i asked form mathematician, can he show me a mathematical functions for best woman breasts and butts.
I have seen many functions for those and some of them are really good.

For woman breast some GDI functions are very good simulating  those things, but sadly those sources aren't availble right now.
May the source be with you

zedd

Quote from: TimoVJL on May 15, 2025, 12:59:26 AMAnd what was code for it ?
I'll ask an even better question...
"Where is the assembly code for any of it?", even if it is only uasm compatible and not specifically masm compatible (given the board that it is in).

Enquiring minds want to know...  :badgrin:
:biggrin:

six_L

For me, it's just despatching my interesting time when I have excess energy.

But the question of finding prime is very mysterious.
I guess:
Every Riemann Zeta(z) Nontrivial Zero corresponds to a prime number.
Zeta(0.5+bi) = 0
f(0.5+bi) = p
The larget known maxiprime today is 2^136279841-1. If someone finds the function, we'll find the next maxiprime to be easy.

QuoteLong time ago i asked form mathematician, can he show me a mathematical functions for best woman breasts and butts.
I have seen many functions for those and some of them are really good.

For woman breast some GDI functions are very good simulating  those things, but sadly those sources aren't availble right now.
This is a best APP, ought to continue.
Say you, Say me, Say the codes together for ever.

TimoVJL

I was interest, how Complex numbers are handled in pure masm.

Complex numbers are part of C since C99, not supported by Pelles C anymore.
May the source be with you

FORTRANS

Hi,

Quote from: TimoVJL on May 15, 2025, 07:33:29 PMI was interest, how Complex numbers are handled in pure masm.

   I do not think there is any direct support for complex, or imaginary,
arithmetic in MASM.  You would have to implement such actions as macros
or a set of functions.  So you would handle complex numbers with your
own code.

   Of course, someone has probably done this already, and you could use
their implementation.

Regards,

Steve N.

daydreamer

Quote from: TimoVJL on May 15, 2025, 12:59:26 AMAnd what was code for it ?

Long time ago i asked form mathematician, can he show me a mathematical functions for best woman breasts and butts.
I have seen many functions for those and some of them are really good.

For woman breast some GDI functions are very good simulating  those things, but sadly those sources aren't availble right now.

Seen on TV show a woman named "fern",but there is also exist code for draw a fern plant
Might be possible with combine several curves used for creating meshes
I only have managed to created sphere with trigo curves: 1700 half circles drawing a planet,also made an egg shape

Hourglass body = vertical cosine
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

TimoVJL

In C11 specs _Complex data type is just optional.
So many C programmers are now in same position as asm programmers.

@daydreamer, jokes needs their own topic and this is UAsm topic and i was asking masm way to handle complex numbers.
May the source be with you

daydreamer

Quote from: TimoVJL on May 16, 2025, 09:41:30 PMIn C11 specs _Complex data type is just optional.
So many C programmers are now in same position as asm programmers.

@daydreamer, jokes needs their own topic and this is UAsm topic and i was asking masm way to handle complex numbers.
I think math expert raymond might have something in his math library ???
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

six_L

QuoteI was interest, how Complex numbers are handled in pure masm.
for example:
FpuPow proc @Fx:QWORD,@Fy:QWORD
;return: ST(0)=x^y
;x^y =2^[y*log2(x)], x > 0

finit

mov rax,@Fy
fld tbyte ptr[rax] ;y
mov rax,@Fx
fld tbyte ptr[rax] ;x,x11=x11^y
fyl2x ;y*log2(x)
;ST(0)=y*log2(x), ST(1)=zzz
fld  st ;make a second copy
;ST(0)=y*log2(x), ST(1)=y*log2(x), ST(2)=zzz
frndint ;round it to an integer
;ST(0)=int[y*log2(x)], ST(1)=y*log2(x), ST(2)=zzz
fsub st(1),st ;this will leave only a fractional portion in ST(1)
;ST(0)=int[y*log2(x)], ST(1)=y*log2(x)-int[y*log2(x)], ST(2)=zzz
fxch st(1) ;ST(0)=y*log2(x)-int[y*log2(x)], ST(1)=int[y*log2(x)], ST(2)=zzz
f2xm1 ;get the fractional power of 2 (minus 1)
;ST(0)=2ST(0)-1, ST(1)=int[y*log2(x)], ST(2)=zzz
fld1 ;ST(0)=1, ST(1)=2ST(0)-1, ST(2)=int[y*log2(x)], ST(3)=zzz
fadd ;add the 1 to ST(1) and POP ST(0)
;ST(0)=2ST(0), ST(1)=int[y*log2(x)], ST(2)=zzz
fscale ;add the integer in ST(1) to the exponent of ST(0)
;effectively multiplying the content of ST(0) by 2int
;and yielding the final result of x^y
;ST(0)=x^y, ST(1)=int[y*log2(x)], ST(2)=zzz
fstp st(1) ;the content of ST(1) has become useless
;overwrite the content of ST(1) with the result and POP ST(0)
;ST(0)=x^y, ST(1)=zzz
ret

FpuPow endp
;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
EComplexNumberPow proc @inRealPart:QWORD,@inImaginaryPart:QWORD,@OutRealPart:QWORD,@OutImaginaryPart:QWORD
LOCAL @e:REAL10

; e^(a+bi)
; i = (-1)^0.5
; e^(a+bi) = e^a * e^[b*ln(e)i] = e^a * [cos(b.ln(e))] + e^a * [sin(b.ln(e))]i
; = e^a * [cos(b)] + e^a * [sin(b)]i

finit
; e^a
fld FP10(2.7182818284590452)
fstp @e
invoke FpuPow, addr @e, @inRealPart ; e^a

mov rax,@inImaginaryPart
fld tbyte ptr [rax] ; b
fsincos ; st0=cos(b),st1=sin(b)
fmul st(0),st(2) ; e^a * cos(b)
mov rax,@OutRealPart
fstp tbyte ptr [rax] ; @OutRealPart = e^a * cos(b)

fmul st(0),st(1) ; e^a * sin(b)
mov rax,@OutImaginaryPart
fstp tbyte ptr [rax] ; @OutImaginaryPart = e^a * sin(b)
ffree st(0)

ret
EComplexNumberPow endp
LOCAL ao:REAL10
LOCAL bo:REAL10
LOCAL a:REAL10
LOCAL b:REAL10


fld FP10(0.3)
fstp a
fld FP10(0.4)
fstp b
; e^(0.3+0.4i)
invoke EComplexNumberPow,addr a,addr b,addr ao,addr bo
; Print
; ( 1.243302295069503) + ( 0.525659779196979)i
; ao = 1.243302295069503
; bo = 0.525659779196979
Say you, Say me, Say the codes together for ever.

jack

Hi six_L
if you need some reference code here's a reasonably complete set of functions complex Riemann Zeta

TimoVJL

Thanks six_L  :thumbsup:
I used it for test code for poasm.exe V13
May the source be with you

six_L

#27
Hi,jack
Thanks you.
    '  f(k)=(k+nc)^-n

    '  inf           nc              inf                        inf
    '  ====          ====           /                          ==== B
    '  \       1     \       1      [                          \    (2*k)   (2*k-1)
    '   >    ----- =  >    ----- +  I    f(k) dk + B * f(0) -   >   ------ f  (0)
    '  /      n      /      n       ]               1          /    (2*k)!
    '  ====  k       ====  k       /                           ====
    '  k = 1         k = 1          0                          k = 1

I don't understand your Zeta formula. Do you have some detailed documentations about the formula?

1, Maybe some mistakes in calculation.
Quotezeta( 1.0000, -1.0000) =  0.5821580597520036,  0.9268485643308069
zeta( 1.0000, -0.5000) =  0.5784330210993112,  1.9635494964529780
zeta( 1.0000,  0.0000) = -1.#IND000000000000, -1.#IND000000000000
zeta( 1.0000,  0.5000) =  0.5784330210993112, -1.9635494964529780
zeta( 1.0000,  1.0000) =  0.5821580597520036, -0.9268485643308069
Quotezeta( 1.0000, -1.0000) = inf
zeta( 1.0000, -0.5000) = inf
zeta( 1.0000,  0.0000) = inf
zeta( 1.0000,  0.5000) = inf
zeta( 1.0000,  1.0000) = inf

Gamma(s).Gamma(1-s) = Pi/sin(s.Pi)     ; Euler Product.

Zeta(s) = [1/(2.pi.i)].Gamma(1-s).Int_(+inf --> +inf)[(z^(s-1).e^z)/(1-e^z)].dz ; Riemann Product.
i = (-1)^0.5
s = a + bi ; a != 1
pay attention to the (+inf --> +inf):
+inf --> ... --> (0~) --> ... --> +inf , It's not the Int_(0 --> +inf) or Int_(-inf --> +inf)

Zeta(s) = 2.Gamma(1-s).(2Pi)^(s-1).sin(Pi.s/2).Zeta(1-s)

2, some of nontrivial zeros in Riemann Zeta Function:
Quote1, ( 0.5 + 14.1347251 i ) ;  11, ( 0.5 - 14.1347251 i ) 
2, ( 0.5 + 21.0220396 i ) ;  12, ( 0.5 - 21.0220396 i )
3, ( 0.5 + 25.0108575 i ) ;  13, ( 0.5 - 25.0108575 i )
4, ( 0.5 + 30.4248761 i ) ;  14, ( 0.5 - 30.4248761 i )
5, ( 0.5 + 32.9350615 i ) ;  15, ( 0.5 - 32.9350615 i )
6, ( 0.5 + 37.5861781 i ) ;  16, ( 0.5 - 37.5861781 i )
7, ( 0.5 + 40.9187190 i ) ;  17, ( 0.5 - 40.9187190 i )
8, ( 0.5 + 43.3270732 i ) ;  18, ( 0.5 - 43.3270732 i )
9, ( 0.5 + 48.0051508 i ) ;  19, ( 0.5 - 48.0051508 i )
10,( 0.5 + 49.7738324 i ) ;  20, ( 0.5 - 49.7738324 i )

Zeta_1(s) is the aux function of Zeta(s).
Zeta_1(s) = Pi^(-s/2).Gamma(s/2).Zeta(s)
of which:
Pi^(-s/2).Gamma(s/2) is the Euler Factor.

if we want to get the Zero of Zeta(s), we need to get the Zero of Zeta_1(1-s).
for example:
Zeta(0.5+14.1 i) --> Zeta_1[1-(0.5+14.1 i)] --> Zeta_1(0.5-14.1 i)
because getting the Zero of Zeta_1(1-s) value is more easier than the Zero of Zeta(s), and the Zeros of Zeta_1(1-s) is equal the Zeros of Zeta(s).

3, Reflecting Function

Zeta(s) = 2.Gamma(1-s).(2Pi)^(s-1).sin(Pi.s/2).Zeta(1-s)
if we use (1-s) to replace the s. then the result is swaping left and right.
QuoteGamma(s).Gamma(1-s) = Pi/sin(s.Pi)
sin(2a) = 2sin(a).cos(a)
sin(a-b) = sin(a).cos(b) - cos(a).sin(b)
Zeta(1-s) = 2.Gamma(1-(1-s)).(2Pi)^((1-s)-1).sin(Pi.(1-s)/2).Zeta(1-(1-s))
          = 2.Gamma(s).(2Pi)^(-s).sin((Pi/2)-(Pi.s/2)).Zeta(s)                ;sin(Pi.(1-s)/2)
      = 2.Gamma(s).(2Pi)^(-s).[sin(Pi/2).cos(Pi.s/2)-cos(Pi/2).sin(Pi.s/2)].Zeta(s)    ;sin(Pi/2)=1, cos(Pi/2)=0
      = 2.Gamma(s).(2Pi)^(-s).cos(Pi.s/2).Zeta(s)                    ;Gamma(s) = Pi/[sin(s.Pi).Gamma(1-s)]
      = 2.(Pi/[sin(s.Pi).Gamma(1-s)]).(2Pi)^(-s).cos(Pi.s/2).Zeta(s)
      = ((2Pi).(2Pi)^(-s).cos(Pi.s/2)/[sin(s.Pi).Gamma(1-s)]).Zeta(s)        ;(2Pi).(2Pi)^(-s)=(2Pi)^(1-s)
      = ((2Pi)^(1-s).cos(Pi.s/2)/[sin(s.Pi).Gamma(1-s)]).Zeta(s)
      = (cos(Pi.s/2)/[(2Pi)^(s-1).sin(s.Pi).Gamma(1-s)]).Zeta(s)            ;(2Pi)^(1-s)= (2Pi)^[-(s-1)]

Zeta(1-s).(2Pi)^(s-1).sin(s.Pi).Gamma(1-s)/cos(Pi.s/2) = Zeta(s)            ;y=(a/b).x -->(b/a).y=x
[Gamma(1-s).(2Pi)^(s-1).sin(s.Pi)/cos(Pi.s/2)].Zeta(1-s) = Zeta(s)            ;

sin(s.Pi)/cos(Pi.s/2)=sin[2(s.Pi/2)]/cos(Pi.s/2)                    ;sin(2a) = 2sin(a).cos(a)
             =[2.sin(Pi.s/2).cos(Pi.s/2)]/cos(Pi.s/2)
             =2.sin(Pi.s/2)

[Gamma(1-s).(2Pi)^(s-1).sin(s.Pi)/cos(Pi.s/2)].Zeta(1-s) = Zeta(s)
[Gamma(1-s).(2Pi)^(s-1).2.sin(Pi.s/2)].Zeta(1-s) = Zeta(s)
2.Gamma(1-s).(2Pi)^(s-1).sin(Pi.s/2).Zeta(1-s) = Zeta(s)                ;swaped left and right.

4, the progress in prime number researching.
4.1 Adjacent prime numbers
2,3,5,7,11,13,17,...
3-2=1,17-13=4,...
p(n+1)-p(n) < 2460000    ;This means the max gap of any prime numbers less than 2460000.
4.2 there are the 45% nontrivial zeros on 1/2 line.(the attachment paper)

5,the features of Riemann Zeta function's nontrivial zeros
5.1 Count
Zeta(s)=Zeta(a+bi)=0
i = (-1)^0.5
s = a + bi ; a != 1, a = 1/2, real b > 0
CountZeros[-b,b] = 2[(b/2Pi).ln(b/2Pi) - (b/2Pi) + O(ln(b))]

5.2 Distribution
The distribution features of nontrivial zeros is similar to the quantum energy level.

6, more precision at the nontrivial zeros in Riemann Zeta(s) Function
a = 1/2, real b > 0
accurate to over 1000 decimal places.
Quote14.134725141734693790457251983562470270784257115699243175685567460149
 9634298092567649490103931715610127792029715487974367661426914698822545
 8250536323944713778041338123720597054962195586586020055556672583601077
 3700205410982661507542780517442591306254481978651072304938725629738321
 5774203952157256748093321400349904680343462673144209203773854871413783
 1735639699536542811307968053149168852906782082298049264338666734623320
 0787587617920056048680543568014444246510655975686659032286865105448594
 4432062407272703209427452221304874872092412385141835146054279015244783
 3835425453344004487936806761697300819000731393854983736215013045167269
 6838920039176285123212854220523969133425832275335164060169763527563758
 9695376749203361272092599917304270756830879511844534891800863008264831
 2516911271068291052375961797743181517071354531677549515382893784903647
 4709727019948485532209253574357909226125247736595518016975233461213977
 3160053541259267474557258778014726098308089786007125320875093959979666
 60675378381214891908864977277554420656532052405

  21.022039638771554992628479593896902777334340524902781754629520403587
 5985860688907997136585141801514195337254736424758913838650686037313212
 6211882162437574166925654471184407119403130672564622779261488733743555
 2059147397132822662470789076753814440726466841906077127569834054514028
 4399232225367882682361112892700575856532731588666042140009071151080090
 0697200279987110175847519632216496865900574811247938691638351837234278
 0734490239101038504575641215958399921001621834669113158721748057170315
 7935817977249632724076992211256634415618236051804767144227146555596737
 8124776500455584090864429169775704638165517749644524987674237036645657
 7704837992029270664315837893238009151146858070430828784147861992007607
 7604774841407827389070038957604332451278278637209093037972518237091808
 0423066673834379902282515828788761761266187138296785874562376500666242
 0780814517636976391374340593412797549697276850306200263121273830462939
 3025654143823744333440220248004533438830728387312602306547534837868011
 82789317520010690056016544152811050970637593228

  25.010857580145688763213790992562821818659549672557996672496542006745
 0920984416442778402382245580624407504710461490557783782998515227308011
 8813393358267168958722516981043873551292849372719199462297591267547869
 6628856807735070039957723114023284276873669399873219586487752250099192
 4534749762085766123345997354435583675313812659977645290374484969947911
 3789772206619930718997232254973227163005159161921279774087660006729149
 8308127930667027350849516001984670542469491796695225514179319665391273
 4145216731602337377544894146417119378489574997514110658562879690076709
 8628272186495372963239258403491387143048933588946114958624239036855617
 5189359878735685683089271444468756375337019130417377142535868018531867
 8963753268686326607197669205329533478506707982877118674944281439725425
 5165319679779912722684458969279408599507227960513612021369680647653397
 6269691774251249095257214003855886494422730332216278403670865759210329
 0789866156020484275192735141927597017849166084411074821559128310749314
 22640278339513428773126644105168571016344289902

  30.424876125859513210311897530584091320181560023715440180962146036993
 3293893332779202905842939020891106309917115273954991176332266711863193
 9180722595671424334115590685468136558072417349844724959319040811632315
 0197023484841630221400985620739718392018133021868063298225719752250023
 7468561369747124964426229779245040574906715345727886515065160832468797
 0628177810457777225878919237386290011276030973568089049253006461289272
 7530919447902003589389819427495511323917384271638108400499211198006924
 3871887296959700029100054774270689081684625934838507707996560373392659
 1631785900558390596815720730796252620549400959515892318195507003120438
 5472912847073737931700052460469858203860095171051337905912538151203525
 6495480686539474573064428698419890124742762009249476736375814720332208
 6687601457265777407119672734350479234503516187981145579444869326121291
 4417916583251901867849867644777729648215979712565041026341481014213352
 4013338332668144856154491448771220118284070765164762211312808070237683
 31017097022722833154052850963731871619582513781
Say you, Say me, Say the codes together for ever.