Consider the following Python implementations of Heron's formula:
import math
def heron1(a, b, c):
"""
Simplisitic implementation of Heron's formula for the area of a triangle
"""
s = (a + b + c) / 2
return math.sqrt(s*(s-a)*(s-b)*(s-c))
def heron2(a, b, c):
"""
Numerically stable implementation of Heron's formula for the area of a
triangle -- better for long, thin triangles.
"""
# Order the side lengths so that a >= b >= c
a, b, c = sorted((a, b, c), reverse=True)
return math.sqrt((a+(b+c)) * (c-(a-b)) * (c+(a-b)) * (a + (b-c)))/4
For the suggested triangle, the second of these functions clearly works better, and gives the area, $5 \times 10^{-14}$, correct to machine precision whereas the simplistic implementation is out by about 0.08%.
In [x]: a, b, c = 1, 1, 1.e-13
In [x]: print('Simple: {}, Stable: {}, Exact: 5.e-14'
.format(heron1(a,b,c), heron2(a,b,c)))
Simple: 4.9960036108132044e-14, Stable: 5e-14, Exact: 5.e-14
The problem with the simplistic calculation is that the semiperimeter, $s$, is very close in value to the longer sides' lengths leading to loss of precision in the subtractions. The second implementation avoids this by not subtracting a small number from a very much larger one. Removing the parentheses breaks the algorithm since addition and subtraction are evaluated left-to-right.