Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For $x \approx y$, how may we avoid loss of significance errors in computing $\tan(x) - \tan(y)$?

I don't think Taylor polynomials will be useful here, so I am thinking the answer lies in some sort of trig identity trick. I have managed to get the approximation $$\tan(x) - \tan(y) \approx \frac{4 \sin(x) \sin(y)}{\sin(2x) \sin(2y)} (x - y)$$ for $x \approx y$, but I'm not sure that this helps, as it still contains the quantity $x - y$, which could introduce loss of significance errors itself. Thank you for any help!

share|cite|improve this question
Assume there was a better way to compute $\tan x - \tan y$. Then you would have discovered a way to nicely compute $x-y=\frac{\sin(2x)\sin(2y)}{4\sin(x)\sin(y)}(\tan(x)-\tan(y))$ with less loss of signoificance error. Go figure. – Hagen von Eitzen Jan 27 '13 at 12:11
up vote 5 down vote accepted

Maybe I'm being too simplistic here, but what about a simple first order approximation? Assume $x=y+\delta$:

$$\tan{(y+\delta)}-\tan{y} \approx (\sec^2{y}) \: \delta$$

share|cite|improve this answer
Or to order 2: $\delta \left(\tan ^2(y)+1\right)+\delta ^2 \left(\tan ^3(y)+\tan (y)\right)+...$ I think yours is the right way to go. – nbubis Jan 27 '13 at 13:10

As Hagen van Eitzen has remarked, if $x$ and $y$ are approximately equal there is bound to be some significance loss. But in the difference $\ \tan x-\tan y\ $ there is the additional loss caused by $\tan$ becoming large near odd multiples of ${\pi\over 2}$. The latter can be avoided by writing $$\tan x-\tan y={\sin(x-y)\over\cos x\cos y}\ .$$

share|cite|improve this answer
I apologize for this stray comment but would you mind if I send you a more general email(which I shall not disclose in public)?(for reference,I am in high school).(I didn't want to send an unsolicited email). – user54807 Jan 27 '13 at 15:22
My potential email is not related to this post. – user54807 Jan 27 '13 at 15:28
@Worker: Send it, and I will see. – Christian Blatter Jan 27 '13 at 16:04
That is very kind of you.I have sent it. – user54807 Jan 27 '13 at 16:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.