# \#trigonometry

**URL:** https://discourse.julialang.org/tag/trigonometry/503.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Speeding up trig-heavy code](https://discourse.julialang.org/t/speeding-up-trig-heavy-code/134656)

<div class="topic-metadata">

**Author:** [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Replies:** 26\
**Last updated:** [January 2, 2026, 4:44pm UTC](https://discourse.julialang.org/t/speeding-up-trig-heavy-code/134656 "2026-01-02T16:44:23Z")

</div>

Hello! I recently released v0.3.2 of SolarPosition.jl. I feel like it is now in a position where I am very happy with the performance, at least I think I covered all the basics like type stability covered in Performance…

---

## [Why trigonometric functions throw an error for Inf?](https://discourse.julialang.org/t/why-trigonometric-functions-throw-an-error-for-inf/113899)

<div class="topic-metadata">

**Author:** [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Replies:** 2\
**Last updated:** [May 6, 2024, 12:18pm UTC](https://discourse.julialang.org/t/why-trigonometric-functions-throw-an-error-for-inf/113899 "2024-05-06T12:18:37Z")

</div>

I belive many other floating point functions just return NaN for fast results or IEEE floating point compliance for incompatible input values but sin, cos like trigonometric functions throw for Inf but also not throw for…

---

## [Handling Dynamical system with trigonometric function](https://discourse.julialang.org/t/handling-dynamical-system-with-trigonometric-function/106429)

<div class="topic-metadata">

**Author:** [@hisacro](https://discourse.julialang.org/u/hisacro)\
**Replies:** 14\
**Last updated:** [November 19, 2023, 10:45am UTC](https://discourse.julialang.org/t/handling-dynamical-system-with-trigonometric-function/106429 "2023-11-19T10:45:30Z")

</div>

using DynamicalSystems, GLMakie, OrdinaryDiffEq function rotor\_1( u, params, t) # @inbounds begin θ1,pθ1,θ2,pθ2 = u k,l = params…

---

## [Peculiar GPU behavior: zero performance cost for math functions?](https://discourse.julialang.org/t/peculiar-gpu-behavior-zero-performance-cost-for-math-functions/105764)

<div class="topic-metadata">

**Author:** [@bremez](https://discourse.julialang.org/u/bremez)\
**Replies:** 5\
**Last updated:** [November 4, 2023, 4:24am UTC](https://discourse.julialang.org/t/peculiar-gpu-behavior-zero-performance-cost-for-math-functions/105764 "2023-11-04T04:24:15Z")

</div>

I have a use case where the performance bottleneck is in computing trigonometric functions. I thought that maybe it would benefit from some more parallelism, and realized that having access to a university computing clus…

---

## [Sincos slightly slower than sin and cos](https://discourse.julialang.org/t/sincos-slightly-slower-than-sin-and-cos/73207)

<div class="topic-metadata">

**Author:** [@markmbaum](https://discourse.julialang.org/u/markmbaum)\
**Replies:** 2\
**Last updated:** [December 16, 2021, 3:14pm UTC](https://discourse.julialang.org/t/sincos-slightly-slower-than-sin-and-cos/73207 "2021-12-16T15:14:32Z")

</div>

I have some pieces of code that require lots of sin and cos evaluations and I’m looking for ways to accelerate. I noticed that the sincos function seems slightly slower than calling sin and cos alone. julia\> using Bench…

---

## [Weird @btime results with \`sin\`](https://discourse.julialang.org/t/weird-btime-results-with-sin/61644)

<div class="topic-metadata">

**Author:** [@cryptic.ax](https://discourse.julialang.org/u/cryptic.ax)\
**Replies:** 1\
**Last updated:** [May 22, 2021, 4:23pm UTC](https://discourse.julialang.org/t/weird-btime-results-with-sin/61644 "2021-05-22T16:23:44Z")

</div>

I was profiling timing differences between using sin, sind, and I noticed some interesting results. julia\> using BenchmarkTools julia\> sin(10); julia\> sind(10); julia\> const ° = π/180; julia\> x = 1.234; julia\> @bti…

---

## [Using test.jl to prove trig identies](https://discourse.julialang.org/t/using-test-jl-to-prove-trig-identies/48654)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 9\
**Last updated:** [October 19, 2020, 11:46pm UTC](https://discourse.julialang.org/t/using-test-jl-to-prove-trig-identies/48654 "2020-10-19T23:46:14Z")

</div>

I’m trying to do a proof using trig identities, I get a fail, and I,m not sure if I’m using @test wrong, or if I made a mistake in my math s.t. cos(x)-cos(y)=-2\*(sin((x+y)/2)\*sin((x-y)/2)) using Plots using test FX=f…
