Module 15
Module 15
Numeric Functions
Trigonometric functions:
cos Compute cosine
sin Compute sine
tan Compute tangent
acos Compute arc cosine
asin Compute arc sine
atan Compute arc tangent a
atan2 Compute arc tangent with two parameters
Hyperbolic functions:
cosh Compute hyperbolic cosine
sinh Compute hyperbolic sine
tanh Compute hyperbolic tangent
acosh Compute arc hyperbolic cosine
asinh Compute arc hyperbolic sine
atanh Compute arc hyperbolic tangent
Power functions:
pow Raise to power pow(base, exponent)
sqrt Compute square root
cbrt Compute cubic root
hypot Compute hypotenuse
Exponential and logarithmic functions:
exp Compute exponential function
frexp Get significand and exponent
ldexp Generate value from significand and exponent
log Compute natural logarithm
log10 Compute common logarithm
modf Break into fractional and integral parts
exp2 Compute binary exponential function
expm1 Compute exponential minus one
ilogb Integer binary logarithm
log1p Compute logarithm plus one
log2 Compute binary logarithm
logb Compute floating-point base logarithm
scalbn Scale significand using floating-point base exponent
scalbln Scale significand using floating-point base exponent (long)
Mathematical Expressions C++ Expressions
𝑒 2𝑥 exp (2x)
10210 pow(102,10)
3
25𝑥 cbrt (25*x)
3𝑛 2 Pow (3*n, 2)
1. Create a C++ program that allows you to input values for x
and y, the program will then calculate the following;
a. tan−1 3𝑥 2 + 𝑒 𝑥𝑦
3
b. 3𝑥𝑦 + 3𝑥 2
𝑥𝑦 2
c. sin + 𝑒 𝑥𝑦
2𝑥
3𝑦 2 3𝑥 2
d. + 𝑒
𝑥𝑦 2
e. 𝑐 = 𝑥2 + 𝑦2
a. 3𝑥 2 + 𝑒 𝑥𝑦 − 3 ∗ 𝑝𝑜𝑤 𝑥, 2 + exp(𝑠𝑞𝑟𝑡 𝑥 ∗ 𝑦 )
3 2
b. 3𝑥𝑦 + 3𝑥 −𝑐𝑏𝑟𝑡 3 ∗ 𝑥 ∗ 𝑦 + 𝑝𝑜𝑤 3 ∗ 𝑥, 2
𝑥𝑦 2
c. sin + 𝑒 𝑥𝑦 −(sin(x∗pow(y,2))/(2∗x)) + exp(x*y)
2𝑥
3𝑦 2 2
d. + 𝑒 3𝑥 sqrt( ((3∗pow(y,2)) / (x∗pow(y,2))) + exp(3*pow(x,2)) )
𝑥𝑦 2