       Re: question

• To: mathgroup at smc.vnet.net
• Subject: [mg77847] Re: [mg77827] question
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Mon, 18 Jun 2007 06:58:23 -0400 (EDT)
• Reply-to: hanlonr at cox.net

```o = 2*Cos[Pi/48]*(1 - Cos[Pi/48]^2)^(1/2) + 2*Cos[Pi/48]^2 - 1;

ClearSystemCache[]

RootReduce[(FullSimplify[#1,
ComplexityFunction -> (Count[{#1}, _Cos, Infinity] &)] &)[
o]]]]

{20.088752000000014,
Sqrt[(1/2)*(2 + Sqrt[
2 - Sqrt])]}

ClearSystemCache[]

RootReduce[Simplify[o /. 1 - Cos[x_]^2 -> Sin[x]^2]]]]

{0.0916960000000131,
Sqrt[(1/2)*(2 + Sqrt[
2 - Sqrt])]}

ClearSystemCache[]

Timing[o // TrigFactor // FullSimplify]

{2.2494800000000055, Cos[Pi/24] +
Sin[Pi/24]}

ClearSystemCache[]

Timing[o // TrigToExp // FullSimplify]

{2.2507500000000107, Cos[Pi/24] +
Sin[Pi/24]}

ClearSystemCache[]

Timing[o // TrigToExp // Simplify // RootReduce // ToRadicals]

{8.879419999999996,
Sqrt[(1/2)*(2 + Sqrt[
2 - Sqrt])]}

ClearSystemCache[]

Timing[o // TrigFactor // Simplify // RootReduce // ToRadicals]

{8.879437999999993,
Sqrt[(1/2)*(2 + Sqrt[
2 - Sqrt])]}

Bob Hanlon

---- dimitris <dimmechan at yahoo.com> wrote:
> Two eforts in Mathematica 5.2 in order
> to simplify o below
>
> o = 2*Cos[Pi/48]*(1 - Cos[Pi/48]^2)^(1/2) + 2*Cos[Pi/48]^2 - 1;
>
> First leaving Mathematica do the job.
>
> Timing[ToRadicals[RootReduce[(FullSimplify[#1, ComplexityFunction ->
> (Count[{#1}, _Cos, Infinity] & )] & )[o]]]]
> {43.031*Second, Sqrt[(1/2)*(2 + Sqrt[2 - Sqrt])]}
>
> Then help a bit Mathematica.
> I couldn't find a built in command to simplify 1 - Cos[Pi/48]^2 to
> Sin[Pi/48]^2. That's why the adding of a rule.
>
> Timing[ToRadicals[RootReduce[Simplify[o /. 1 - Cos[Pi/48]^2 ->
> Sin[Pi/
> 48]^2]]]]
> {0.25*Second, Sqrt[(1/2)*(2 + Sqrt[2 - Sqrt])]}
>
> Any other suggestions will be highly appreciated.
>
> Dimitris
>
>

```

• Prev by Date: Re: newlines, newlines ...
• Next by Date: Re: a beginner's question
• Previous by thread: Re: question
• Next by thread: question