RiptideRiptide
Download Riptide SDKInstall Riptorch
Menu
Whitepapers · Raya · Exact geometry

The double helix, as geometry

A helix is the orbit of one screw motion, and a screw with rational rotation and rise has only rational points. We wrote the double helix that way, derived what can and cannot be exact, and computed the standard base-pair step parameters (twist, roll, tilt, rise, slide, shift) exactly from the coordinates of every DNA-only X-ray structure in the PDB at 3 Å or better that holds a duplex in its asymmetric unit, then measured what arbitrary precision, float64 and float32 do to the same numbers, to long helices and to helices rebuilt from their steps.

Version
1.2 (corrected 1 December 2026: definition of spread; limitations section retitled)
Date
30 November 2026
Author
Samario Torres, Riptide
Software
Python 3.12 (integers and fractions) with mpmath 1.3.0 (gmpy2 2.3.2 backend), SymPy 1.14.0, NumPy 2.5.5, SciPy 1.18.1, gemmi 0.7.5, Matplotlib 3.11.2; Riptide Motion (Raya 0.4.0), rendered using our graphics engine, Evelyn
Download PDFOpen in new tabriptidecompute.com/whitepapers/double-helix-geometry

Abstract

N. J. Wildberger's rational trigonometry measures separation by quadrance (squared distance) and direction by spread between lines with directions , both computed from coordinates with . A helix is the orbit of a screw motion: a rotation about an axis followed by a rise along it. When the rotation is rational, every point of the helix is rational, and its radius, rise and twist enter only as two quadrances and one spread, . No rational rotation other than a quarter or half turn closes, though: by Niven's theorem a rotation with rational cosine and sine has finite order only for quarter and half turns, so B-DNA's ideal 36° twist, whose spread lies in , can only be approached. The best rational twist with denominator at most 1,000 is off by 0.00015°, and its helix leaves the 36° one by 0.023 Å after 1,000 steps. Real structures are exact on their own terms, because PDB files store decimals. From 1,385 DNA-only X-ray entries (≤ 3 Å) we found 7,402 Watson–Crick duplex steps in 850 entries and computed twist, roll, tilt, rise, slide and shift exactly as spreads and quadrances in a rational base-pair frame built from six named atoms with no fitting. A, B and Z separate by exact tests: handedness is the sign of one product of integers, and a phosphate height splits A from B. Medians: B twist 35.38°, A 30.81°, Z −10.16° (CG) and −48.49° (GC). Step type explains 29 to 51% of the rank variance of twist, roll, rise and slide in B-DNA (entry-level Kruskal–Wallis, ), twist and roll anticorrelate (, 95% CI −0.51 to −0.43) and neighbouring twists alternate (). On the measured steps float64 errs by at most ° in twist; float32 by °, and by 0.011° when the same structures sit 10,000 Å from the origin, where 22 sign decisions and one A/B call change. Rebuilding a 100,000-step helix from measured steps drifts 3.0 Å in float32, Å in float64 and Å at 256 bits. Exactness costs bits: the exact rebuild reaches 2.3 million-bit coordinates after 20,000 steps.

The problem

The double helix is usually described in angles: 36° of twist per base pair, 10.5 base pairs per turn, a roll of a few degrees at a CA step. Each angle is a transcendental function of atomic coordinates, and the code that computes it rounds at every step. The questions underneath are often simpler. Is this step left- or right-handed? Which side of the base pair is this phosphate on? Do these two steps have the same geometry? Each is a polynomial condition on the coordinates.

This paper asks three things. First, what does a helix look like in quadrances and spreads, and which of its standard quantities can be exactly rational? Second, what does the step geometry of real DNA look like when it is computed exactly, as spreads and quadrances, from public crystal structures? Third, what do arbitrary-precision arithmetic, float64 and float32 do to the same quantities, on single steps, on long ideal helices and on helices rebuilt from their steps? The scope is the geometry of published structures: no sequence analysis beyond the step type, and nothing biological is inferred.

Assumptions

Every result below rests on these choices; each is a definition, not a measurement.

  1. Coordinates are exact as written. A PDB coordinate such as 12.804 is the rational 12804/1000. We parse the decimal strings into integers on the Å grid and never convert to floating point for the exact results. "Exact" means exact for the file, not for the molecule: X-ray coordinates carry errors of roughly 0.01–0.1 Å.
  2. Data. Model 1, first alternate location, standard deoxynucleotides (DA, DC, DG, DT) in ATOM records, chains of entity type polydeoxyribonucleotide. Only base pairs inside one asymmetric unit: duplexes that need a crystal symmetry operation to complete are not built (the operation needs the unit-cell angles, which are not rational in general).
  3. Base pairs. Watson–Crick A·T and G·C only, by exact quadrance and sign tests (purine N1 to pyrimidine N3 within 3.3 Å, C1′–C1′ between 9.5 and 11.5 Å, base normals antiparallel and within spread 1/2 of each other); each base in at most one pair.
  4. A rational frame of our own. Standard tools (3DNA, after Olson et al. 2001) fit ideal bases by least squares, which needs square roots. We use a frame built from six named atoms (N1, N3, C5, C1′ of each base, purine C8, pyrimidine C6) with no fitting (below). It is close to the standard one but not identical, so our slide and shift in particular are not directly comparable with tabulated 3DNA values.
  5. Step parameters by projection. Twist is the spread between the two long axes projected off the mid-step axis; roll and tilt are spreads between the two base-pair normals projected off the other two mid-step axes; rise, slide and shift are the quadrances of the components of the origin displacement. 3DNA uses a hinge decomposition instead; the two agree closely for small roll and tilt but are not the same numbers.
  6. Forms. A step is Z when it is a left-handed screw (exact sign test). Otherwise it is A when its phosphate height along the mid-step axis is at least 1.3 Å and B below; 1.3 Å lies in the flat minimum of our measured histogram between the two populations, a cut chosen from the data (after Lu, Shakked and Olson 2000, who separate A and B steps by ).
  7. Models are models. Ideal helices (one screw per strand), the fitted phosphate helices and the rebuild convention are models, labelled as such wherever they appear.
  8. Statistics are descriptive, computed in float64 from the exact values. Steps from one crystal are not independent, and some sequences recur (the Dickerson–Drew dodecamer CGCGAATTCGCG is 91 of 1,718 ladders), so every confidence interval resamples whole entries, and every group test is also run on one value per entry.

The geometry of a helix, rationally

Rational points and rational rotations

The line through with slope meets the unit circle again at

so every rational gives a rational point and every rational point other than comes from exactly one rational . With , is the direction at angle , and the rotation by that angle is the Cayley rotation

Its spread is . For the entries are a Pythagorean triple over : gives , the 3-4-5 rotation by 36.87°, and gives . Composition multiplies the Gaussian integers , so steps of are , exact for every .

Unit circle with the rational points for small denominators, lines from A to P(1/3), P(1/2) and P(−2/3)
Figure 1. Rational points of the circle. Grey: every with . The 3-4-5 point is a rotation by 36.87°; the 36° rotation itself needs , which is irrational.

A screw motion and the quadrance law

A screw motion is a rotation about an axis followed by a translation along it, . A helix is the orbit of one point. If , and are rational, so is every . Writing for the radius quadrance and for the spread of half the twist, the chord quadrance between points steps apart is

where is Wildberger's spread polynomial (, , , ), because the spread of half-twists laid side by side is of the spread of one. Radius, rise and twist enter as two quadrances (, ) and one spread (); the pitch of a helix with steps per turn is the quadrance . As a cross-check against the classical angle form, we evaluated against -fold angles for at three values with 60-digit arithmetic (largest residual , rounding in the large coefficients).

A helix of eleven points p0 to p10 around a vertical axis, with the chord Q1, the radius R and the formulas
Figure 2. A helix is the orbit of one screw. Drawn: (36.00015°, the best Cayley parameter for 36° with denominator at most 1,000), Å, Å, from the B-form phosphate fit below.

Irrational twists, and rational twists that never close

B-DNA's textbook twist of 36° (10 base pairs per turn) corresponds to the spread , a root of . It lives in , like the regular pentagon in the chemistry paper: , so the 36° step returns its line after five steps and its point after ten. Its Cayley parameter is a root of . A twist of has a spread of degree 6 over , of degree 5. At 12 steps per turn the spread is rational, , but the rotation is not: its cross is rational, and the rotation matrix needs its square root, .

The obstruction is general. A rotation with rational cosine and sine has finite order only for quarter and half turns: in Gaussian-integer form, a finite-order rotation is a root of unity in , which is or (Niven 1956). A search over every with (the rest follow, since ) and up to 60 steps found only (order 1) and (order 4). So a rational helix never has a whole number of steps per turn, except 4 or 2: its twist can only approach 36°, 34.29° or 32.73°.

Ten 3-4-5 rotations around a circle overshooting the start by 8.70 degrees, with the exact decagon in grey
Figure 3. Ten steps of the 3-4-5 rotation land 8.70° past the start. The exact 36° decagon (grey) closes, but its spread is irrational.
Table 1. Best rational twists for a 36° target: Cayley parameter with at most the bound (continued-fraction best approximation), the rotation it gives, and how far a helix of radius 9 Å drifts from the 36° helix.
angleerrorerror per turnsteps to 1°drift after 1,000 steps
101/31036.869898°+0.87°+8.7°217.4 Å
10013/401,76936.008323°+0.0083°+0.083°1211.31 Å
1,000103/317111,09836.000149°+1.5e-4°+1.5e-3°6,7030.023 Å
10⁴708/21795,249,30535.999999°−8.6e-7°−8.6e-6°1,162,0301.4e-4 Å
10⁶161643/497486273,620,779,64536.000000°−2.6e-11°−2.6e-10°3.9e104.0e-9 Å
10⁹168193487/5176463262.96e1736.000000°−7.4e-18°−7.4e-17°1.4e171.2e-15 Å

The error falls like , as continued fractions predict ( stays between 0.03 and 0.26, in radians, for these rows), for every target we tried: 36°, 34.2857° (10.5 per turn), 32.7273° (11), 30° (12) and our measured medians 35.38° (B) and 30.81° (A).

Log-log plot of angle error against the denominator q for six twist targets with a 1/q² guide
Figure 4. Best rational twists for six targets. The error never reaches zero (Niven), but a 9-digit denominator gets within degrees.
Distance from the exact 36-degree helix against step number for five rational twists
Figure 5. Model error of a rational helix: a twist that is off by puts step at chord distance $2R\,

The helix from three quadrances

Read backwards, the quadrance law determines an ideal helix from three chord quadrances of four consecutive points, with alone:

SymPy confirms the three inversions symbolically. Example: , , give , and the formulas return , , exactly. Quadrances cannot see handedness (a mirror image has the same quadrances); the sign of does.

Four helix points P0 to P3 with chords Q1, Q2, Q3 and the inversion formulas
Figure 6. An ideal helix from three quadrances. Exact on an exact helix; on measured phosphates it is badly conditioned (Fig. 33).

The inversion is exact but ill-conditioned. At the B-form phosphate helix of our data ( Ų, twist 37.2°, Ų), the recovered twist moves by 47° per Ų of error in , 20° in and 3.5° in (linearised). Applied to four real phosphates at a time it returns twists near 87° instead of 37°; the measured helices below are therefore fitted over six offsets.

Two strands, one screw, and the grooves

The half-turn about the -axis, , is a rational map, and . So maps the orbit of to another orbit of the same screw: the second strand of an ideal duplex is a screw-related point set, the image of the first under a dyad perpendicular to the axis. Strand II is strand I turned about the axis and raised by , and the cross-strand phosphate quadrances are

where is the spread of half the turn that takes to about the axis.

The two grooves are the two dips of this function of : the smallest phosphate–phosphate quadrances across each side.

Two interwound helices of phosphates with the dyad axis and chords across the minor and major grooves
Figure 7. Two strands as orbits of one screw, related by a half-turn. Drawn from the B-form fit ( Å, twist 37.24°, rise 3.41 Å, , Å); the chords are the median minor (121.8 Ų, ) and major (298.1 Ų, ) groove quadrances.

Measured step geometry

Data

We searched RCSB for every entry whose polymers are DNA only, determined by X-ray diffraction at 3 Å or better (30 November 2026): 1,385 entries, all parsed, 32,180 nucleotides (PDB: Berman et al. 2000). 850 entries contain at least one Watson–Crick duplex step inside the asymmetric unit, in 1,718 ladders (maximal runs of stacked pairs) with 9,120 base pairs and 7,402 steps, of which 4,284 are interior (neither pair at the end of its ladder). 57 entries write coordinates with five decimal places (542 steps), the rest three; the Å grid holds both exactly. The other 535 entries hold no Watson–Crick duplex step inside their asymmetric unit (Assumption 2); we did not classify them further. Every download is recorded with its sha256.

Table 2. The data, by form (interior steps). Form by the exact tests of Assumption 6.
forminterior stepsentriesall steps
B3,3395405,592
A6381471,242
Z30785568
Three bar charts: entries by resolution, interior steps by form, coordinates by decimal places
Figure 8. The data: entries with duplex steps by resolution, interior steps by form, and coordinates by decimal places as written.

A base-pair frame from six named atoms

Each base gets a normal from three atoms of its six-membered ring, , negated for purines because the ring is numbered the other way round when the sugar sits on N9. The pair's normal is , its long axis , and with . The origin is the midpoint of purine C8 and pyrimidine C6: the two atoms sit at the same place in their bases, next to the glycosidic nitrogen, so the Watson–Crick pseudo-dyad nearly swaps them and their midpoint barely depends on which strand carries the purine. (Our first choice, the centroid of both six-rings, slid about 1 Å toward the pyrimidine and gave every RY step a spurious positive slide; we replaced it.) Over all 9,120 pairs the origin's mean offset along from the C1′ midpoint is −0.081 Å with the purine on strand I and +0.077 Å with it on strand II: a residual 0.08 Å toward the pyrimidine. Every vector is a difference, sum or cross product of integer coordinates, so the frame is exact. Two exact checks hold on the whole set: points to the side of the C5 atoms (the major groove) for all 9,120 pairs, and the strand I normal points 5′→3′ along its strand at 6,834 of 7,402 steps; the other 568 equal the number of Z steps, whose bases are flipped.

A real base pair from 1BNA with the N1, N3, C5 triangle, the C1' atoms, C8 and C6 and the x, y, z axes
Figure 9. The rational base-pair frame on a real pair (PDB 1BNA, Drew et al. 1981). No least-squares fit: N1, N3, C5 and C1′ of each base, purine C8 and pyrimidine C6, and integer arithmetic.

Step parameters as spreads and quadrances

For consecutive pairs 1 and 2, the mid-step axis is . Each long axis is projected off it without division, ; then and are exactly perpendicular to and to each other. The twist spread is

with the direction given by the sign of the determinant; roll and tilt are the spreads between and projected off and ; bend is the spread between and . With , rise, slide and shift are the signed quadrances , and . Because the three axes are perpendicular, the three quadrances add up to , and they do exactly on all 7,402 steps. Translating every structure by Å changes no exact piece of any step. A step is a screw, and its handedness is , which does not depend on which way points. We report every step in the orientation where its rise is positive, so the sign of the twist is the handedness (the flip changes the signs of twist, tilt, rise, shift and and leaves roll and slide). Tilt and shift also change sign when a step is read from the other strand, so step types are reported in one canonical orientation (AA for AA/TT and so on).

Two stacked base pairs from 1BNA with the mid-step axis, the projected long axes and the twist arc
Figure 10. Step parameters on a real AA step of 1BNA: twist spread 0.3683 (37.36°), roll spread 6.98 × 10⁻⁴, rise 3.254 Å, slide −0.400 Å.

Every value is an exact rational. With three-place coordinates (6,860 steps) the reduced twist spreads have numerators and denominators of 134 to 151 bits (5th to 95th percentile; median 146), roll spreads 311 to 344 bits (median 333); the 542 five-place steps need more.

Histograms of the bit lengths of exact bend, twist, tilt and roll spreads
Figure 11. Bits of the exact step spreads (the larger of reduced numerator and denominator).

A, B and Z

Table 3. Medians [quartiles] of interior steps by form. Angles and lengths are read from the exact spreads and quadrances (correctly rounded); the spread and quadrance columns are the exact quantities.
B (3,339)A (638)Z (307)
twist35.38° [32.12, 38.12]30.81° [28.44, 32.47]−46.77° [−49.26, −11.33]
twist spread0.33530.26230.5309
roll1.11° [−1.87, 4.11]7.99° [4.27, 11.56]−3.12° [−5.14, −1.20]
tilt−0.37° [−2.33, 1.45]−0.32° [−2.02, 1.14]−0.07° [−1.24, 1.24]
rise3.27 Å [3.14, 3.47]3.24 Å [3.05, 3.39]3.57 Å [3.42, 3.69]
rise quadrance10.69 Ų10.48 Ų12.75 Ų
slide−0.00 Å [−0.41, 0.61]−1.75 Å [−2.07, −1.39]−0.64 Å [−0.88, 5.20]
shift0.04 Å [−0.21, 0.28]−0.04 Å [−0.39, 0.39]−0.04 Å [−0.19, 0.10]
−0.24 Å2.33 Å−0.54 Å

B and A differ most in roll (A rolls 8° per step, B 1°), slide (A −1.75 Å, B 0) and , the property that defines the split (the 1.3 Å cut sits in a flat valley: 26 to 33 steps per 0.1 Å bin from 1.1 to 1.8 Å); their rises along the mid-step axis are nearly the same, because A's base pairs are inclined to the helix axis. Z-DNA is left-handed and repeats every two base pairs: CG steps twist −10.16° with slide +5.29 Å, GC steps −48.49° with slide −0.84 Å (medians, 99 and 181 interior steps), so a dinucleotide turns by −58.7° and rises 7.0 Å (compare Wang et al. 1979).

Histogram of the phosphate height Zp with two populations and the cut at 1.3 Å
Figure 12. A or B by an exact test on the phosphate height . The cut, 1.3 Å, is the histogram minimum.
Six violin plots of twist, roll, tilt, rise, slide and shift for B, A and Z
Figure 13. A-, B- and Z-form step parameters (interior steps, frame oriented so the rise is positive).
Histogram of the signed twist spread with B and A at positive values and Z at two negative peaks
Figure 14. Twist without angles. Every measured twist is below 90° in size, so the signed spread is a monotone stand-in for the angle: B near the 36° spread , A near 30° (spread 1/4), Z at −10° and −50°.
Six density panels for twist, roll and tilt spreads and rise, slide and shift quadrances by form
Figure 15. The exact quantities themselves: spreads and quadrances by form.
Histograms of twist and slide for Z-DNA CG and GC steps
Figure 16. Z-DNA's dinucleotide repeat: two kinds of step, alternating.
Three phosphate double helices side by side: B, A and a left-handed Z
Figure 17. A, B and Z as screws, drawn from the measured data: the B and A phosphate helices fitted below; Z from its CG + GC step medians, with its radius from a one-helix fit, which is poor for a dinucleotide repeat.

Grooves as quadrances

For every ladder we computed the exact quadrance between each strand I phosphate and each strand II phosphate up to eight base pairs away, and decided exactly which groove each chord crosses (the sign of its midpoint's offset along the pair's axis). The groove quadrance at a phosphate is the smallest local minimum of these quadrances on one side.

Table 4. Groove quadrances (medians of the smallest cross-strand P–P quadrance, per phosphate), and the phosphate helix fitted to the same-strand medians , , with (a model).
formminor groovemajor groovefitted radiusfitted twistfitted riserms residual
B (1,247 ladders)121.8 Ų (11.0 Å; 2,045)298.1 Ų (17.3 Å; 1,817)9.00 Å37.24°3.41 Å0.89 Ų
A (327 ladders)243.6 Ų (15.6 Å; 459)129.4 Ų (11.4 Å; 152)10.78 Å30.35°1.98 Å0.57 Ų
Z (144 ladders)141.1 Ų (11.9 Å; 196)244.1 Ų (9 values)6.74 Å36.83°3.20 Å5.45 Ų

B has the narrow minor and wide major groove; A the reverse, with a narrow major groove that short A-form ladders rarely span (152 values). The single-helix model fits B and A to within 1 Ų over six offsets; for Z it does not (5.45 Ų), as expected for a structure that repeats every two pairs, and its "twist" there is a quadrance fit that cannot see handedness. The A fit's rise per phosphate, 1.98 Å, is a property of the fitted phosphate helix of these mostly short A-form crystals, not the step rise. The ideal cross-strand model fits the B profile closely and the A profile poorly (rms 37 and 99 Ų).

Median cross-strand phosphate quadrance against offset for B, A and Z with the model curve
Figure 18. Cross-strand phosphate quadrances against the base-pair offset: two dips, one per groove (blue: chords on the major-groove side, orange: minor; exact sign test).
Distributions of minor and major groove quadrances by form with a distance axis on top
Figure 19. Groove widths as quadrances by form.
Median same-strand phosphate quadrances against m with fitted curves
Figure 20. One strand as a screw orbit: the quadrance law fitted to the median phosphate quadrances.

Step type, correlations and neighbours

Within B-DNA the step type matters for every parameter. We ran Kruskal–Wallis across the ten unique step types twice: on all steps, and on one median per entry and step type, so that a crystal with many copies of a step counts once. Effect sizes are (the share of rank variance explained).

Table 5. Step-type dependence in B-DNA (interior steps). Entry-level tests: 1,682 entry–step-type medians; pairwise Mann–Whitney between step types at the entry level, Holm-adjusted over 45 pairs.
parameter (steps) (entries)entry-level pairs differing at 0.05
twist0.260.294.4e-9930 / 45
roll0.320.337.7e-11531 / 45
tilt0.060.124.7e-4128 / 45
rise0.310.336.0e-11535 / 45
slide0.480.511.6e-18037 / 45
shift0.090.162.3e-5530 / 45
Table 6. B-DNA medians by step type with 95% confidence intervals (entries resampled, 1,000 bootstrap draws).
stepsteps (entries)twistrollsliderise
AA/TT621 (221)36.03° [35.79, 36.38]0.44° [−0.05, 0.97]−0.34 Å [−0.37, −0.32]3.15 Å [3.13, 3.17]
AC/GT237 (122)31.87° [31.16, 32.49]1.20° [0.51, 1.60]−0.38 Å [−0.53, −0.26]3.33 Å [3.27, 3.39]
AG/CT164 (95)33.12° [32.14, 34.67]3.67° [2.96, 4.56]−0.21 Å [−0.34, −0.01]3.36 Å [3.28, 3.44]
AT367 (274)32.57° [32.31, 32.75]−0.58° [−1.08, −0.15]−0.54 Å [−0.57, −0.53]3.18 Å [3.17, 3.20]
CA/TG203 (108)35.94° [34.18, 37.71]3.06° [1.80, 3.77]0.83 Å [0.63, 0.90]3.47 Å [3.41, 3.54]
CC/GG144 (66)33.53° [32.14, 35.31]5.47° [3.97, 6.81]0.47 Å [0.33, 0.61]3.43 Å [3.38, 3.50]
CG446 (232)32.07° [31.17, 32.92]5.00° [4.31, 5.54]0.71 Å [0.67, 0.74]3.67 Å [3.62, 3.70]
GA/TC527 (227)36.78° [36.53, 37.15]1.58° [1.20, 2.00]−0.04 Å [−0.07, 0.02]3.20 Å [3.18, 3.22]
GC450 (238)38.47° [37.99, 39.00]−5.94° [−6.96, −4.96]0.62 Å [0.58, 0.64]3.29 Å [3.27, 3.31]
TA180 (99)38.55° [37.44, 39.84]1.56° [0.45, 2.93]0.17 Å [−0.11, 0.37]3.22 Å [3.17, 3.27]

CG and TA, two pyrimidine–purine steps, differ clearly in twist (32.07° against 38.55°, Holm-adjusted , rank-biserial −0.51), roll () and rise (), and not in tilt or shift. GC and CG, the same two bases in the other order, sit at opposite ends of the roll scale (−5.94° and +5.00°). Grouped, YR steps (CA, CG, TA) have the largest median roll (3.76°), RY steps (AC, AT, GC) the smallest (−1.54°).

The parameters are coupled. Twist and roll anticorrelate (Spearman , 95% CI −0.51 to −0.43; Pearson ), twist and rise too (), while rise and slide go together (). Between neighbouring steps the strongest pattern is in twist: a step's twist and the next step's twist anticorrelate (, CI −0.54 to −0.45, 2,496 neighbouring pairs), so twists alternate high and low along a duplex; slide is positively correlated with the next slide (). The preceding step changes a CG step's twist: after GC or GA it is 30.2° and 30.5°, after AC or CC 37.8° and 36.7° (entry-level Kruskal–Wallis ). These are geometric dependences in the measured structures; we draw no conclusion about mechanism.

Three panels of medians with confidence intervals and quartile bands for twist, roll and slide by step type
Figure 21. B-DNA twist, roll and slide by step type: median, 95% CI (entries resampled) and interquartile range.
Scatter of roll against twist for B-DNA steps coloured YR, RR and RY
Figure 22. Twist against roll, B-DNA.
Six by six heatmap of Spearman correlations with confidence intervals
Figure 23. Spearman correlations between step parameters (B-DNA), with 95% CIs; bold where the interval excludes 0.
Six by six heatmap of correlations between parameters of step k and step k+1
Figure 24. Neighbouring steps: each parameter of step against each of step .

Numerical analysis: four modes

We compared four modes on every quantity: exact rational (Python integers and fractions), arbitrary precision (mpmath at 64, 113 and 256 bits), IEEE float64 and IEEE float32. Each float mode starts from the same coordinates rounded once into it (correctly rounded from the decimal), as a program holds a structure. Two routes: the rational route evaluates the same spread and quadrance formulas in the mode's arithmetic; the classic route normalises vectors and takes angles with atan2, as typical code does. The reference for angles and lengths is the exact pieces evaluated at 400 bits.

Measured steps

Table 7. Errors against the exact values over all 7,402 steps, classic route (median / maximum). The exact mode has no error by construction; translating the structures by 10,000 Å along each axis leaves its pieces unchanged.
modetwist, at the origintwist, at 10,000 Åtilt, at 10,000 Årise, at the origin
mpmath 256-bit5.3e-76° / 1.3e-74°3.0e-73° / 1.6e-72°9.7e-73° / 5.6e-72°7.3e-77 Å / 2.7e-75 Å
mpmath 113-bit6.0e-33° / 2.1e-31°3.4e-30° / 1.9e-29°1.1e-29° / 5.5e-29°8.2e-34 Å / 3.6e-32 Å
mpmath 64-bit3.1e-18° / 9.2e-17°1.9e-15° / 1.1e-14°6.0e-15° / 3.1e-14°4.6e-19 Å / 1.9e-17 Å
float646.4e-15° / 2.3e-13°3.9e-12° / 2.2e-11°1.2e-11° / 6.6e-11°9.4e-16 Å / 2.8e-14 Å
float323.8e-6° / 1.0e-4°2.1e-3° / 0.011°6.7e-3° / 0.039°5.2e-7 Å / 2.0e-5 Å

Every float error is far below the uncertainty of the coordinates themselves. What changes is decisions. At the origin no float mode changes any sign. In float32, with the structures moved 1,000 Å away, one roll sign and one A/B call change; at 10,000 Å, 12 tilt signs, 4 shift signs, 3 signs, 2 roll signs, 1 slide sign and 1 A/B call change, and no handedness. float64 and every mpmath precision change nothing at any offset. The rational route is no cure in floats: for small tilts its float32 error, read as an angle, is no smaller than the classic route's.

Box plots of twist and rise errors by precision mode on a log scale
Figure 25. Four modes on the measured steps (exact: 0).
Median and maximum twist and tilt errors against the translation of the structures
Figure 26. Floats depend on where the molecule sits; exact values do not.
Grouped bars of sign changes in float32 at four translations
Figure 27. Decisions that change in float32 against the exact signs.
Scatter of angle error against tilt for the rational formula and the classic route in float32 and float64
Figure 28. Small tilts: in floats, the rational formula followed by an angle is no more accurate than unit vectors and atan2.

Long helices: an iterated rational screw

An ideal helix built by applying the rational screw , Å, Å over and over separates rounding from model error, because its exact -th point is known in closed form, . We iterated it times in each mode and compared with the exact point at checkpoints.

Table 8. Iterated screw, error against the exact rational point (rotational part, Å), and the cost of the exact point.
stepsfloat32float64mpmath 64mpmath 113mpmath 256exact denominator
1,0002.8e-42.7e-132.6e-163.5e-311.1e-7416,762 bits
100,0000.0282.3e-112.5e-143.4e-291.0e-721,676,148 bits
10,000,0002.432.4e-92.5e-123.5e-279.9e-71167,614,734 bits

The rotational error grows about tenfold per tenfold of steps in every mode. The axial part (the running sum of rises) is worse in float32: after steps the height is Å, where float32 spacing is 4 Å, and the accumulated error reaches Å. Computing each point directly as in float32 is no better in the plane (1.73 Å at ). For comparison, the model error of the rational twist itself, against the true 36° helix, is 0.023 Å after 1,000 steps and 2.3 Å after 100,000.

Two log-log panels of rotational and axial error against steps for five precisions
Figure 29. An iterated rational screw in five precisions. Gaps are points where the float result equals the exact one.
Bits of exact coordinates against steps for the ideal screw and the rebuilt helix
Figure 30. The price of exactness: bits grow linearly with the number of steps.

Rebuilding a helix from its steps

Finally we rebuilt a 100,000-step helix from the measured parameters of the 3,339 interior B-form steps, repeated in data order, with a stated convention (rotation , then the displacement (shift, slide, rise) in the frame of the current pair; not 3DNA's convention, so this is not the crystal structure, only a long realistic chain of steps). The classic route takes cosines and sines in each mode, against the same at 1,024 bits. The rational route rounds every rotation factor once to a Cayley rotation with a multiple of and then composes exactly in integers; the float modes compose the same rational matrices.

Table 9. Drift of the last base-pair origin after rebuilt steps (Å).
float32float64mpmath 64mpmath 113mpmath 256rational vs classicrational vs classic
1,0000.00534.9e-122.5e-159.3e-306.1e-730.0463.1e-5
20,0000.535.6e-102.5e-133.3e-286.0e-711.978.0e-4
100,0003.07.7e-95.8e-122.6e-271.9e-709.783.5e-3

The exact integer composition (rotations at ) was run to 20,000 steps and agrees with the 1,024-bit composition of the same matrices to Å; its coordinates have 2,280,992 bits at 20,000 steps and took 19 s against about 1 s for each float64 or float32 run of 100,000 steps. Rounding the rotations to is itself a larger error than float32 rounding over a long chain (9.8 Å against 3.0 Å at 100,000 steps); at it is 0.0035 Å.

Two log-log panels of rebuild drift against steps by precision, classic and rational routes
Figure 31. Accumulated rounding when a helix is rebuilt from 3,339 measured B-form steps (100,000 steps; end-to-end 113,850 Å).
Model error of rational rebuilds at three denominators against float32 and float64 rounding
Figure 32. A rational rebuild trades rounding error for model error, chosen once by the denominator.
Histogram of twists from three-quadrance windows and a bar chart of sensitivities
Figure 33. Exact but ill-conditioned: four real phosphates at a time give twists near 87°; the sensitivity bars show why.

Limitations and next steps

The limits of these results, each with its cause and, where one is planned, the next step.

  • Exact numbers grow. An exact rational helix is exact at every step, but its coordinates grow linearly in bits: 167.6 million bits after ideal steps, 2.3 million after 20,000 rebuilt steps, 19 s against about 1 s for 100,000 float steps. Cause: each rational rotation multiplies the denominator (measured here).
  • Rational formulas in floats are not more accurate. Evaluated in float32, the spread formulas are no better than unit vectors and atan2 for small angles; the gain is in exact decisions, not in float digits. Cause: both routes round the same coordinates; the rational route then divides small differences.
  • Exact can be ill-conditioned. The three-quadrance inversion of a helix is exact and useless on real phosphates (47° of twist per Ų in ). Cause: the inversion divides by a small difference of quadrances (measured here).
  • Rational rotations are a model. No rational twist equals 36°, and rounding each step's rotation to moved a 100,000-step rebuild by 9.8 Å, more than float32 rounding did. Cause: the rounding is a systematic model error, chosen by the denominator.
  • float64 is enough for every value here. Its worst twist error on a real step is °, and no float64 decision changed. Exactness buys certainty and reproducible digits, not better structures.

Limits: what is exact and what is a model

Exact: every quadrance, dot product, determinant, spread and sign computed from the coordinates as written, the pairing and form tests, the frame, the identities checked on every step, the closed forms of the ideal screw and the integer rebuild. Exact facts of the mathematics: the rational parametrisation, the quadrance law, the three-quadrance inversion, the algebraic degrees of the twist spreads and the finite-order statement.

Models: the ideal helices, the fitted phosphate helices (one screw per strand, least squares over six offsets), the groove model curves, the rebuild convention, and the A/B cut at 1.3 Å. Our frame and step definitions are rational analogues of the standard ones, not the 3DNA numbers. Duplexes completed by crystal symmetry are missing, which removes many short self-complementary structures, and the remaining set is redundant in sequence (370 distinct ladder sequences in 1,718 ladders). X-ray coordinates carry experimental error far larger than any float64 rounding measured here; exact means exact for the file.

Reproduction notes

Everything ran on one EC2 c7i.8xlarge (Intel Xeon, 32 vCPU) in us-west-2, driven over SSM; nothing ran on a laptop. The pipeline is plain Python: the decimal parser from the chemistry campaign, Python integers and fractions for the exact path, mpmath for the arbitrary-precision modes and references, NumPy for the IEEE modes, SciPy for statistics, SymPy for the identities. The data are public (RCSB PDB); the query, every entry id and sha256 are in the manifest. Bootstrap seed 20261130, 1,000 resamples of whole entries. Package versions as printed on the box are in the campaign's versions.txt.

Date and version

Version 1.2, 30 November 2026. Updated 1 December 2026: limitations section retitled.

References

  • N. J. Wildberger, Divine Proportions: Rational Trigonometry to Universal Geometry, Wild Egg, 2005.
  • I. Niven, Irrational Numbers, Carus Mathematical Monographs 11, 1956.
  • H. M. Berman et al., The Protein Data Bank, Nucleic Acids Research 28, 235–242 (2000).
  • W. K. Olson et al., A standard reference frame for the description of nucleic acid base-pair geometry, Journal of Molecular Biology 313, 229–237 (2001).
  • X.-J. Lu and W. K. Olson, 3DNA: a software package for the analysis, rebuilding and visualization of three-dimensional nucleic acid structures, Nucleic Acids Research 31, 5108–5121 (2003).
  • X.-J. Lu, Z. Shakked and W. K. Olson, A-form conformational motifs in ligand-bound DNA structures, Journal of Molecular Biology 300, 819–840 (2000).
  • H. R. Drew et al., Structure of a B-DNA dodecamer: conformation and dynamics, PNAS 78, 2179–2183 (1981).
  • A. H.-J. Wang et al., Molecular structure of a left-handed double helical DNA fragment at atomic resolution, Nature 282, 680–686 (1979).

Working with Riptide

Riptide works with a small number of teams. Each engagement starts with 4 weeks inside your systems, learning how your models, data and infrastructure work. Only then does Riptide apply its software to them. Contact samario@riptidecompute.com or riptidecompute.com/evaluate.