149k views
1 vote
Problem 3 (3 pts): Among the following two algorithms, which is the best for evaluating f(x) = tan(x) − sin(x) for x ∼ 0? Briefly explain. (a) (1/ cos(x) − 1) sin(x), (b) tan(x) sin2 (x)/(cos(x) + 1).

User Spstanley
by
5.8k points

1 Answer

2 votes

Answer:

A) (1/ cos(x) − 1) sin(x)

Explanation:

Given the function

f(x) = tan(x) - sin(x)

According to the trigonometry identity, tan(x) = sin(x)/cos(x)

Substituting this into the original equation, we will have;

f(x) = sin(x)/cos(x) - sin(x)

Since sin(x) is common at the numerator, we will factor it out to have;

f(x) = sin(x){1/cos(x)-1}

Therefore the first option (1/ cos(x) − 1) sin(x) is the best algorithm for evaluating the function since we could generate the function (1/ cos(x) − 1) sin(x) using the function f(x) = tan(x) - sin(x).

User Udayakumar Rayala
by
6.2k points