soveran / clac

Command-line, stack-based calculator with postfix notation
BSD 2-Clause "Simplified" License
358 stars 30 forks source link

erf (Gauss error function) #20

Closed waltertross closed 4 years ago

waltertross commented 4 years ago

The erf (error function) completes the set of useful mathematical functions that cannot be derived from other words. I like the idea to leave out all the functions that can be described in terms of the available words, but the erf is not one of these. The erf is an important function in statistics, where it is linearly related to the normal (i.e., Gaussian) cumulative distribution function. See also the "68–95–99.7 rule". Sorry for the last minute addition. I hope you didn't build the release yet.

waltertross commented 4 years ago

To illustrate the "68–95–99.7 rule" (https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule): In my $CLAC_WORDS file:

withinsigma "2 0.5 ^ / erf"

In clac:

> 1 withinsigma
= 0.682689492137086
> 2 withinsigma
= 0.954499736103642
> 3 withinsigma
= 0.99730020393674
soveran commented 4 years ago

@waltertross Never too late :-) These contributions are a big improvement for clac. I use it all the time, and I hope you find it useful too now that it's more precise and more complete. Thanks a lot!