From: Robert Israel on

> On 2010-07-31, achille <achille_hui(a)yahoo.com.hk> wrote:
> > On Jul 31, 11:14 pm, Ilmari Karonen <usen...(a)vyznev.invalid> wrote:
> >> On 2010-07-31, Golabi Doon <golabid...(a)gmail.com> wrote:
> >>
> >> > Consider the problem:
> >> >
> >> > sum_k arctan(x_k) < a
> >> >
> >> > where k=1,...n and x_k are real variables and "a" is a given constant.
> >> > You choose a specific choice of values for x_1,...x_n and give it to
> >> > me. I should give you one of these two answers: "your choice satsfies
> >> > the inequality" or "I don't know". Of course, I would like to avoid
> >> > the answer "I don't know" as much as I can.
> >>
> >> > However, I am limited to check your solution only with elementary
> >> > tools that can handlelow-degree polynomials possibly with "a few"
> >> > applications of elementary functions (note that the original function
> >> > uses n applications of arctan, and n can be large, so it is not
> >> > desired).
> >>
> >> What you seem to want is an "easily computable" lower bound for
> >> arctan(x). For that, have you considered a simple piecewise linear
> >> approximation?
> >
> > How about approximate atan(x) by a piecewise rational function:
> >
> > f(x) = pi/2 - x/(k+x^2) when x > 1
> > x/(1+k*x^2) when -1 <= x <= 1
> > -pi/2 -x/(k+x^2) when x < -1
> >
> > where k = 4/pi - 1. It is easy to check for all x,
> >
> > | atan(x) - f(x) | < 0.007
> > and | atan(x)/f(x) - 1 | < 0.011
>
> That's a very nice approximation. However, the OP seems to be
> specifically looking for an upper bound (and not a lower bound as I
> wrote above by mistake), whereas your f(x) is less then arctan(x)
> whenever -1 < x < 0 or x > 1.

Here are some upper and lower bounds:

For 0 <= x <= 1,
x/(1 + x^2/(3 + x^2/(5/4 + 9/28*x^2))) <= arctan(x)
<= x/(1 + x^2/(3 + x^2/(5/4 + x^2/(28/9 + 64/81*x^2))))

Extend to all x using arctan(x) = Pi/2 - arctan(1/x) for x >= 1
and arctan(-x) = -arctan(x).
--
Robert Israel israel(a)math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
From: achille on
On Aug 2, 2:52 am, Ilmari Karonen <usen...(a)vyznev.invalid> wrote:
> On 2010-07-31, achille <achille_...(a)yahoo.com.hk> wrote:
>
>
>
> > On Jul 31, 11:14 pm, Ilmari Karonen <usen...(a)vyznev.invalid> wrote:
> >> On 2010-07-31, Golabi Doon <golabid...(a)gmail.com> wrote:
>
> >> > Consider the problem:
>
> >> > sum_k arctan(x_k) < a
>
> >> > where k=1,...n and x_k are real variables and "a" is a given constant.
> >> > You choose a specific choice of values for x_1,...x_n and give it to
> >> > me. I should give you one of these two answers: "your choice satsfies
> >> > the inequality" or "I don't know". Of course, I would like to avoid
> >> > the answer "I don't know" as much as I can.
>
> >> > However, I am limited to check your solution only with elementary
> >> > tools that can handlelow-degree polynomials possibly with "a few"
> >> > applications of elementary functions (note that the original function
> >> > uses n applications of arctan, and n can be large, so it is not
> >> > desired).
>
> >> What you seem to want is an "easily computable" lower bound for
> >> arctan(x).  For that, have you considered a simple piecewise linear
> >> approximation?
>
> > How about approximate atan(x) by a piecewise rational function:
>
> > f(x) = pi/2 - x/(k+x^2)   when x > 1
> >        x/(1+k*x^2)        when -1 <= x <= 1
> >        -pi/2 -x/(k+x^2)   when x < -1
>
> > where k = 4/pi - 1. It is easy to check for all x,
>
> >      | atan(x) - f(x)   | < 0.007
> > and  | atan(x)/f(x) - 1 | < 0.011
>
> That's a very nice approximation.  However, the OP seems to be
> specifically looking for an upper bound (and not a lower bound as I
> wrote above by mistake), whereas your f(x) is less then arctan(x)
> whenever -1 < x < 0 or x > 1.
>
> --
> Ilmari Karonen
> To reply by e-mail, please replace ".invalid" with ".net" in address.

It is easy to convert what I say to an upper bound:

atan(x) < f(x) + min(0.007,abs(0.011*f(x)))

This looks ugly as math. but once you calculate f(x),
the extra cost of adding the error term is tiny.
From: Golabi Doon on
Thanks to everyone. The idea of using an upper bound on arctan and
later the proposed formulas are extremely useful and perfectly fit for
my purpose. I appreciate your help.

Regards

Golabi

On Aug 1, 9:31 pm, achille <achille_...(a)yahoo.com.hk> wrote:
> On Aug 2, 2:52 am, Ilmari Karonen <usen...(a)vyznev.invalid> wrote:
>
>
>
>
>
> > On 2010-07-31, achille <achille_...(a)yahoo.com.hk> wrote:
>
> > > On Jul 31, 11:14 pm, Ilmari Karonen <usen...(a)vyznev.invalid> wrote:
> > >> On 2010-07-31, Golabi Doon <golabid...(a)gmail.com> wrote:
>
> > >> > Consider the problem:
>
> > >> > sum_k arctan(x_k) < a
>
> > >> > where k=1,...n and x_k are real variables and "a" is a given constant.
> > >> > You choose a specific choice of values for x_1,...x_n and give it to
> > >> > me. I should give you one of these two answers: "your choice satsfies
> > >> > the inequality" or "I don't know". Of course, I would like to avoid
> > >> > the answer "I don't know" as much as I can.
>
> > >> > However, I am limited to check your solution only with elementary
> > >> > tools that can handlelow-degree polynomials possibly with "a few"
> > >> > applications of elementary functions (note that the original function
> > >> > uses n applications of arctan, and n can be large, so it is not
> > >> > desired).
>
> > >> What you seem to want is an "easily computable" lower bound for
> > >> arctan(x).  For that, have you considered a simple piecewise linear
> > >> approximation?
>
> > > How about approximate atan(x) by a piecewise rational function:
>
> > > f(x) = pi/2 - x/(k+x^2)   when x > 1
> > >        x/(1+k*x^2)        when -1 <= x <= 1
> > >        -pi/2 -x/(k+x^2)   when x < -1
>
> > > where k = 4/pi - 1. It is easy to check for all x,
>
> > >      | atan(x) - f(x)   | < 0.007
> > > and  | atan(x)/f(x) - 1 | < 0.011
>
> > That's a very nice approximation.  However, the OP seems to be
> > specifically looking for an upper bound (and not a lower bound as I
> > wrote above by mistake), whereas your f(x) is less then arctan(x)
> > whenever -1 < x < 0 or x > 1.
>
> > --
> > Ilmari Karonen
> > To reply by e-mail, please replace ".invalid" with ".net" in address.
>
> It is easy to convert what I say to an upper bound:
>
> atan(x) < f(x) + min(0.007,abs(0.011*f(x)))
>
> This looks ugly as math. but once you calculate f(x),
> the extra cost of adding the error term is tiny.- Hide quoted text -
>
> - Show quoted text -