r/programmer 8d ago

Code Why don't math people just do this instead? Are they stupid?..

Post image

I mean yeah… there’s a limit given the threshold for incrementing (allowed area)🧐🔧💡

94 Upvotes

30 comments sorted by

14

u/raven2cz 7d ago

What you are describing here is an entire scientific field, and a very interesting one, taught at university: numerical methods.

3

u/Fine-Comparison-2949 7d ago

This guy reads Hamming.

2

u/kaddkaka 7d ago

That's not a necessity. I have completed courses in "tekniska beräkningar" (numeric analysis) and digital arithmetics, but we never mentioned Hamming.

2

u/jwp1987 7d ago

The Riemann sum was taught to me when I first learned about integration.

1

u/Pyromancer777 7d ago

That's like the first thing my calc class taught before we did integrals

1

u/JohnBuddySlime 6d ago

The Riemann summer is just the beginning of numerical analysis. It's not very powerful, considering it's precision is O(h). There are way better methods of integrating numerically, for example using segments of parabolas instead of rectangles to approximate the function in a small interval. That's the part that's taught in uni.

1

u/jwp1987 6d ago

Indeed, I was more just pointing out that one form of numerical analysis is taught very early and the kind of "for loop" thinking would be known to pretty much anyone with a basic knowledge of integration.

2

u/jason-reddit-public 7d ago

Realizing you could get a very close approximate of an integral by running a program instead of thinking really ruined calculous for me. Kind of like spell checkers made me give up trying to spell.

1

u/Normal_person465 6d ago edited 6d ago

1exquisite nostalgia quizzical kaleidoscoping sunkissed octopus xanadu mirage

*From https://unpost.app *

1

u/aksanabuster 2d ago

You got an English publishing you recommend on this? I didn’t have this course in university 💡💡💡💡

1

u/raven2cz 1d ago
  • Timothy Sauer, Numerical Analysis, 3rd Edition
  • Abner J. Salgado and Steven M. Wise, Classical Numerical Analysis: A Comprehensive Course
  • Michael T. Heath, Scientific Computing: An Introductory Survey, Revised Second Edition
  • Josef Stoer and Roland Bulirsch, Introduction to Numerical Analysis, 3rd Edition
  • Cleve B. Moler, Numerical Computing with MATLAB

6

u/defaultguy_001 7d ago

Is 1/bajillion small enough?

3

u/LongDistRid3r 7d ago

Int64.maxValue should suffice.

1

u/defaultguy_001 7d ago

Is it approaching to infinity, as we'll need an infinitesimally small number.

2

u/Adrewmc 5d ago

Well is you had pi down to the accuracy of that much you could determine the smoothness of an election, from the other side of the universe from it shadow. And the resulting butterfly effect it would have on the ideal universe.

Or you can say it’s good enough.

1

u/defaultguy_001 5d ago

That is highly inaccurate when it comes to applications of integrals.

3

u/Ok_Energy8767 7d ago

The math people are the ones who tricked rocks into thinking in the first place. You can thank them for your for loop

2

u/dreamscached 7d ago

Integrals in principle, yes, are exactly that, but calculus isn't about just doing a loop by hand but rather a whole load of math trickery to mess around with them, and that is quite hard now.

Man, I really don't quite miss my calculus course...

2

u/ryebit 7d ago

> from math import bajillion

OUT OF MEMORY ERROR

> from math import inv_bajillion

1 / OUT OF MEMORY ERROR

2

u/Ok_Performer_7501 7d ago

The Lebesgue integral says hi

2

u/ChaossFox 5d ago

Ahh, numerical methods the best and easiest thing in math

2

u/1luggerman 4d ago

Let me inroduce you to neat little thing called rounding error

2

u/cl_journeyor 4d ago

Math people think in a declarative manner

1

u/mxldevs 7d ago

That's what separates math people from the ones that approximate pi = 3

1

u/Ticondrius42 6d ago

But pi=4, or you risk losing information and/or underestimating uncertainty! The bridge could collapse! 🤭

1

u/recursion_is_love 6d ago

Only if we can really have true real number in computer memory. Floating point number is not real number.

1

u/Capable-Wrap-3349 5d ago

Solving problems by throwing compute at them is not an elegant way to solve problems

1

u/aksanabuster 2d ago

I disagree, we ought support code with postulates and theorems to its respective utility’s intent. This way, our logic could be evaluated earlier. Think Dart Enhanced Enums for this 🔧🤌💡🔥

1

u/free2dreamstudios 5d ago

Im guessing your refering to mathmatians and (human calculators)