Chapter 99 - 96: He Can’t Be Just Writing Nonsense, Can He?
Li Dong had been so excited a moment ago that he only just now realized he was in the wrong seat.
"Oh, my bad. I misread the seat number."
Li Dong quickly stood up, giving up the A seat by the window and moving to the C seat on the aisle next to it.
Seeing Li Dong’s polite attitude, the young man gave a courteous nod. After stowing his luggage in the overhead rack, he sat down in the window seat.
His name was Qin Fei, a third-year student majoring in Computer Science and Technology at the Beijing Institute of Technology.
As a university student who practically lived on Kyoto’s Subway Line 4, Qin Fei was under a great deal of academic pressure. This was especially true given his specialization in "High-Performance Computing (HPC) and Low-Level Algorithm Optimization."
Now, transitioning from his junior to senior year, Qin Fei was in the crucial final stretch of studying for his graduate school entrance exams.
He hadn’t planned on returning to his hometown for the summer. He’d wanted to stay at the school lab and keep grinding away at his computational power project.
However, he was so exceptional that his prep progress was far ahead of schedule. Securing a spot in a graduate program was pretty much a sure thing.
Plus, he hadn’t gone home for the New Year, so he decided to make a trip to see his parents.
Now that the new semester was starting, it was naturally time to head back to school.
After settling into his seat, Qin Fei took out a pair of noise-canceling headphones, put them on, and turned his gaze to the scenery flashing by outside the window.
Meanwhile, Li Dong, sitting beside him, had already pulled a Lenovo laptop from his bag and set it up on the folding tray table.
’Today, I’m going to flatten this mountain of shit code if it’s the last thing I do!’
Li Dong opened his laptop.
He decisively abandoned his previous, inefficient Python script and opened a C++ integrated development environment (IDE).
Verifying the non-trivial zeros of the Riemann Zeta function required a low-level language, as well as the GMP and MPFR libraries to ensure computational precision.
’My 0.3 in Basic Attributes is maxed out, and I’ve got [Code Intuition (Basic Edition)].’
’I feel terrifyingly powerful right now...’
CLACK-CLACK... CLACK-CLACK...
Despite his noise-canceling headphones, Qin Fei’s attention was drawn to Li Dong’s frantic movements beside him.
He tilted his head slightly and glanced over.
’A ThinkBook?’
Qin Fei shook his head inwardly.
’Using an ultrabook, designed for being thin, light, and for business, to write code? Can the thermals even handle that? This guy must’ve gotten suckered...’
With the slight superiority of an expert, Qin Fei glanced at Li Dong’s screen again, only to freeze for a moment.
void RiemannSiegelZ (...)
mpfr_t theta_t;
"Hm?"
Qin Fei raised an eyebrow.
’Writing the Riemann-Siegel formula in C++? Is this kid running a verification of the non-trivial zeros of the Riemann Zeta function?’
’He’s in the same field? What a surprise to run into another CS student on a high-speed train.’
Still, he watched Li Dong’s code with the condescending air of a seasoned veteran.
After all, in the High-Performance Computing lab at the Beijing Institute of Technology, projects like this were all too common.
With the current state of computational power, using classic mathematical problems—like calculating pi to tens of billions of digits or sieving for large prime numbers—as benchmarks to test the optimization of low-level algorithms was standard practice for HPC students like them.
Besides, to prepare for his graduate school interviews and his senior thesis proposal, Qin Fei himself had recently coded a program from scratch to verify Riemann’s zeros.
’The idea isn’t bad, using this for practice.’
Qin Fei shook his head, his gaze falling on the laptop as he scoffed inwardly.
’But with that piece of junk ultrabook he got suckered into buying, how far can his algorithm even get?’
’A hundred thousand? Or a million?’
’I bet by the time it gets to a million zeros, the memory fragmentation and CPU temps will be enough to make that thing blue-screen.’
Qin Fei was certain of it.
When he’d worked on this project, he had used his school lab’s high-performance server cluster.
Through extremely rigorous multithreaded concurrency control and L3 cache hit rate optimization, he had managed to push the zero calculations to the terrifying scale of hundreds of millions!
He even felt that if he’d spent a bit more time refining the memory pointer garbage collection, hitting the one-billion-level threshold wouldn’t have been out of the question.
’So amateurish...’
Qin Fei shook his head with a pedantic air. Forgetting the scenery, he stared at Li Dong’s screen with great interest, deciding it would be some mid-journey entertainment.
Li Dong, oblivious to the expert watching beside him, was focused solely on optimizing his algorithm.
As Qin Fei watched, he first found himself nodding in approval.
’Hm, not bad.’
’He knows to ditch the original Euler product formula and go straight for the Riemann-Siegel formula.’
’The loop for the main sum term is well-structured, and the Taylor truncation for the remainder term expansion is reasonable enough.’
’The time complexity is the standard O(t^(1/2)). For an average student, his coding fundamentals are quite solid.’
In his mind, Qin Fei gave the code a "passable" rating.
However, just as Qin Fei expected Li Dong to logically proceed with writing multithreaded acceleration code...
Li Dong suddenly stopped.
Then he pressed the backspace key, deleting more than half of the textbook-standard Riemann-Siegel main sum term loop calculation he had just written!
Qin Fei froze.
’What’s he doing? Did he make a mistake and undo it?’
But the code Li Dong typed next left Qin Fei utterly baffled.
Li Dong didn’t get bogged down in how to speed up a single calculation.
He had [Code Intuition] and the kind of dimension-reducing mathematical thinking from *Riemann’s Last Words*. He was now beginning to find the perfect bridge to the underlying Logic of modern computers.
At the top of the code, he introduced a header file named .
This is the famous Fast Fourier Transform (FFT) open-source library.
Then he defined a dense evaluation grid in the code.
void MultiPointEvaluation_Grid (...)
By constructing local polynomials, he forcibly transformed the Riemann Zeta function—which required brute-force calculation by substituting the value of t point by point—into a Taylor series expansion on the grid points.
Then, Li Dong invoked the FFT algorithm, allowing these polynomials to be multiplied at high speed in the frequency domain.
Qin Fei had already taken off his noise-canceling headphones. His eyes were glued to Li Dong’s screen, his breathing growing ragged.
’Wait... what the hell is he doing?’
Qin Fei tried to use his own knowledge to parse the Logic behind the code.
’You’re calculating the Riemann Zeta function, so why are you bringing Fast Fourier Transform (FFT) into it? The two have absolutely nothing to do with each other!’
’And this multi-point evaluation matrix? He put the Taylor expansion on a grid...’
Suddenly, a thought struck him.
’He... he’s not calculating a single point! He’s using FFT’s efficient convolution property to forcibly package the evaluation of all zeros within a large interval into a parallel polynomial operation!’
’Using multi-point evaluation to amortize the terrifying computational cost of the Riemann-Siegel formula’s main sum term?’
This was, in fact, the approach to calculating the zeros that Riemann had written in his manuscript—an approach that had gone undiscovered by later academics.
It predated the later-published Odlyzko–Schönhage algorithm by nearly a century and a half. On a fundamental mathematical level, it even reduced the latter’s time complexity by an entire order of magnitude.
But there was no way Qin Fei could have known that!
In his world, the O(t^(1/2)) complexity of the Riemann-Siegel formula was the theoretical lower bound for calculating a single zero.
Even the fastest algorithm in the field, the OS algorithm, was merely an extreme engineering optimization; it was fundamentally impossible to break out of this mathematical framework.
But this guy in front of him... what on earth was he doing? Was he trying to overthrow the entire computational architecture?
’How is this possible?!’
Qin Fei thought the guy was insane.
’Expanding the main sum term into a matrix operation can theoretically reduce the average complexity, but how do you control the error? If you do it this way, the floating-point truncation error will absolutely explode exponentially!’
However, before Qin Fei could even finish his internal rebuttal...
Li Dong proceeded to intersperse several segments of interpolation filtering code for a band-limited function between the multi-point evaluation grids, perfectly locking the integration path’s truncation error within an extremely small mathematical boundary!
Every pointer traversal, every instance of memory reuse, was executed with elegance.
’That’s not right... Even the OS algorithm couldn’t be implemented with so little code and such low memory overhead!’
’His interpolation Logic isn’t based on modern numerical analysis at all... Just where did this algorithm come from?!’
Qin Fei was completely dumbfounded.
Although he recognized the C++ syntax, he could no longer follow the algorithmic Logic they formed when combined.
’He can’t just be writing nonsense, can he?’
’Written like this... will it actually run?’
Qin Fei fell into deep self-doubt.