Given 3 continuous functions as follows - f(x) = e-|x| g(x) = sin(x) h(x) = x2.5 + x2 - 3*x Composition of functions f and g is defined as (f o g)(x) = f(g(x)). Hence one possible composition for the above functions can be (f o g o h) which, for a given x, behaves as f(g(h(x))). Since there are a total of 6 compositions which can be created using the functions above, for a given x, output the range of the set of values attained by these compositions. Note: For a given set of values, say {-4, -1, 0, 5, 9}, range is defined as the difference between the maximum and minimum value in the set, which is equal to 9-(-4)=13 in this case. INPUT: One line containing the value of x. (real, precise up to 6 decimal places) OUTPUT: One line containing the desired value rounded off to 6 decimal places. CONSTRAINTS: -20 <= x <= 20 NOTE: Feel free to use any math.h library function you want.

Author: Anil Meena
Login to Answer
Sort By:
My Answer