Skip to content

BUG: Fix f64 trig accuracy; match SVML rounding DAGs#10

Open
seiko2plus wants to merge 1 commit into
numpy:mainfrom
seiko2plus:fix/f64-trig-accuracy
Open

BUG: Fix f64 trig accuracy; match SVML rounding DAGs#10
seiko2plus wants to merge 1 commit into
numpy:mainfrom
seiko2plus:fix/f64-trig-accuracy

Conversation

@seiko2plus

Copy link
Copy Markdown
Member
  • Extended path: restructure final reconstruction to follow SVML's per-precision rounding DAG (f32/f64 pair the sin/cos correction terms differently) and regenerate approx.h so sigma is a signed power of two, keeping sigma*r exact
  • Low path: give f64 cosine its own minimax fit matching __svml_cos_d_la and keep its fast path up to ~8388607*pi
  • Non-FMA f64: add SplitMul (exact head product via 26-bit split) to replace the FMA product-error idiom in the high/extended paths and reduce with a descending 4-word pi/16, restoring sub-ULP accuracy
  • Correct trig polynomial/scale/threshold commentsit log

  - Extended path: restructure final reconstruction to follow SVML's
    per-precision rounding DAG (f32/f64 pair the sin/cos correction
    terms differently) and regenerate approx.h so sigma is a signed
    power of two, keeping sigma*r exact
  - Low path: give f64 cosine its own minimax fit matching
    __svml_cos_d_la and keep its fast path up to ~8388607*pi
  - Non-FMA f64: add SplitMul (exact head product via 26-bit split) to
    replace the FMA product-error idiom in the high/extended paths and
    reduce with a descending 4-word pi/16, restoring sub-ULP accuracy
  - Correct trig polynomial/scale/threshold commentsit log
@seiko2plus seiko2plus marked this pull request as ready for review July 10, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant