An Expert Is actually By My Side

Chapter 100: Contestant number one hundred and one hand in paper in advance?

   Compared to Academician Zhan Yongshu’s surprise, Hao Yun didn’t think it was particularly complicated when thinking about this issue. It was purely a method that he came up with when he scratched his head.

  The program first guessed a value close to 1/sqrt(number), and then used Newton's iterative formula to perform iterative operations.

   In terms of algorithm logic alone, in fact, the code after he rewritten is not much different from the code of the previous Q_Sqrt function. The Q_Sqrt function defined by the glacier engine in the math.c file actually uses this idea.

   The only difference is probably the mysterious number-0x5f375a86.

   According to the principle of Newton's iterative algorithm, the closer the guess value is to the final result, the fewer iterations. The mysterious number 0x5f375a86 is used to calculate the guess value.

After several attempts, Hao Yun unexpectedly discovered that if the number "0x5f375a86" is used, the resulting y will be very close to 1/sqrt(n), so that when the Newton iteration algorithm is finally executed, only 2 iterations are needed. Reach the precision he needs!

   How did this number come out?

   Hao Yun couldn't explain.

   After all, he just followed his mathematical intuition and felt that the number selected in the program was not good enough, and then tried to change to a better number.

   He also tried several times at the beginning, and found that the changed number was not as easy to use as the original number. Later, he tried the 0x5f375a86 and found that it takes only two iterations to complete the entire calculation process.

   To be honest, he himself was surprised.

  Maybe...

   Does this have something to do with his mathematics proficiency?

   In short, after using the special number 0x5f375a86, from the point of view of the number of calculation steps, the calculation efficiency of the entire function will be twice as fast as the Q_Sqrt function defined in the original math.c file!

   As for the effect of this result...

   To be honest, Hao Yun didn't have an accurate concept.

   After all, his understanding of this glacier engine is far from the level of industry insiders.

   Although he has played games before, he actually only played the 2048 game. Escape from the Temple is a development software with the same source as Glacier Engine, but that game was basically completed by Li Zongzheng alone. Hao Yun was not involved in the development process at all, even if he participated in 80% of it. Will study the source code of the engine.

   The game development tools in this world have evolved to be foolish enough. Except for those big productions, most of the small and medium-sized games can be realized by relying solely on development tools and a second-level programming level.

   "...How much has the efficiency of the test engine improved? Isn't there a scoring software or test game on this computer?"

   Hao Yun searched carefully on the computer, but did not find the tool software that can be used to score the engine, nor the game that can test the performance of the engine.

   In fact, the organizer did not prepare such a thing.

   After all, from the beginning, they never considered that someone could actually complete this proposition.

   "I'm going, this is woolen yarn?"

   After searching a lot, he still couldn't find the detection tool. Hao Yun looked at the screen dumbfoundingly, completely gone.

   Can't develop a game on the spot to run points, right?

  Although it’s not impossible, but there is no material at hand, and the computer cannot be connected to the Internet. You can’t start with the most basic materials, right?

   After some struggle, Hao Yun finally gave up.

   Forget it.

   Anyway, I can’t think of a better optimization method...

   Thinking like this, Hao Yun sighed, reached out and clicked on the submission option in the test program, and then left the keyboard with both hands—the so-called AK.

   There is only a three-day maximum time limit for the exam, and no minimum time for handing in papers. You can leave the venue at any time after submitting your answers.

   Because even if the paper is submitted in advance, there will be no extra points, so even if the paper is finished ahead of time, most people will choose to boil until the meal and then submit the paper, and eat out with friends who came to the competition.

   Hao Yun had the same plan at the beginning, but there was nothing in his cubicle. There was nothing to do except sitting and waiting, so he could only get out of his cubicle.

When    left the examination room, it was the security guard who stood at the security checkpoint.

   Hao Yun glanced at him, and he stared at Hao Yun for a while.

   "Go to the toilet? You are going in the wrong direction."

   "No, I finished the exam."

   "The exam, are you finished?"

   "Well," Hao Yun nodded, and pointed to the exit of the gymnasium, "Can I go out?"

   After finally regaining his senses, the security guard Mumu nodded and untied the isolation belt blocking the entrance.

   Two years ago, the Hope Cup was also compared at Xiadong Normal University. At that time, he was also standing here to maintain order. If he remembered correctly, the earliest candidate who handed in the paper was at five o'clock in the afternoon.

   But now, it hasn’t been an hour since the nine o’clock exam officially started...

   Is this a blank paper?

   Anyway, he is also a finalist from tens of thousands of works, so he won't be able to hand in a blank paper, right? !

   In fact, it's not just the security guards standing at the entrance of the examination room that are surprised.

  The chief examination committee standing in the backstage of the examination room was far more surprised than everyone here.

   Especially Professor Zhang Cunhao.

   After reading the code rewritten by Hao Yun, the whole person was stupid.

   Staring at the densely packed calculations on the draft paper, Professor Zhang Cunhao, who had calculated countless times without believing evil, finally couldn't help but explode.

   "Fuck! How did this guy... come up with this number?"

This……

   This is incredible!

   Only changing one guess number has increased the computational efficiency of the entire function by a full double? !

   Standing next to Professor Zhang Cunhao, Feng Zhengqing, the manager of Longwei Group's software development department, quietly gave him a hand, and asked in a low voice, "How much efficiency can be improved if it is applied to the glacier engine?"

   "It is conservatively estimated to be 20%. There are still a lot of related operations for the inverse square reciprocal in the 3D engine..."

   "How come there are so many?" Manager Feng moved slightly.

  As a layman, he doesn't know so many ways, and he doesn't know what Newton's iterative algorithm is. He just thinks it's incredible!

   Although the glacier engine is not the core R&D project of Longwei Group, there are definitely a lot of computer experts in the project team. However, so many people did not discover this improvement method, but was discovered by a student?

   I can’t believe anyone in exchange!

   Facing the draft paper full of writing, Professor Zhang Cunhao threw it into contemplation, although he had gradually felt that this thing was beyond the research field he was familiar with.

   Standing next to him was an old professor from the Capital National Defense University. After a long period of silence, the old professor also uttered a sincere feeling.

"Unbelievable... I didn't expect this guy to find a breakthrough in the most unlikely place to find a breakthrough. I always thought that the functions in the math.c file were perfect enough, just like addition, subtraction, multiplication, and division, which can be used directly. Unexpectedly, there is such a magical method to make the perfect boundary one step higher."

   "This kid is a talent!"

   I don't know what I was thinking about~www.ltnovel.com~ Professor Zhang Cunhao's silent expression suddenly became a little entangled.

   After struggling for a long time, he looked at his teacher, Academician Zhan Yongshu.

   "But IMHO, is such an answer really okay?"

   Academician Zhan Yongshu glanced at him.

   "Are you still not convinced?"

"It's not dissatisfied, I just feel... a little bit aggrieved," Professor Zhang Cunhao held back for a long time before he said what he said in his heart, "This is not a solution in the program sense at all. He didn't even modify even one line of code at all. No matter who it is, it can be seen...what a special thing, it is mathematics!"

   Yes, this is mathematics at all!

   That contestant just modified a random number. As a result, it happened that the low-level function for calculating the "inverse square reciprocal" did a few Newton iterations, and then the engine was optimized by "accumulating less into more"?

   Why is this number in the end? !

   is not a mathematician after all, Zhang Cunhao was about to collapse what he thought, and he didn't think of it.

   Looking at the crazy face of the student, Academician Zhan Yongshu suddenly smiled.

   "Who said no?"

   He didn't even think of how this number was calculated, and it was the kind that had no clue at all.

   totally rely on intuition?

   Similar situations are not uncommon. Some mathematical constants were actually guessed from experience at the beginning, and the mathematical principles were not proved until more than ten years or even centuries later.

   Thinking of this, and seeing the candidate who was leaving the examination room, Academician Zhan Yongshu couldn't help feeling softly in his heart.

  Maybe...

   This is a genius.

Tap the screen to use advanced tools Tip: You can use left and right keyboard keys to browse between chapters.

You'll Also Like