Resources

Numerical accuracy

The calculations in our apps: the policy each one is under, the precision it runs at, and the code itself.

This device: processor, memory, graphics The standard Precision is not robustness

  • 941 calculation policies
  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • 437 open items
  • Last reviewed

Calculation policies

A policy says how one family of calculations keeps its precision. Open one to see its calculations, by source file, and their code.

  • Open pit benches, haul ramp and pit surface

    Works out the outline, area and perimeter of each bench, a haul ramp down the pit wall with its length and drop, and the pit cut into the ground with the volume dug.

    • CivilCraft
    64-bit, stated limit
    6 calculations
    64-bit
  • Outline minus holes: area and boundary lengths

    Measures a closed outline with other shapes cut out of it: the remaining area, the length of outline left and the length of the cuts, as used for planted areas around paving, walls and steps.

    • CivilCraft
    64-bit, direct
    5 calculations
    64-bit Open item
  • Overhead conductor sag and tension

    Works out the load on a conductor in each load case, its tension by change of state on the ruling span, and the sag, length and support tensions of every span.

    • CivilCraft
    64-bit, stated limit
    10 calculations in 2 files
    64-bit
  • Overhead line checks: clearances, support loads and sizing

    Checks an overhead line span by span and support by support: clearance to the ground and to obstacles, phase spacing, insulator swing, the loads on each support, its size, foundation and fittings.

    • CivilCraft
    64-bit, stated limit
    17 calculations in 4 files
    64-bit Open item
  • Pad daylight lines and the graded surface

    Finds where the cut and fill slopes around a pad meet the existing ground, and builds the proposed surface from the pad, its slopes and the ground outside them.

    • CivilCraft
    64-bit, stated limit
    7 calculations
    64-bit
  • Pad side slopes and retaining walls

    Reads a slope as typed, and works out the length, face area and heights of the retaining walls around a pad and the warnings for tall walls and steep slopes.

    • CivilCraft
    64-bit, direct
    4 calculations
    64-bit
  • Parametric PCB footprints

    Pad positions, pad sizes and the courtyard of standard-style footprints, worked out from pitch, row spacing and pin count.

    Every app 64-bit, stated limit
    7 calculations
    64-bit
  • Parcels: deed calls, closure, area and legal description

    Reads bearings and distances, runs deed calls into corners, reports the misclosure and precision, and works out a parcel's courses, area, perimeter, labels and legal description.

    • CivilCraft
    64-bit, direct
    13 calculations in 2 files
    64-bit Open item
  • Pass or fail against a regulation limit

    Decides whether a found value meets the minimum, maximum or range of a regulation rule.

    • CadCraft
    • BimCraft
    • CivilCraft
    • DetailCraft
    64-bit, stated limit
    1 calculation
    64-bit
  • People flow and evacuation time

    How fast people pass doors, corridors and stairs, which way each room empties, and how long it takes everyone to reach an exit.

    Every app 64-bit, stated limit
    6 calculations
    64-bit
  • Pipe, duct and gas networks

    Heads, pressures, flows and velocities in a steady network of pipes, pumps and fittings.

    Every app 64-bit, stated limit
    9 calculations in 2 files
    64-bit Open item
  • Piping in an IFC file as PCF components

    Reads pipe segments, fittings and valves from an IFC file and gives their end points, bores, bend angles and center points in millimeters.

    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit, direct
    4 calculations
    64-bit
  • Pit and solar table meshes in the 3D view

    The 3D view geometry for open pits (haul ramp ribbons, bench rims) and ground solar tables.

    • CivilCraft
    Display only
    4 calculations in 3 files
    32-bit, display only
  • Placing a scanned sheet in the project

    Works out the scale, rotation and position that put a scanned drawing into project coordinates, from a stated scale or from matched points, and converts traced lines with it.

    • CivilCraft
    64-bit, direct
    12 calculations
    64-bit Open item
  • Plan drawing and section sheets for DXF and PDF

    Turns the model into the linework and labels of the plan drawing and the cross-section sheets, as they are drawn on screen and written to DXF and PDF.

    • CivilCraft
    64-bit, direct
    7 calculations in 2 files
    64-bit
  • Plan sheets and plan-and-profile sheets as PDF

    Places the plan and the profile on paper at a stated scale and writes the page as a vector PDF.

    • CivilCraft
    64-bit, stated limit
    14 calculations in 2 files
    64-bit
  • Planar linkages (closed loops)

    The pose of four-bars, slider-cranks and other planar linkages, their sweep, velocity ratios, mobility and Grashof class.

    Every app 64-bit, stated limit
    9 calculations
    64-bit Open item
  • Plant 3D models for the 3D view

    Reads a plant's own 3D model from a GLB file and scales it to a unit box so the 3D view can draw it at the plant's size.

    • CivilCraft
    Display only
    4 calculations in 2 files
    32-bit, display only
  • Plant sizes, spacing and symbols

    The height, spread, spacing and supplied sizes of each plant species, and the 2D symbol and library item made from them.

    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit, stated limit
    10 calculations
    64-bit
  • Plant symbols from SVG files and CAD blocks

    Turns an SVG drawing or a CAD block into a plant symbol kept in the project, and scales it to each plant's spread on the plan.

    • CivilCraft
    64-bit, stated limit
    3 calculations
    64-bit
  • Planting: bed and hedge fills, planted areas and their quantities

    Fills beds, hedges and planted areas with plants at a spacing, counts each species, and totals areas, soil and mulch volumes and edging lengths.

    • CivilCraft
    64-bit, direct
    11 calculations in 2 files
    64-bit Open item
  • Polygon triangulation (ear clipping)

    Splits a flat polygon with holes into triangles, for caps of extruded sections and faces with holes.

    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit, direct
    9 calculations
    64-bit
  • Polygon triangulation by ear clipping

    Splits a flat polygon with holes into triangles for IFC shapes.

    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit, direct
    5 calculations
    64-bit
  • Power line tables, quantities and GIS export

    Turns a line study into stringing tables, a support table, material quantities and GIS features in the project's units.

    • CivilCraft
    64-bit, direct
    7 calculations
    64-bit Open item
  • Power network: load current and voltage drop

    Joins lines, cable routes and equipment into a network and works out the current in every span and cable and the voltage drop at every node from each source.

    • CivilCraft
    64-bit, stated limit
    5 calculations
    64-bit
  • Project objects exported as GIS layers

    Turns survey points, contours, alignments, pads, corridor lines, pipes and structures into GIS features with their attribute values, in grid coordinates.

    • CivilCraft
    64-bit, stated limit
    6 calculations
    64-bit
  • Project: stand-in ground, volumes and saved points

    Holds the project and the results derived from it: a flat stand-in ground for a road with no survey, cut and fill inside the daylight lines, and the points written to the project file.

    • CivilCraft
    64-bit, stated limit
    3 calculations
    64-bit
  • Protection curves and grading

    Relay and fuse operating times, grading margins between devices, and the cable damage time.

    Every app 64-bit, stated limit
    6 calculations
    64-bit Open item
  • Radio coverage over the terrain

    Works out the received power from a transmitter at every cell of a grid over the terrain and the share of cells that are covered.

    • CivilCraft
    32-bit step, flagged
    2 calculations
    32-bit in part Open item
  • Railway cant, cant ramps and track quantities

    Works out equilibrium cant, cant deficiency and excess, the cant ramps and their gradients and rates, each rail's height along the line, the track cross section, and the quantities of rail, sleepers, ballast and sub-ballast.

    • CivilCraft
    64-bit, stated limit
    13 calculations
    64-bit Open item
  • Railway turnouts, crossovers and clearance envelopes

    Works out the geometry of a turnout and a crossover from the frog number, the speed on the diverging route, the extra width a vehicle needs on a curve, and whether two clearance outlines overlap.

    • CivilCraft
    64-bit, direct
    7 calculations
    64-bit Open item
  • Rain on the ground: overland flow, ponding and outflow

    Runs rain over a grid of the graded ground and reports where water ponds, how deep it gets, what overtops, and the volumes that fall, soak in, drain and leave.

    • CivilCraft
    32-bit step, flagged
    14 calculations
    32-bit in part Open item
  • Rainfall run read-outs: deepest water and depth scale

    The deepest-water figure, the depth scale of the picture, and the unit factors in the rainfall run window.

    • CivilCraft
    32-bit step, flagged
    3 calculations
    32-bit in part Open item
  • Regulation limits in force and how values are written

    Gives an app's tools the tightest limit of a rule across the ticked regulation packs, and writes required and found values in problems and on the code summary sheet.

    • CadCraft
    • BimCraft
    • CivilCraft
    • DetailCraft
    64-bit, direct
    4 calculations in 2 files
    64-bit Open item
  • Rigid-body dynamics of a mechanism

    Joint torques for a given motion, the mass matrix, joint accelerations for given torques, energy, and a simulated motion over time.

    Every app 64-bit, stated limit
    6 calculations
    64-bit
  • River model: stations, cut sections and reach lengths

    Builds the river model a water surface profile is computed from: river stations, cross-sections cut from the ground, bank positions, reach lengths, flows along the reach and the unit constants.

    • CivilCraft
    64-bit, direct
    7 calculations in 2 files
    64-bit Open item
  • River water surface profiles by the standard step method

    Works out the water surface, energy level, critical depth, velocities, Froude number and flow split at each river cross section for steady flow.

    • CivilCraft
    64-bit, stated limit
    15 calculations in 2 files
    64-bit Open item
  • Road intersections, striping and signs

    Works out curb returns, the pavement outline and area of an intersection, sight distance, stripe and dash layouts, crosswalk bars, sign positions and the quantities of each.

    • CivilCraft
    64-bit, stated limit
    14 calculations
    64-bit Open item
  • Rotations, transforms and small linear algebra (motion)

    Rotation matrices, roll-pitch-yaw angles, rotation vectors, rigid transforms and the dense solve used by the robot and linkage calculations.

    Every app 64-bit, direct
    7 calculations
    64-bit Open item
  • Running saved geotechnical, survey, pit and link items

    Converts a saved item from project units to meters, runs the engine for it (soil profile, slope stability, settlement, traverse, pit, radio link, coverage) and converts the results back.

    • CivilCraft
    64-bit, stated limit
    9 calculations
    64-bit
  • Sanitary sewer design flows and pipe sizes

    Works out the peak sanitary flow in each pipe of a gravity network from people and area, checks capacity and velocity, and picks pipe sizes.

    • CivilCraft
    64-bit, stated limit
    6 calculations
    64-bit Open item
  • Scan clean-up and JPEG decoding

    Reads a scanned image, turns it into black and white, finds how far the sheet is rotated and turns it straight.

    • CadCraft
    • BimCraft
    • ModelCraft
    • CivilCraft
    • PartCraft
    64-bit, stated limit
    6 calculations in 2 files
    64-bit Open item
  • Schedule risk (Monte Carlo)

    The finish at P10, P50, P80 and P90, how often each task is critical, and which durations drive the finish.

    Every app 64-bit, stated limit
    3 calculations
    64-bit
  • Section cut from the ground along any line

    Cuts the ground surface along a polyline and gives the distance, offset and elevation at every triangle edge it crosses; also measures along, locates on and crosses polylines.

    • CivilCraft
    64-bit, direct
    8 calculations
    64-bit Open item
  • Shared feature lines: units and geometry

    Sends a feature line to the team and takes one back, converting between feet and meters when the two drawings differ.

    • CivilCraft
    64-bit, direct
    2 calculations
    64-bit
  • Site surroundings in local meters

    Converts the buildings, parcels and zones found around an address from longitude and latitude to meters east and north of the address point, as suggestions a person can add to the model.

    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit, stated limit
    4 calculations
    64-bit
  • Sketch photo to drawing: sheet, perspective and scale

    Finds the sheet of paper in a photo, straightens it, and places the traced lines and arcs in the drawing at a stated scale.

    • ModelCraft
    • CivilCraft
    64-bit, stated limit
    7 calculations in 2 files
    64-bit Open item
  • Slope stability

    Finds the factor of safety of a circular slip surface by Bishop's simplified method or the ordinary method of slices, and searches for the critical circle.

    • CivilCraft
    64-bit, stated limit
    6 calculations
    64-bit Open item
  • Solar array layout on roofs and ground

    Finds the roof planes that can carry modules, fits modules inside a plane with a setback, and lays out ground rows with a spacing that avoids shade at the winter solstice.

    • BimCraft
    • CivilCraft
    64-bit, stated limit
    8 calculations
    64-bit

A policy is added only after its source was read. Each statement can be checked in the code shown on its page; the app repositories are public. When a release changes a calculation, its page says so until it has been read again.

The standard

  • 64-bit everywhere

    Every calculation runs in 64-bit floating point (IEEE 754 double precision), from the number you type to the number you read.

  • 15 digits, always

    A 64-bit number keeps any 15-digit value intact and takes 17 digits to write out in full. Our rule for every calculation: carry all 17 between steps, and order the arithmetic so that avoidable rounding never costs one of the first 15.

  • 32-bit gets a warning

    A 32-bit number keeps about 7 digits. Where a 32-bit step can reach a number you read, the calculation is flagged in the lists below, and the app will warn that the result can have less mathematical precision.

This device

The apps calculate in 64-bit on every device. Work handed to the graphics processor is the exception: browsers expose graphics processors as 32-bit calculators, which can provide less mathematical precision.

A browser reports a rounded or capped view of the machine, never a full inventory: it gives the number of processor threads (not the model), memory rounded down and capped at 8 GB (Chromium only), and one graphics adapter even when a machine has several. What the browser reports about graphics is a capability, not a measurement of the card. The size of a graphics card's memory bus (a 192-bit bus, for example) says how fast data moves, not how precisely it calculates. Most graphics cards can calculate in 64-bit natively, slowly, but WebGL and WebGPU do not offer it to web pages.

Approaches

Every policy takes one of five approaches to keeping its precision.

Exact values 8 policies
Constants and factors are held as exact fractions from their definitions. The arithmetic is ordered so that no rounded factor is ever used.
Exact predicates 1 policy
Coordinates are 64-bit. The yes-or-no decisions that shape the geometry (which side of a line, inside or outside a circle) are computed exactly, so rounding cannot flip one.
64-bit, direct 337 policies
Every value is a 64-bit number from input to result. Formulas are closed form or a direct solve, and every comparison uses a stated tolerance.
64-bit, stated limit 428 policies
The arithmetic is 64-bit, but the method or the data sets the accuracy: a solver tolerance, a mesh, a step size, a datum shift, a table. The limit is stated where the result is shown.
Display only 49 policies
Computed to draw the screen, often in 32-bit on the graphics processor. No number a person reads, saves or exports comes from it.
32-bit step, flagged 118 policies
One step stores or exchanges 32-bit values that reach a number a person reads. It is listed here with its open item, and the step is either moved to 64-bit or the app will warn where the number is read.

Precision is not robustness

Mathematical precision is how many digits a number keeps. Geometric robustness is whether a shape stays valid: every intersection found, every solid closed, every face joined to its neighbors. They are different properties, and a CAD system can have the first without the second.

Every geometric algorithm rests on yes-or-no questions. Is this point left or right of that line? Do these two edges cross? Is this point inside that circle? Each answer is the sign of a small expression. When three points are almost in line, the true value of that expression can be smaller than the rounding error of the arithmetic that computes it, and the sign comes out wrong. That happens at 15 digits as readily as at 7.

One wrong sign is not a small error in the last digit. It is a different decision: an intersection that is missed, two triangles that overlap, a face that points the wrong way, a solid with a gap in it. Every coordinate can be correct to 15 digits while the shape they describe is invalid.

A point C almost on the line from A to B. Magnified, C is a tiny distance to one side of the line. A B C C left or right?
C lies a rounding error away from the line through A and B. Which side it is on decides how the geometry is built.

What makes geometry robust

  • Exact predicates

    The yes-or-no questions are answered exactly. The fast 64-bit answer is used when it is safely away from zero. When it is not, the sign is computed again with as many digits as it takes.

  • Decide once

    A decision about a shape is recorded as topology, and every later step agrees with it. The same question is never asked twice with a chance of two answers.

  • Stated tolerances

    Where a tolerance is used it is written down, scaled to the size of the geometry and applied the same way everywhere.

  • Local origins

    Coordinates far from zero are moved to a local origin before the work, so the digits are spent on the geometry and not on the distance to the origin.

  • Valid by construction

    Algorithms whose result is guaranteed to be a closed solid, whatever the input, in place of ones that repair the result afterwards.

  • More than the language

    These choices matter more than the programming language. JavaScript, C++ and Rust all compute with the same 64-bit numbers: the same algorithm is as robust, or as fragile, in each.

Where our apps stand

The list on this page records both properties. Surface triangulation in CivilCraft and BimCraft uses exact predicates. Solid modeling in PartCraft runs on a kernel whose result is a closed solid by construction. The intersections in the CadCraft app use stated tolerances today, and exact tests for the near-parallel and near-tangent cases are an open item. Each policy says which approach it takes.