[73abe95] | 1 | // |
---|
[0a5b683] | 2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
[73abe95] | 6 | // |
---|
[dc8511c] | 7 | // math3.cfa -- |
---|
[73abe95] | 8 | // |
---|
[0a5b683] | 9 | // Author : Peter A. Buhr |
---|
| 10 | // Created On : Fri Apr 22 14:59:21 2016 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
[ac1ae2c6] | 12 | // Last Modified On : Wed Dec 12 16:30:41 2018 |
---|
| 13 | // Update Count : 86 |
---|
[73abe95] | 14 | // |
---|
[0a5b683] | 15 | |
---|
[73abe95] | 16 | #include <fstream.hfa> |
---|
| 17 | #include <math.hfa> |
---|
[0a5b683] | 18 | |
---|
| 19 | int main( void ) { |
---|
| 20 | float f; |
---|
| 21 | double d; |
---|
| 22 | long double l; |
---|
| 23 | |
---|
[ef3403c6] | 24 | //---------------------- Hyperbolic ---------------------- |
---|
| 25 | |
---|
[ac1ae2c6] | 26 | sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | nonl; |
---|
| 27 | sout | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ); |
---|
| 28 | sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | nonl; |
---|
| 29 | sout | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ); |
---|
| 30 | sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | nonl; |
---|
| 31 | sout | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ); |
---|
| 32 | sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | nonl; |
---|
| 33 | sout | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ); |
---|
| 34 | sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | nonl; |
---|
| 35 | sout | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ); |
---|
| 36 | sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | nonl; |
---|
| 37 | sout | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ); |
---|
[ef3403c6] | 38 | |
---|
| 39 | //---------------------- Error / Gamma ---------------------- |
---|
| 40 | |
---|
[200fcb3] | 41 | sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ); |
---|
| 42 | sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ); |
---|
| 43 | sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ); |
---|
[ef3403c6] | 44 | int sign; |
---|
| 45 | f = lgamma( 4.0F, &sign ); |
---|
[200fcb3] | 46 | sout | "lgamma:" | f | sign | nonl; |
---|
[ef3403c6] | 47 | d = lgamma( 4.0D, &sign ); |
---|
[200fcb3] | 48 | sout | d | sign | nonl; |
---|
[ef3403c6] | 49 | l = lgamma( 4.0L, &sign ); |
---|
[200fcb3] | 50 | sout | l | sign; |
---|
| 51 | sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ); |
---|
[0a5b683] | 52 | } // main |
---|
| 53 | |
---|
| 54 | // Local Variables: // |
---|
| 55 | // tab-width: 4 // |
---|
[dc8511c] | 56 | // compile-command: "cfa math3.cfa" // |
---|
[0a5b683] | 57 | // End: // |
---|