hypergeometric_0F1 loses about 20 ulps for b = 1.5 and −10 < z < 0

Aperta
#1,612 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@NAThompson ci sta già lavorando.

Dal 2/11/2026.

  • #1618 di @NAThompson — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend

Direzione di ricerca

Start with boost/math/special_functions/hypergeometric_0F1.hpp, which the reproducer includes, and compare the Taylor series branch (-5 <= z < 0) with the Bessel relation branch (z < -5). Build the reproducer, print the three listed values, and check them against sin(2√−z)/(2√−z). Done means the error on -10 < z < 0 falls under the ulp bounds the report gives for other ranges. Expect numerical analysis work, not a one-line edit.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

For b = 3/2 and z < 0, 0F1(; 3/2; z) = sin(2√−z) / (2√−z), so the correct values are easy to check:

#include <boost/math/special_functions/hypergeometric_0F1.hpp>
#include <cstdio>

int main()
{
   for (double z : {-3.1499999999999986, -4.5625, -6.0})
   {
      std::printf("%.17g\n", boost::math::hypergeometric_0F1(1.5, z));
   }
}
z Boost correctly rounded error condition number |z f′/f|
−3.1499999999999986 −0.11179277162022014 −0.11179277162022051 +27.2 ulps 3.6
−4.5625 −0.21174773278219308 −0.2117477327821936 +19.2 ulps 0.51
−6 −0.20058104804562102 −0.20058104804562038 −23.4 ulps 0.96

Over 2001 points on [−20, 5], at points with condition number below 4 the error is under 3.5 ulps for z > 0 and under 7.2 ulps for z < −10, but up to 27.2 ulps on −10 < z < 0. Both branches used there show it: the Taylor series (−5 ≤ z < 0) and the Bessel relation (z < −5). Same function as #1538, which #1547 closed.

Apple clang -O2 on arm64 at develop b8c1f01dd; an Emscripten (WebAssembly) build gives the same errors.

Lingua principale
C++
Stelle
377
Fork
269
Merge medio
12h 52m
PR unite (30g)
60

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di boostorg/math

Tutte le issue di boostorg/math

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.