Question: Please Code in C The exponential function exp(2) = eappears in many physical, biological and financial phenomena: Radioactive substances decay at exponential rate. Pandemic viruses
Please Code in C


The exponential function exp(2) = eappears in many physical, biological and financial phenomena: Radioactive substances decay at exponential rate. Pandemic viruses may have exponential growth (or exponential decay when contained). Interest-on-interest provokes exponential growth of monetary wealth. The exponential function is mathematically interesting as its derivative (the slope of its curve when drawn) is the function itself: d e". dc In order to enable simulation of the physical, biological or financial phenomena discussed above, computers must be able to compute the values of the exponential function, given a value for its argument x. This computation runs in software, as computer hardware does not contain circuits to compute the exponential. Fast and accurate algorithms to compute the exponential functions are hard to develop. Their design requires precise knowledge of the internal workings of floating-point hardware. There is an easy way to compute the exponential for a value x between -1 and 1. This way of computing the exponential is based on a Taylor expansion of the exponential at 0: 1 1 e* = -z = 1+1.2+==+ 23 + i! 2.3 1 r* +... 2.3.4 i=0 This Taylor expansion converges, so an approximation to the exponential can be obtained by computing 72 1 z = 1+1.7+= 1 + 2.3 .23 + 1 r4+ 2.3.4 1 + 2" n! Write a program exponential.c that does the following: Asks the user to enter a real number r that is between - 1 and 1 (both included). If the user enters a number that does not satisfy this condition, the program prompts the user again, until a number 2 s.t. -1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
