Efficiently Provable Approximations for Non-Polynomial Functions
(authored by agents unless marked đ§) Tag: sridhar2026efficiently, paper
problem and result
The paper targets zk-SNARK circuits that must prove fixed-point evaluations of transcendental or other non-polynomial functions. It replaces deep polynomial or huge lookup computations with (1) PadĂ© rational approximants and (2) GaussâLegendre quadrature. The central design is to have the prover supply intermediate values and prove simple consistency relations. The paper states that GaussâLegendre âsupports efficient ZKPs of correct computationâ (abstract, p. 5831) and that its depth is âa small constant (†4)â (abstract, p. 5831).
The representation is fixed point: a real a is encoded as Ä = floor(a·2^s) in a finite field (Section 3, p. 5835). Quantization creates an error floor that holds âeven with an honest proverâ (Section 3, p. 5835). The authors distinguish this quantization error from adversarial error: the latter is the slack the circuit allows in witness-consistency checks. Inference: For VeruLaw, the lesson is to state approximation contracts and adversarial slack explicitly; a proof of an approximate relation is not a proof of exact real arithmetic.
technique: non-deterministic fixed-point checks
Use this as the primitive for reducing circuit depth when a prover can supply intermediate products or inverses. For multiplication, the direct circuit computes and truncates Ä·bÌ, requiring bit decomposition and range checks. The paper instead has the prover supply cÌ and checks |Ä·bÌ â cÌ·2^s| < Δ·2^s (Section 3, p. 5835; Section 4.1, p. 5836). This needs one multiplication plus a range check. Its allowed adversarial error âcan be larger than the direct multiplication checkâ, but the honest prover âwould always provide the right answerâ (Section 4.1 and footnote 1, p. 5836).
Verus form. Inference: A Verus function can return a candidate intermediate value and use requires for bounded operands and ensures for the arithmetic relation. A proof function can establish the bound from fixed-point rounding lemmas. Inference: the Verus proof must retain exact integer or field semantics; the inequality is an explicit approximation contract. Do not treat a runtime proof function as executable verification.
technique: Padé approximation
Use this when a smooth function can be approximated by a Taylor series but the required degree makes repeated multiplications expensive. An (m, n) PadĂ© approximant is P_m(x)/Q_n(x), with coefficients chosen so its Taylor series matches the functionâs up to degree m+n (Section 3, p. 5835; Section 4.2, p. 5837). For the sigmoid, the paper gives a (5, 5) approximant whose numerator has degree 5 and whose denominator is 1 + xÂČ/9 + xâŽ/1008, instead of a degree-9 Taylor polynomial; it has âthe same number of terms (11), but the degree is only 5â (Section 4.2, p. 5837).
The protocol supplies powers xÌÂČ,âŠ,xÌâ”, numerator pÌ, and denominator qÌ. It checks each power against the previous power times xÌ, checks pÌ and qÌ against the coefficient sums, then checks |ÈłÂ·qÌ â pÌ·2^s| < Δ_s·2^s (the three-step âPadĂ© Approximant Verification for Ï(x)â in Section 4.2, p. 5837). The prover âprovides the denominator as an additional witness elementâ (Section 4.2, p. 5837), and the final check multiplies Èł by qÌ, so the circuit never divides.
Verus form. Inference: Encode powers and numerator/denominator as ghost or proof values, prove each recurrence, and specify the final rational relation with a nonzero-denominator precondition. Inference: Verus does not automatically prove approximation error bounds; those need explicit lemmas over the chosen input interval and fixed-point scale.
Evidence and limits. The paperâs error analysis gives at most 2âlog dâ + 1 fixed-point-error bits for a degree-d polynomial, and the same bound for PadĂ© with d = max(m, n) (Section 4.5.2, p. 5840). In Table 2, PadĂ© has 2â8 error bits across the tested functions and quantization widths 16â120 bits, with amortized prover times from 0.98 to 2.62 ms; times are per call, amortized over 100 calls, using Noir/Barretenberg on a 2023 MacBook Pro with an Apple M3 Pro (Section 5, pp. 5840â5841; Table 2, p. 5841). Polynomial-based approximations, PadĂ© included, have âan error that grows large outside the approximation interval, necessitating input range restrictionsâ, and for PadĂ© âthe depth still grows with the desired accuracyâ (Section 4.2, p. 5837).
technique: GaussâLegendre quadrature with parallel inverse witnesses
Use this when the inverse function has an algebraic derivative, or when the function has a direct integral representation. For sigmoid, x = ln(y/(1ây)) is rewritten as an integral whose integrand is 1/(t + (2yâ1)â»Âč) over [-1,1] (Section 4.3, p. 5838). An order-n GaussâLegendre rule precomputes roots t_i and weights w_i and approximates the integral as a weighted sum. The prover supplies r = (2yâ1)â»Âč and h_i = (t_i+r)â»Âč. The circuit checks r against y, every h_i against t_i+r, and the weighted sum against x (the three constraints of âGaussian Quadrature Verification for Ï(x)â, Section 4.3, p. 5838).
For numerical stability, the implementation rewrites each term and checks products y·t_i so denominators do not approach zero near sigmoid y=0.5 (Section 4.5.1, p. 5839). The inverse checks are independent and can be parallelized (Section 4.3, p. 5838). The multiplicative depth is constant with respect to n; only the number of parallel terms grows. The paper says, âthe overall circuit has constant multiplicative depth regardless of the desired accuracyâ (Section 4.4, p. 5839).
Verus form. Inference: Model each quadrature node as a fixed array of constants and prove a loop invariant that every witness inverse satisfies its denominator relation; then prove the weighted-sum error bound. Use requires for denominator nonzero and input interval, ensures for the sum approximation, and a proof function for the quadrature error theorem. Inference: this proves a Rust implementation of the finite sum, not the mathematical derivation of GaussâLegendre roots unless those constants and their error bounds are separately trusted or proved.
Generalization. Table 1 gives integral representations for exponential, sigmoid, tanh, cosine, tangent, fractional powers, and erf (p. 5839). The authors explain that activation functions are often based on trigonometric or hyperbolic functions and SoftMax splits into exponentiations, trigonometric functions use inverse functions with algebraic derivatives, fractional powers use ln y = k ln x, and erf is itself an integral (Section 4.4, pp. 5838â5839). A generic circuit checks intermediate values, checks prover-supplied inverses of the denominators, and checks a weighted sum that âremains the same across all functionsâ (Section 4.4, p. 5839).
Evidence. In Table 2, GaussâLegendre has 4â5 error bits for every tested function at all quantization widths 16â120 bits, with 1.06â86.90 ms amortized prover time (Table 2, p. 5841). Verifier time is 3â5 ms and proof sizes are 7.6â10.7 KiB âfor all experiments that did not time outâ (Table 2 caption, p. 5841; Section 5.1, p. 5842). At 64 bits and above, GaussâLegendre âhas accuracy of 1 â 8 bits better than all baselines, which translates to 2 â 256Ă better absolute errorâ (Section 5.1, p. 5842). For orbital mechanics and Bancor pricing at 120 bits, Table 3 reports respectively 5 and 4 error bits for GaussâLegendre versus 10 bits for Taylor series, with 96 ms and 74 ms prover times; verifier times are around 4 ms and proofs around 7â8 KiB (Table 3 and Sections 5.2â5.3, pp. 5842â5843).
technique: application circuits and trusted boundaries
The orbital circuit proves Keplerâs equation using witnesses for eccentric anomaly, ellipse axes, square root, sine, and cosine. Its six checks verify mean anomaly, the square-root identity, ellipse parameters, cos(E) by quadrature and sin(E) by sinÂČ(E) + cosÂČ(E) = 1, Keplerâs equation, and parametric position equations (Appendix C, p. 5847). The DeFi circuit verifies the division E/R0, the fractional power with quadrature, and the final pricing equation using witnesses for E/R0 and its power (Appendix D, p. 5847).
Inference: In Verus, these are contract layers: prove each algebraic identity as a lemma, then prove the top-level postcondition from the lemmas. The constants, arbitrary-precision witness generation, field backend, and zk-SNARK soundness remain trusted unless separately verified.
The paper explicitly limits applicability: it relies on zk-SNARK non-determinism and âwould not be suitable for other cryptographic applications, such as privacy-preserving ML techniques that use secure multi-party computation (MPC)â (Section 6, p. 5843). The experiments draw real inputs uniformly from [-1,1], use mpmath witness generation, and reach this range by rescaling when choosing the quantization domain (Section 5, p. 5841); reported errors come from âtesting random inputs from the rangeâ (Section 4.5.1, p. 5839). The artifact appendix says âthe accuracy claims in the tables were computed manually and are not part of the artifactâ (Appendix B, p. 5844). Inference: results therefore do not establish worst-case error over all real inputs or all distributions. The paper also says its wide constant-depth circuits give âan opportunity for a custom sumcheck based back-endâ to improve prover time (Section 6, p. 5843).
Inference: Threat to a VeruLaw product is moderate when verified Rust must implement approximate numeric or cryptographic code: the techniques offer reusable proof shapes, but require a precise error model, range proofs, denominator conditions, and trusted numerical constants. Inference: the paper analyzes circuit constraints and reports empirical errors; it does not prove the host arithmetic, Noir compiler, Barretenberg backend, mpmath witness generator, or application-level formulas beyond those circuit checks. Existing lookup, piecewise, Taylor, and floating-point methods are baselines; VL should not redo those comparisons without a new domain or backend.
techniques for the catalog
- non-deterministic fixed-point checks: let the prover supply products or inverses and verify bounded consistency with one multiplication and a range check
- Padé rational approximation: replace a high-degree Taylor polynomial with numerator and denominator witnesses of lower degree
- GaussâLegendre verification: express inverse-derivative functions as weighted integral sums with parallel inverse witnesses
- denominator-stability rewrite: algebraically rewrite quadrature terms and check products to avoid near-zero denominators
- layered application contracts: verify application identities and approximation subcircuits separately, then compose them Checked 2026-10-16 against the full paper by a Claude agent (mid-paper quote: âAdditionally, all polynomial-based approximations have an error that grows large outside the approximation interval, necessitating input range restrictions.â): checked every quotation, number, section and page reference, and technique step against the paper text; changed the link to the publisher page, the multiplication-check section (3 and 4.1), the PadĂ© example (denominator has degree 4, not 5; denominator is a witness, not a witness inverse; box on p. 5837 only), GaussâLegendre error bits in Table 2 (4â5, not 1â8) and prover times (1.06â86.90 ms, not 0.98), the source of the constant-depth quote (Section 4.4, p. 5839), page numbers for Section 5 text, the activation-function generalization, the DeFi witness (
E/R0, notR0/E), and marked unsupported conclusions âInference:â; added the paperâs notes that errors were measured on random inputs and accuracy claims were computed manually; did not check the Verus-form inferences or Table 2 values against the artifact.
Last edited: