# Why MKL's vdsin is slower than the intrinsic sin?

**URL:** <https://fortran-lang.discourse.group/t/why-mkls-vdsin-is-slower-than-the-intrinsic-sin/3108>\
**Category:** Uncategorized\
**Created:** [April 2, 2022, 7:25pm UTC](https://fortran-lang.discourse.group/t/why-mkls-vdsin-is-slower-than-the-intrinsic-sin/3108 "2022-04-02T19:25:51Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![CRquantum](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/crquantum/32/730_2.png) [@CRquantum](https://fortran-lang.discourse.group/u/CRquantum)\
**Post date:** [April 2, 2022, 7:38pm UTC](https://fortran-lang.discourse.group/t/why-mkls-vdsin-is-slower-than-the-intrinsic-sin/3108/3 "2022-04-02T19:38:46Z")

</div>

Thanks @septc ! Yeah, uhm, well I just try to do the same thing as @certik did in that thread, his code is,

```auto
program avx
implicit none
integer, parameter :: dp = kind(0.d0)
real(dp) :: t1, t2, r

call cpu_time(t1)
r = f(100000000)
call cpu_time(t2)

print *, "Time", t2-t1
print *, r

contains

    real(dp) function f(N) result(r)
    integer, intent(in) :: N
    integer :: i
    r = 0
    do i = 1, N
        r = r + sin(real(i,dp))
    end do
    end function

end program

```

If I do

```auto
r = sum(sin(dble([(i,i=1,N)])))

```

it is two times faster than using MKL’s vdsin as below

```auto
    call vdsin(N,(dble([(i,i=1,N)])),j)
    r = sum(j)

```

---

_[View the full topic](https://fortran-lang.discourse.group/t/why-mkls-vdsin-is-slower-than-the-intrinsic-sin/3108)._
