exp.3 (3a8617a83f16ffc9db4f96e1f0f21af94078e6b1) | exp.3 (7a15a32a17f4c2cbeb6f842c4c6b1cf93e4639e7) |
---|---|
1.\" Copyright (c) 1985, 1991 Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91 | 1.\" Copyright (c) 1985, 1991 Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91 |
33.\" $Id: exp.3,v 1.7 1994/02/11 18:34:05 jtc Exp $ | 33.\" $Id: exp.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $ |
34.\" 35.Dd July 31, 1991 36.Dt EXP 3 37.Os BSD 4 38.Sh NAME 39.Nm exp , | 34.\" 35.Dd July 31, 1991 36.Dt EXP 3 37.Os BSD 4 38.Sh NAME 39.Nm exp , |
40.Nm expf , |
|
40.Nm exp2 , | 41.Nm exp2 , |
42.Nm exp2f , |
|
41.Nm exp10 , | 43.Nm exp10 , |
44.Nm exp10f , |
|
42.Nm expm1 , | 45.Nm expm1 , |
46.Nm expm1f , |
|
43.Nm log , | 47.Nm log , |
48.Nm logf , |
|
44.Nm log2 , | 49.Nm log2 , |
50.Nm log2f , |
|
45.Nm log10 , | 51.Nm log10 , |
52.Nm log10f , |
|
46.Nm log1p , | 53.Nm log1p , |
47.Nm pow | 54.Nm log1pf , 55.Nm pow , 56.Nm powf |
48.Nd exponential, logarithm, power functions 49.Sh SYNOPSIS 50.Fd #include <math.h> 51.Ft double 52.Fn exp "double x" | 57.Nd exponential, logarithm, power functions 58.Sh SYNOPSIS 59.Fd #include <math.h> 60.Ft double 61.Fn exp "double x" |
62.Ft float 63.Fn expf "float x" |
|
53.Ft double 54.Fn expm1 "double x" | 64.Ft double 65.Fn expm1 "double x" |
66.Ft float 67.Fn expm1f "float x" |
|
55.Ft double 56.Fn log "double x" | 68.Ft double 69.Fn log "double x" |
70.Ft float 71.Fn logf "float x" |
|
57.Ft double 58.Fn log10 "double x" | 72.Ft double 73.Fn log10 "double x" |
74.Ft float 75.Fn log10f "float x" |
|
59.Ft double 60.Fn log1p "double x" | 76.Ft double 77.Fn log1p "double x" |
78.Ft float 79.Fn log1pf "float x" |
|
61.Ft double 62.Fn pow "double x" "double y" | 80.Ft double 81.Fn pow "double x" "double y" |
82.Ft float 83.Fn powf "float x" "float y" |
|
63.Sh DESCRIPTION 64The 65.Fn exp | 84.Sh DESCRIPTION 85The 86.Fn exp |
66function computes the exponential value of the given argument | 87and the 88.Fn expf 89functions compute the exponential value of the given argument |
67.Fa x . 68.Pp 69The 70.Fn expm1 | 90.Fa x . 91.Pp 92The 93.Fn expm1 |
71function computes the value exp(x)\-1 accurately even for tiny argument | 94and the 95.Fn expm1f 96functions compute the value exp(x)\-1 accurately even for tiny argument |
72.Fa x . 73.Pp 74The 75.Fn log | 97.Fa x . 98.Pp 99The 100.Fn log |
76function computes the value of the natural logarithm of argument | 101and the 102.Fn logf 103functions compute the value of the natural logarithm of argument |
77.Fa x. 78.Pp 79The 80.Fn log10 | 104.Fa x. 105.Pp 106The 107.Fn log10 |
81function computes the value of the logarithm of argument | 108and the 109.Fn log10f 110functions compute the value of the logarithm of argument |
82.Fa x 83to base 10. 84.Pp 85The 86.Fn log1p | 111.Fa x 112to base 10. 113.Pp 114The 115.Fn log1p |
87function computes | 116and the 117.Fn log1pf 118functions compute |
88the value of log(1+x) accurately even for tiny argument 89.Fa x . 90.Pp 91The 92.Fn pow | 119the value of log(1+x) accurately even for tiny argument 120.Fa x . 121.Pp 122The 123.Fn pow |
93computes the value | 124and the 125.Fn powf 126functions compute the value |
94of 95.Ar x 96to the exponent 97.Ar y . 98.Sh ERROR (due to Roundoff etc.) | 127of 128.Ar x 129to the exponent 130.Ar y . 131.Sh ERROR (due to Roundoff etc.) |
99exp(x), log(x), expm1(x) and log1p(x) are accurate to within | 132.Fn exp(x) , 133.Fn log(x) , 134.Fn expm1(x) and 135.Fn log1p(x) 136are accurate to within |
100an 101.Em ulp , 102and log10(x) to within about 2 103.Em ulps ; 104an 105.Em ulp 106is one 107.Em Unit --- 32 unchanged lines hidden (view full) --- 1402**53 for 141.Tn IEEE 142754. 143.Sh RETURN VALUES 144These functions will return the appropriate computation unless an error 145occurs or an argument is out of range. 146The functions 147.Fn exp , | 137an 138.Em ulp , 139and log10(x) to within about 2 140.Em ulps ; 141an 142.Em ulp 143is one 144.Em Unit --- 32 unchanged lines hidden (view full) --- 1772**53 for 178.Tn IEEE 179754. 180.Sh RETURN VALUES 181These functions will return the appropriate computation unless an error 182occurs or an argument is out of range. 183The functions 184.Fn exp , |
148.Fn expm1 149and | 185.Fn expm1 , |
150.Fn pow 151detect if the computed value will overflow, 152set the global variable 153.Va errno to 154.Er ERANGE 155and cause a reserved operand fault on a 156.Tn VAX 157or 158.Tn Tahoe . | 186.Fn pow 187detect if the computed value will overflow, 188set the global variable 189.Va errno to 190.Er ERANGE 191and cause a reserved operand fault on a 192.Tn VAX 193or 194.Tn Tahoe . |
159The function | 195The functions |
160.Fn pow x y 161checks to see if 162.Fa x 163< 0 and 164.Fa y 165is not an integer, in the event this is true, 166the global variable 167.Va errno --- 120 unchanged lines hidden --- | 196.Fn pow x y 197checks to see if 198.Fa x 199< 0 and 200.Fa y 201is not an integer, in the event this is true, 202the global variable 203.Va errno --- 120 unchanged lines hidden --- |