Atelier des rouesLab FR
Objects/Documentation

separation31.py

Shared conditionals and checks · separation31.py

Download ↓
"""Candidate-specific Mahler and derivative bounds. Standard Python, integer arithmetic."""
from fractions import Fraction as F
from math import isqrt

def mahler_upper(coeff,rounds=3):
    if len(coeff)==2:return max(map(abs,coeff))
    # Constant-first Graeffe transform E(x)^2-x O(x)^2 squares every root.
    poly=list(reversed(coeff))
    for _ in range(rounds):
        new=[0]*len(poly)
        for parity in (0,1):
            group=poly[parity::2]
            for i,a in enumerate(group):
                for j,b in enumerate(group):new[i+j+parity]+=(1-2*parity)*a*b
        poly=new
    value=sum(x*x for x in poly)

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.