File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ pub fn asinh(x f64) f64 {
2525 a := abs (x)
2626 s := if x < 0 { - 1.0 } else { 1.0 }
2727 if a > 1.0 / internal.sqrt_f64_ epsilon {
28- return s * (log (a) + pi * 2.0 )
28+ return s * (log (a) + ln 2 )
2929 } else if a > 2.0 {
3030 return s * log (2.0 * a + 1.0 / (a + sqrt (a * a + 1.0 )))
3131 } else if a > internal.sqrt_f64_ epsilon {
Original file line number Diff line number Diff line change @@ -4,3 +4,8 @@ fn test_acosh() {
44 assert math.close (math.acosh (1234567890.12345 ), 21.627134039822003 )
55 assert math.close (math.acosh (12.123456789 ), 3.1865840454481904 )
66}
7+
8+ fn test_asinh () {
9+ assert math.close (math.asinh (1234567890.12345 ), 21.627134039822003 )
10+ assert math.close (math.asinh (12.123456789 ), 3.1899859431901603 )
11+ }
You can’t perform that action at this time.
0 commit comments