gmt icon indicating copy to clipboard operation
gmt copied to clipboard

Improve description of table operators in gmt/grd math modules

Open Esteban82 opened this issue 2 years ago • 7 comments

As I have suggested here I want to improve the description of the math operators. I will work on this. It can wait until gmt 6.5.

I open this issue so you know I am working on it, and more important to ask some doubts. Any suggestions is welcome.

I am planning to:

  1. Improve the description of the Return column
  2. Add a link to DLMF for complex functions.

Esteban82 avatar Jun 08 '22 19:06 Esteban82

I am thinking of adding a new column with the type of formula (like trigonometric, logic, basic math, statistical, etc). I think it would help the users.

Is there any way to add a filter in the table (so I could ask to only show the trigonometric formulas) or to sort it?

Esteban82 avatar Jun 08 '22 22:06 Esteban82

Is there any way to add a filter in the table (so I could ask to only show the trigonometric formulas) or to sort it?

Sphinx doesn't support it, but it's possible to enable filtering/sorting with this extension.

seisman avatar Jun 09 '22 01:06 seisman

I create a table in google docs with the info of the table.

There I add a new column with the Type of Function. For some cells (highligthed in color), I am not sure what to put (e.g. Psi (or Digamma) of A). I also add a more detailed version for the return column to replace the orignal. There is also a column with wikepedia and https://dlmf.nist.gov/idx/ links but that is WIP.

Let me know if you prefer that I post my doubts directly here.

Esteban82 avatar Aug 11 '22 17:08 Esteban82

Nice start, @Esteban82. I have some comments:

  1. I would lump probability distributions, statistical, combinatorics, LMSSCL etc etc into a single category: Probability
  2. All the crazy math functions (Bessel, Kelvin, Dilog, Legendre etc) I would place in category: Special Functions (that is how they are often referred to in math books, for instance).
  3. I think some of the BIT operators should go into Logic (AND, NOT, OR, TEST, XOR) and the rest (LEFT, RIGHT) goes into Arithmetic. Computer Programming is too specific.
  4. What you have as conversion and stack operations, Ax = b solvers, etc I would lump together into Special Operators

That would give these six categories

  • Arithmetic
  • Calculus
  • Probability
  • Logic
  • Special Functions
  • Special Operators

This is usually when we dust off @WalterHFSmith to see if he can come up with better categories!

PaulWessel avatar Aug 12 '22 08:08 PaulWessel

Ok. I will wait if Walter has something to add.

Esteban82 avatar Aug 17 '22 12:08 Esteban82

I replied August 12 that it sounded good to me. Did you not get that email?

W

On Aug 17, 2022, at 8:29 AM, Federico Esteban @.***> wrote:

Ok. I will wait if Walter has something to add.

— Reply to this email directly, view it on GitHub https://github.com/GenericMappingTools/gmt/issues/6778#issuecomment-1217945452, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUT6GIKVMAJWPATFAFIZNDVZTLL5ANCNFSM5YHVPWIA. You are receiving this because you were mentioned.

WalterHFSmith avatar Oct 11 '22 08:10 WalterHFSmith

Sounds good to me!

W

On Aug 12, 2022, at 4:22 AM, Paul Wessel @.***> wrote:

Nice start, @Esteban82 https://github.com/Esteban82. I have some comments:

I would lump probability distributions, statistical, combinatorics, LMSSCL etc etc into a single category: Probability All the crazy math functions (Bessel, Kelvin, Dilog, Legendre etc) I would place in category: Special Functions (that is how they are often referred to in math books, for instance). I think some of the BIT operators should go into Logic (AND, NOT, OR, TEST, XOR) and the rest (LEFT, RIGHT) goes into Arithmetic. Computer Programming is too specific. What you have as conversion and stack operations, Ax = b solvers, etc I would lump together into Special Operators That would give these six categories

Arithmetic Calculus Probability Logic Special Functions Special Operators This is usually when we dust off @WalterHFSmith https://github.com/WalterHFSmith to see if he can come up with better categories!

— Reply to this email directly, view it on GitHub https://github.com/GenericMappingTools/gmt/issues/6778#issuecomment-1212856953, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUT6GP5GGGK4IV2DFQLMIDVYYCU5ANCNFSM5YHVPWIA. You are receiving this because you were mentioned.

WalterHFSmith avatar Oct 11 '22 08:10 WalterHFSmith

Finally I got some time to do this.

I have a doubt:

  1. sinc is a special function?

Esteban82 avatar Nov 21 '22 13:11 Esteban82

Hm, good question. I think so even though it is pretty simple.

PaulWessel avatar Nov 21 '22 13:11 PaulWessel

What is “special” about sinc(x) is that its value at x=0 is defined by taking a limit and using l’Hopital’s rule. So I think this will not be easy to compute accurately for very small x, unless you are careful to compute it by its power series and decide at what value of x should you switch from computing sin(pi x)/(pi x) to the power series.

Just my guess.

W

On Nov 21, 2022, at 8:50 AM, Paul Wessel @.***> wrote:

Hm, good question. I think so even though it is pretty simple.

— Reply to this email directly, view it on GitHub https://github.com/GenericMappingTools/gmt/issues/6778#issuecomment-1322096134, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUT6GOM3WAQOG5F32SVEVLWJN44FANCNFSM5YHVPWIA. You are receiving this because you were mentioned.

WalterHFSmith avatar Nov 21 '22 15:11 WalterHFSmith

Thanks Walter.

Esteban82 avatar Nov 21 '22 15:11 Esteban82

Fortunately the series is an alternating one, so you know the error is smaller than the first term you skip.

On Nov 21, 2022, at 10:35 AM, Federico Esteban @.***> wrote:

Thanks Walter.

— Reply to this email directly, view it on GitHub https://github.com/GenericMappingTools/gmt/issues/6778#issuecomment-1322246825, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUT6GJKCODOTFIZQCRG3E3WJOJF7ANCNFSM5YHVPWIA. You are receiving this because you were mentioned.

WalterHFSmith avatar Nov 21 '22 15:11 WalterHFSmith