Skip to content

Commit a558097

Browse files
committed
revert changes related to Float16, as per oscardssmith
A future PR or a future commit in this PR could also regenerate the polynomials for the wide kernels for `Float16` and `Float32`.
1 parent c43e6b9 commit a558097

File tree

1 file changed

+2
-51
lines changed

1 file changed

+2
-51
lines changed

base/special/trig.jl

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ end
742742
end
743743

744744
@inline function sinpi_kernel(x::Float16)
745-
_sinpi_kernel_polynomial_f16(x)
745+
Float16(sinpi_kernel_wide(x))
746746
end
747747
@inline function sinpi_kernel_wide(x::Float16)
748748
x = Float32(x)
@@ -765,7 +765,7 @@ end
765765
-1.3352624040152927, 0.23531426791507182, -0.02550710082498761))
766766
end
767767
@inline function cospi_kernel(x::Float16)
768-
_cospi_kernel_polynomial_f16(x)
768+
Float16(cospi_kernel_wide(x))
769769
end
770770
@inline function cospi_kernel_wide(x::Float16)
771771
x = Float32(x)
@@ -844,24 +844,6 @@ end
844844
845845
Constrain the zeroth coefficient to `1` to achieve exact behavior for zero input.
846846
847-
* `Float16`:
848-
849-
```sollya
850-
handTuned = 1;
851-
prec = 500!;
852-
accurate = cos(pi * x);
853-
kernelDomain = [-2^-3, 2^-2];
854-
constrainedPart = 1;
855-
machinePrecision = 11;
856-
doubleWordPrecision = 2 * machinePrecision + handTuned;
857-
freeMonomials = [|2, 4|];
858-
freeMonomialPrecisions = [|doubleWordPrecision, machinePrecision|];
859-
polynomial = fpminimax(accurate, freeMonomials, freeMonomialPrecisions, kernelDomain, constrainedPart);
860-
supnormPrecision = 2^-10;
861-
sup(supnorm(polynomial, accurate, kernelDomain, relative, supnormPrecision));
862-
polynomial;
863-
```
864-
865847
* `Float32`:
866848
867849
```sollya
@@ -900,23 +882,6 @@ Constrain the zeroth coefficient to `1` to achieve exact behavior for zero input
900882
901883
## `sinpi`
902884
903-
* `Float16`:
904-
905-
```sollya
906-
handTuned = 3;
907-
prec = 500!;
908-
accurate = sin(pi * x);
909-
kernelDomain = [-2^-3, 2^-2];
910-
machinePrecision = 11;
911-
doubleWordPrecision = 2 * machinePrecision + handTuned;
912-
freeMonomials = [|1, 3, 5|];
913-
freeMonomialPrecisions = [|doubleWordPrecision, machinePrecision, machinePrecision|];
914-
polynomial = fpminimax(accurate, freeMonomials, freeMonomialPrecisions, kernelDomain);
915-
supnormPrecision = 2^-10;
916-
sup(supnorm(polynomial, accurate, kernelDomain, relative, supnormPrecision));
917-
polynomial;
918-
```
919-
920885
* `Float32`:
921886
922887
```sollya
@@ -952,20 +917,6 @@ Constrain the zeroth coefficient to `1` to achieve exact behavior for zero input
952917
```
953918
=#
954919

955-
const _cospi_kernel_polynomial_f16 = CosPiEvaluationScheme(;
956-
c₀ = Float16(1),
957-
c₂ = (Float16(-4.934), Float16(0.001134)),
958-
rest = (
959-
Float16(3.941),
960-
),
961-
)
962-
const _sinpi_kernel_polynomial_f16 = SinPiEvaluationScheme(;
963-
c₁ = (Float16(3.14), Float16(0.0009737)),
964-
rest = (
965-
Float16(-5.168),
966-
Float16(2.52),
967-
),
968-
)
969920
const _cospi_kernel_polynomial_f32 = CosPiEvaluationScheme(;
970921
c₀ = Float32(1),
971922
c₂ = (-4.934802f0, -1.1607644f-7),

0 commit comments

Comments
 (0)