Define and test ULP accuracy for the square-root helpers

Abierto
#1,040 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Start at std/math/float.wave:340, where the square-root helpers are defined, and review the existing f32/f64 special-value behavior before discussing the proposed accuracy contract with @LunaStev. Use the issue’s 400-digit mpmath oracle methodology to compare exact-bit inputs at O0 and O2, including exponents, subnormals, square/halfway neighborhoods, NaN, infinities, and signed zero. Done means an agreed bound or correct-rounding guarantee is published with limitations, representative oracle-backed tests exist, and any algorithm change has O0/O2 evidence.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

discussion enhancement help wanted

Motivation

A deterministic 127-input positive binary64 sample against a 400-digit mpmath oracle found up to one ULP error in sqrt_f64 at both O0/O2; input bits=2 yields result bits 2190614870947216332 instead of nearest-reference 2190614870947216333. The helpers do not promise correct rounding, so this is an accuracy-contract proposal.

Starting point: std/math/float.wave:340.

Validation

Audited canonical Wave 540728c2eb6cc12f5c69c3fb3fdb96e07ba059a4 (0.0.1-alpha-dev), whose tree matches the local checkout. Validation: Executed 127 exact-bit inputs per O0/O2 against 400-digit oracle; not an exhaustive accuracy proof. Executed compiler probes use the matching checkout-built compiler and std on Linux amd64 (Rust 1.89.0 / LLVM 21.1.8). Source/header or mocked checks are not native execution on another OS.

Scope

Agree an error bound or correct-rounding goal for f32/f64 sqrt, then use an independent oracle to test the selected contract. Preserve existing NaN, infinities, signed zero and subnormal behavior.

Design discussion required

This issue records a proposal or an unresolved contract; it is not approval to choose new semantics. Please mention @LunaStev to discuss the design before starting implementation.

Completion criteria

  • Publish the agreed accuracy guarantee and its limitations.
  • Cover exponents, subnormals, square/halfway neighborhoods and special values.
  • Any algorithm change is justified by oracle evidence at O0/O2, not merely by matching its implementation.
Lenguaje dominante
Rust
Estrellas
56
Forks
21
Merge medio
23 h 20 min
PR fusionados (30 d)
45

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wavefnd/Wave

Todos los issues de wavefnd/Wave

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.