samhocevar / lolremez

📈 Polynomial Approximations using the Remez Algorithm
Do What The F*ck You Want To Public License
397 stars 36 forks source link

feature request: erfc() and expm1() #21

Closed MathGeniusJodie closed 2 years ago

MathGeniusJodie commented 2 years ago

would it be possible to add functions like erfc and expm1 for extra precision around zero?

samhocevar commented 2 years ago

I can easily add expm1, yes. However I have been unable to find a good way to compute erfc so far, the formulae I found were either incredibly slow or inaccurate.

MathGeniusJodie commented 2 years ago

awesome, shame about erfc, I'm making a math library and I've been finding it hard to approximate it

samhocevar commented 2 years ago

Hi! I have added expm1 and log1p to the main branch.

I’ll have another look at erfc.

samhocevar commented 2 years ago

Hi! I have added the erfc() and erfcx() functions. So I’ll be closing this issue.

Maybe the accuracy issues in erfc() will not be a big deal to you; the maximum error is 1.6e-44 (see this issue).