diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-20 09:28:10 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-20 09:28:10 -0800 |
commit | 25912c4c7e019aaa9a9ce1066c6b3cfe945c5bbc (patch) | |
tree | 1a6a1f6892b15bce213d39e4b651715865a5d927 /tests | |
parent | 33119ada581f1d8e8ad5cc6697660408b41bc097 (diff) | |
parent | a8f02d0776a11b36d4a4a5733bf2ee7f0f95fe89 (diff) |
Merge pull request #724 from xxuejie/add_erf
Add erf and erfc implementations
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index ba5ec148..6404a211 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1450,6 +1450,24 @@ c5,de,15,8a ''' self.do_run(src, '*3.14,-3.14,1,0,0,0,1,0,1,1,0,2,3,0.0,1.0,0.0,1.0*') + def test_erf(self): + src = ''' + #include <math.h> + #include <stdio.h> + int main() + { + printf("%1.6f, %1.6f, %1.6f, %1.6f, %1.6f, %1.6f\\n", + erf(1.0), + erf(3.0), + erf(-1.0), + erfc(1.0), + erfc(3.0), + erfc(-1.5)); + return 0; + } + ''' + self.do_run(src, '0.842701, 0.999978, -0.842701, 0.157299, 0.000022, 1.966105') + def test_math_hyperbolic(self): src = open(path_from_root('tests', 'hyperbolic', 'src.c'), 'r').read() expected = open(path_from_root('tests', 'hyperbolic', 'output.txt'), 'r').read() |