# Why RegionMeasure returns a complex value?

Bug introduced in 12.1 or earlier and persisting through 13.2

Consider the following region:

region = BooleanRegion[#1 || #2 &, {Circle[{0, 0},
63.01771474209481, {-0.3085423746716913, 0}],
Circle[{0, 0}, 63.01771474209481, {0, 0.3085423746716913}]}]


Why in Mathematica 12.1 RegionMeasure[region] returns a complex value, and how to avoid it without dealing with explicit calculations (despite the fact that it is possible to make this easily)?

RegionMeasure[region]


38.8873 + 0.0000128693 I

• Machine precision calculations neither track nor control precision. You get what you get. Arbitrary precision will track and attempt to control precision. Exact numbers will give exact results. Commented Feb 4, 2022 at 15:50
• Per the tag wiki for bugs: "Please do not use this tag for new questions." -- Now, does the community think it's a bug? Commented Feb 4, 2022 at 18:00
• I think it is a bug. Worth reporting to the support. Added the BUG header and the tag. Commented Feb 5, 2022 at 4:03

This is numerical inaccuracy stemming from your machine precision inputs. Setting a WorkingPrecision for RegionMeasure takes care of the problem:
RegionMeasure[region, WorkingPrecision -> 10]
$$$$

• Why not WorkingPrecision -> \$MachinePrecision? (Why so much less than?) -- Oh, bizarre. It makes no difference. But I usually use WorkingPrecision -> 16 because it's shorter to type, and that works. -- Oh, wow, WorkingPrecision -> 10. fails, too. That's wierd. Commented Feb 4, 2022 at 18:00
• Hmm, WorkingPrecision -> p seems to work only if p is an integer (fails for Real and Rational). Commented Feb 4, 2022 at 18:07
• @MichaelE2 This looks like a bug in WorkingPrecision` functionality. Worth reporting to support. Commented Feb 5, 2022 at 3:58