Skip to content

Commit 4af0f03

Browse files
committed
increase by one the degree of the polynomial for sinpi, Float32
Get the ULP error to below one.
1 parent a558097 commit 4af0f03

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

base/special/trig.jl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -885,14 +885,14 @@ Constrain the zeroth coefficient to `1` to achieve exact behavior for zero input
885885
* `Float32`:
886886
887887
```sollya
888-
handTuned = 1;
888+
handTuned = 5;
889889
prec = 500!;
890890
accurate = sin(pi * x);
891891
kernelDomain = [-2^-3, 2^-2];
892892
machinePrecision = 24;
893893
doubleWordPrecision = 2 * machinePrecision + handTuned;
894-
freeMonomials = [|1, 3, 5, 7|];
895-
freeMonomialPrecisions = [|doubleWordPrecision, machinePrecision, machinePrecision, machinePrecision|];
894+
freeMonomials = [|1, 3, 5, 7, 9|];
895+
freeMonomialPrecisions = [|doubleWordPrecision, machinePrecision, machinePrecision, machinePrecision, machinePrecision|];
896896
polynomial = fpminimax(accurate, freeMonomials, freeMonomialPrecisions, kernelDomain);
897897
supnormPrecision = 2^-10;
898898
sup(supnorm(polynomial, accurate, kernelDomain, relative, supnormPrecision));
@@ -927,11 +927,12 @@ const _cospi_kernel_polynomial_f32 = CosPiEvaluationScheme(;
927927
),
928928
)
929929
const _sinpi_kernel_polynomial_f32 = SinPiEvaluationScheme(;
930-
c₁ = (3.1415927f0, -9.674135f-8),
930+
c₁ = (3.1415927f0, -8.764345f-8),
931931
rest = (
932-
-5.167708f0,
933-
2.5497704f0,
934-
-0.58910555f0,
932+
-5.1677127f0,
933+
2.5501568f0,
934+
-0.5990627f0,
935+
0.079937235f0,
935936
),
936937
)
937938
const _cospi_kernel_polynomial_f64 = CosPiEvaluationScheme(;

0 commit comments

Comments
 (0)