OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [newlib-1.18.0/] [newlib/] [libm/] [mathfp/] [s_cosh.c] - Blame information for rev 842

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
 
2
/* @(#)z_cosh.c 1.0 98/08/13 */
3
 
4
/*
5
 
6
FUNCTION
7
        <<cosh>>, <<coshf>>---hyperbolic cosine
8
 
9
ANSI_SYNOPSIS
10
        #include <math.h>
11
        double cosh(double <[x]>);
12
        float coshf(float <[x]>)
13
 
14
TRAD_SYNOPSIS
15
        #include <math.h>
16
        double cosh(<[x]>)
17
        double <[x]>;
18
 
19
        float coshf(<[x]>)
20
        float <[x]>;
21
 
22
DESCRIPTION
23
 
24
        <<cosh>> computes the hyperbolic cosine of the argument <[x]>.
25
        <<cosh(<[x]>)>> is defined as
26
        @ifnottex
27
        . (exp(x) + exp(-x))/2
28
        @end ifnottex
29
        @tex
30
        $${(e^x + e^{-x})} \over 2$$
31
        @end tex
32
 
33
        Angles are specified in radians.
34
 
35
        <<coshf>> is identical, save that it takes and returns <<float>>.
36
 
37
RETURNS
38
        The computed value is returned.  When the correct value would create
39
        an overflow,  <<cosh>> returns the value <<HUGE_VAL>> with the
40
        appropriate sign, and the global value <<errno>> is set to <<ERANGE>>.
41
 
42
        You can modify error handling for these functions using the
43
        function <<matherr>>.
44
 
45
PORTABILITY
46
        <<cosh>> is ANSI.
47
        <<coshf>> is an extension.
48
 
49
QUICKREF
50
        cosh ansi pure
51
        coshf - pure
52
*/
53
 
54
/******************************************************************
55
 * Hyperbolic Cosine
56
 *
57
 * Input:
58
 *   x - floating point value
59
 *
60
 * Output:
61
 *   hyperbolic cosine of x
62
 *
63
 * Description:
64
 *   This routine returns the hyperbolic cosine of x.
65
 *
66
 *****************************************************************/
67
 
68
#include "fdlibm.h"
69
#include "zmath.h"
70
 
71
#ifndef _DOUBLE_IS_32BITS
72
 
73
double
74
_DEFUN (cosh, (double),
75
        double x)
76
{
77
  return (sineh (x, 1));
78
}
79
 
80
#endif /* _DOUBLE_IS_32BITS */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.