News for hackers. Stuff that matters.
Re:Designing a New Rust Class at Stanford: Safety in Systems... by andy99 on Wednesday October 07, 2020 @05:23PM (#24712904)
From what I understand reading the course outline, this is an introductory class. Foundational material in a subject is often "completely disconnected" from the reality of the discipline. If I was an engineer taking a first course in integral calculus, should I worry that my teacher may not be a seasoned practitioner, or should I worry that they are good at getting me to understand the fundamentals? I can definitely see your argument if this was a professional practice class, or something vocational, but it's a 100 level CS class.
Re:Designing a New Rust Class at Stanford: Safety in Systems... by eska on Wednesday October 07, 2020 @05:59PM (#24713259)
I think you should worry. One of my math professors taught us how factoring to a(x+b(x+c*(...))) is a great optimization in an introductory class, because he had no idea about CPU pipelines for example.
Re:Designing a New Rust Class at Stanford: Safety in Systems... by vladf on Wednesday October 07, 2020 @08:10PM (#24714308)
Horner’s method for polynomial evaluation is used because of numerical stability, not speed.
Re:Designing a New Rust Class at Stanford: Safety in Systems... by gregod on Thursday October 08, 2020 @09:36AM (#24718971)
Could you elaborate?

I'm working on a project where the evaluation of a 4th degree polynomial is on the hot path. My micro benchmark (evaluating two polynomials + little bit of addition) shows that using simple Horner's rule is already somewhat faster, and implementing Horner's rule with fused-mul-add is more than twice as fast.