This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Math | |
def self.invErf(x) | |
c = [] | |
c[0] = 1.0 | |
c[1] = 1.0 | |
result = 0.0 | |
(0..100).each do |k| | |
# Calculate C sub k | |
if k > 1 then | |
c[k] = 0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Math | |
## | |
# hypergeom(a, b, c, z) => Float | |
# Implementation of the 2F1 Hypergeometic Function using converging Taylor Series. | |
# Note 10,000 iterations is normally more than enough to achieve convergence, but feel free to increase | |
# | |
def self.hypergeom(a, b, c, z) | |
s = [] | |
cj = [] | |
cj[0] = 1 |