mersenneforum.org  

Go Back   mersenneforum.org > Search Forums

Showing results 1 to 4 of 4
Search took 0.01 seconds.
Search: Posts Made By: xilman
Forum: Programming 2020-01-19, 22:06
Replies: 43
Views: 25,062
Posted By xilman
I forgot to mention that this sort of code is...

I forgot to mention that this sort of code is frequently faster than the obvious conditional code, even on processors with short pipelines and a small number of threads such as recent x86 machines....
Forum: Programming 2020-01-19, 19:16
Replies: 43
Views: 25,062
Posted By xilman
Exactly the same idea can be used on any...

Exactly the same idea can be used on any architecture. The bit masks may be different but platform-specific compilation is absolutely standard procedure.

Strange as it may seem, I do know what I...
Forum: Programming 2020-01-19, 01:40
Replies: 43
Views: 25,062
Posted By xilman
I did make at least 2 tyops but the compiler...

I did make at least 2 tyops but the compiler would have picked them up instantly. The corrected line of code is

union du {double d, uint64_t u} mask;

Note curly brackets, not round ones.
Forum: Programming 2020-01-18, 16:06
Replies: 43
Views: 25,062
Posted By xilman
Try pulling the standard trick for constant time...

Try pulling the standard trick for constant time arithmetic. I.e. compute (x-pi/4) and mask all but the sign bit:



/* Assume earlier code has declared x to be double and given a value in [0,...
Showing results 1 to 4 of 4

 
All times are UTC. The time now is 01:10.


Sat Jan 28 01:10:09 UTC 2023 up 162 days, 22:38, 0 users, load averages: 1.37, 1.17, 1.08

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔