Problematic expression for expand



Hello, I find the following expression is problematic for expand
in the sense that it takes a tremendously long time and a very
great amount of memory. What makes it so difficult?

Is there a way to expand it from the leaves upward?
I tried to figure out a way to apply a function from the
bottom up, but I couldn't figure it out.

Incidentally this expression originates from trying to construct
a cubic spline (the cspline function in package interpol) from
some points like [%pi/2, %pi].

Thanks for any insights,

Robert Dodier

((2/%pi-1)*(((%pi/2-1)/(%pi-1)-1)
                  *((6*(2/%pi-2*(4-%pi)/%pi)/%pi
                   -(6*(2*(4-%pi)/%pi-(%pi-2)/(%pi/2-1))/(%pi-1)
                    -6*((%pi-2)/(%pi/2-1)-2)*(%pi/2-1)/(%pi*(%pi-1)))
                    /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2)))
                   /(((%pi/2-1)/(%pi-1)-1)
                    /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
                    +2)
                   -(6*(2*(2*%pi-5)/%pi-2/%pi)/%pi
                    -(6*(2/%pi-2*(4-%pi)/%pi)/%pi
                     -(6*(2*(4-%pi)/%pi-(%pi-2)/(%pi/2-1))/(%pi-1)
                      -6*((%pi-2)/(%pi/2-1)-2)*(%pi/2-1)/(%pi*(%pi-1)))
                      /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2)))
                     /(2*(((%pi/2-1)/(%pi-1)-1)
                         /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
                         +2)))
                    /(2*(2-1/(4*(((%pi/2-1)/(%pi-1)-1)
                                /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
                                +2)))
                       *(((%pi/2-1)/(%pi-1)-1)
                        /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
                        +2)))
                  /((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2)
                  +(6*(2*(4-%pi)/%pi-(%pi-2)/(%pi/2-1))/(%pi-1)
                   -6*((%pi-2)/(%pi/2-1)-2)*(%pi/2-1)/(%pi*(%pi-1)))
                   /((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
        /2
        +6*((%pi-2)/(%pi/2-1)-2)/%pi)
        *(x^3-x)
        /6
        +2*x