Skip to main content
1 of 2
Goofy
  • 3.7k
  • 11
  • 17

Doing the math....

With[{x = Pi/50},
  With[{uvint = 
     Hold[2 Sin[y]  Sin[z]  test[x, y, z], {y, 0, Pi/2}, {z, 0, 
           Pi/2}] /. {v_, a_, b_} :> a < v < b /. {y -> u + v, 
         z -> u - v} // Apply@List // 
      ReplaceAll[HeavisideTheta -> UnitStep]},
   With[{interval = 
      Reduce[Rest[uvint], {u, v}] /. 
        Or | And -> 
         List /. {Verbatim[Inequality][a_?NumericQ, _, v_, _, 
          b_?NumericQ] :> 
         Flatten@{v, 
           NumericalSort@
            Select[{a, b, x/2, Pi/2 - x/2}, a <= # <= b &]},
        Verbatim[Inequality][a_, _, v_, _, b_] :> {v, a, b}
        }
     },
    NIntegrate[First[uvint], ##, 
        Exclusions -> {(*2u==Pi/16,2u==Pi-Pi/16,*)2 v == x, 
          2 v == -x}, MaxRecursion -> 20, MinRecursion -> 1, 
        AccuracyGoal -> 20, WorkingPrecision -> 20] & @@@ interval // 
     Total
    ]]] // AbsoluteTiming

This takes around 7-8 seconds or little more. So still not fast, but convergent.

Goofy
  • 3.7k
  • 11
  • 17