Skip to content

Commit 1e8a149

Browse files
bench: replace custom sincos function with built-in Julia implementation
PR-URL: #5838 Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent 3ecc684 commit 1e8a149

File tree

1 file changed

+1
-20
lines changed
  • lib/node_modules/@stdlib/math/base/special/sincos/benchmark/julia

1 file changed

+1
-20
lines changed

lib/node_modules/@stdlib/math/base/special/sincos/benchmark/julia/benchmark.jl

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,6 @@ function print_results( iterations, elapsed )
8989
@printf( " ...\n" );
9090
end
9191

92-
"""
93-
sincos( x )
94-
95-
Compute the sine and cosine of a number (since sincos is not directly exposed in julia).
96-
97-
# Arguments
98-
99-
* `x`: argument, in radians
100-
101-
# Examples
102-
103-
``` julia
104-
julia> sincos( 0.0 )
105-
```
106-
"""
107-
function sincos( x )
108-
[ sin( x ), cos( x ) ];
109-
end
110-
11192
"""
11293
benchmark()
11394
@@ -126,7 +107,7 @@ julia> out = benchmark();
126107
```
127108
"""
128109
function benchmark()
129-
t = BenchmarkTools.@benchmark $sincos( (20.0*rand()) - 10.0 ) samples=1e6
110+
t = BenchmarkTools.@benchmark sincos( (20.0*rand()) - 10.0 ) samples=1e6
130111

131112
# Compute the total "elapsed" time and convert from nanoseconds to seconds:
132113
s = sum( t.times ) / 1.0e9;

0 commit comments

Comments
 (0)