logo

Crowdly

Write a script that has 1)  a function sinEstimate(x,N) that estimates the sin...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Write a script that has

1)  a function sinEstimate(x,N) that estimates the sin of x using the equation below. If N is not provided, then set it be default to 10. 

2) a  main() function to calculate the error between sinEstimate(x,N) and the build sin(x) from the math module. 

Examples (in the main() function):

# Example 1

print("The absolute error of estimating sinEstimate(pi) is:", abs(sinEstimate(pi)-sin(pi)))

The absolute error of estimating sinEstimate(pi) is: 1.0348063438373582e-11

# Example 2

 print("The absolute error of estimating sinEstimate(pi,5) is:", abs(sinEstimate(pi,5)-sin(pi)))

The absolute error of estimating sinEstimate(pi,5) is: 0.00044516023820933523

More questions like this

Want instant access to all verified answers on elearn.squ.edu.om?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!