Implement tan(x) - #10820
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_952536330
branch
from
July 23, 2026 17:45
3e7341a to
8398613
Compare
This refactors the implementation of sin and cos to allow computing both at the same time. Benchmarks: ``` -------------------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations UserCounters... -------------------------------------------------------------------------------------------------------------- bench_reference/tangent_float/m:1/n:4096/real_time 55771 ns 55769 ns 2377 Bytes=587.543M/s Op=73.4429M/s bench_reference/tangent_double/m:1/n:4096/real_time 206666 ns 206656 ns 733 Bytes=317.111M/s Op=19.8194M/s bench/tangent_fp32_avx512/m:1/n:4096/real_time 3379 ns 3379 ns 41664 Bytes=9.69724G/s Op=1.21216G/s bench/tangent_fp64_avx512/m:1/n:4096/real_time 20724 ns 20721 ns 6284 Bytes=3.16227G/s Op=197.642M/s bench/tangent_fp32_avx2_fma3/m:1/n:4096/real_time 4487 ns 4486 ns 32445 Bytes=7.30341G/s Op=912.926M/s bench/tangent_fp64_avx2_fma3/m:1/n:4096/real_time 16939 ns 16937 ns 8114 Bytes=3.86884G/s Op=241.802M/s bench/tangent_fp32_fma3/m:1/n:4096/real_time 7061 ns 7059 ns 19752 Bytes=4.64097G/s Op=580.122M/s bench/tangent_fp64_fma3/m:1/n:4096/real_time 17072 ns 17070 ns 8089 Bytes=3.83869G/s Op=239.918M/s bench/tangent_fp32_avx2/m:1/n:4096/real_time 7323 ns 7323 ns 19036 Bytes=4.47462G/s Op=559.327M/s bench/tangent_fp64_avx2/m:1/n:4096/real_time 25252 ns 25251 ns 5525 Bytes=2.59528G/s Op=162.205M/s bench/tangent_fp32_avx/m:1/n:4096/real_time 8496 ns 8492 ns 16476 Bytes=3.85677G/s Op=482.097M/s bench/tangent_fp64_avx/m:1/n:4096/real_time 28608 ns 28604 ns 4956 Bytes=2.2908G/s Op=143.175M/s bench/tangent_fp32_sse41/m:1/n:4096/real_time 11944 ns 11943 ns 11406 Bytes=2.74346G/s Op=342.932M/s bench/tangent_fp64_sse41/m:1/n:4096/real_time 43979 ns 43977 ns 3162 Bytes=1.49017G/s Op=93.1353M/s bench/tangent_fp32_sse2/m:1/n:4096/real_time 12833 ns 12829 ns 11255 Bytes=2.55341G/s Op=319.176M/s bench/tangent_fp64_sse2/m:1/n:4096/real_time 48748 ns 48745 ns 3000 Bytes=1.34439G/s Op=84.0245M/s bench/tangent_fp32_sse2_fma/m:1/n:4096/real_time 117568 ns 117562 ns 1204 Bytes=278.715M/s Op=34.8394M/s ``` PiperOrigin-RevId: 952852475
copybara-service
Bot
force-pushed
the
test_952536330
branch
from
July 23, 2026 18:02
8398613 to
93f0931
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement tan(x)
This refactors the implementation of sin and cos to allow computing both at the same time.
Benchmarks: