Passed
Branch master (7fff96)
by Jordan
06:01
created

BareNativeBench::benchBareNativeTrigH()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Samsara\Fermat\Bench;
4
5
use PhpBench\Attributes\Groups;
6
use PhpBench\Attributes\Revs;
7
8
class BareNativeBench
9
{
10
11
    #[Groups(['arithmetic', 'bare-native'])]
12
    #[Revs(100000)]
13
    public function benchBareNativeBinaryOp()
14
    {
15
        3 + 2;
16
    }
17
18
    #[Groups(['arithmetic', 'bare-native'])]
19
    #[Revs(100000)]
20
    public function benchBareNativePow()
21
    {
22
        3**2;
23
    }
24
25
    #[Groups(['arithmetic', 'bare-native'])]
26
    #[Revs(100000)]
27
    public function benchBareNativeSqrt()
28
    {
29
        sqrt(3);
30
    }
31
32
    #[Groups(['trig', 'basic-trig', 'bare-native'])]
33
    #[Revs(100000)]
34
    public function benchBareNativeTrig()
35
    {
36
        sin(1);
37
    }
38
39
    #[Groups(['trig', 'hyperbolic-trig', 'bare-native'])]
40
    #[Revs(100000)]
41
    public function benchBareNativeTrigH()
42
    {
43
        sinh(1);
44
    }
45
46
    #[Groups(['trig', 'inverse-trig', 'bare-native'])]
47
    #[Revs(100000)]
48
    public function benchBareNativeInvTrig()
49
    {
50
        asin(1);
51
    }
52
53
    #[Groups(['logs', 'bare-native'])]
54
    #[Revs(100000)]
55
    public function benchBareNativeLn()
56
    {
57
        log(5);
58
    }
59
60
    #[Groups(['logs', 'bare-native'])]
61
    #[Revs(100000)]
62
    public function benchBareNativeLog10()
63
    {
64
        log10(5);
65
    }
66
67
    #[Groups(['logs', 'bare-native'])]
68
    #[Revs(100000)]
69
    public function benchBareNativeExp()
70
    {
71
        exp(5);
72
    }
73
74
}