Search code examples
cfunctiontrigonometryexp

How to translate an equation with exponents and sin function to C?


How could I write it in C language? I tried many things, but it seems that I cannot understand the exp and sin functions.


Solution

  • A direct implementation could be:

    double y = exp(pow(sin(x),3)) + pow(x,6) - 2*pow(x,4) - pow(x,3) - 1.0;