File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -424,8 +424,8 @@ function erfinv(y::BigFloat)
424
424
# Float64 overflowed, use asymptotic estimate instead
425
425
# from erfc(x) ≈ exp(-x²)/x√π ≈ y ⟹ -log(yπ) ≈ x² + log(x) ≈ x²
426
426
x = copysign (sqrt (- log ((1 - abs (y))* sqrtπ)), y)
427
+ isfinite (x) || return x
427
428
end
428
- isfinite (x) || return x
429
429
sqrtπhalf = sqrtπ * 0.5
430
430
tol = 2 eps (abs (x))
431
431
while true # Newton iterations
@@ -451,8 +451,8 @@ function erfcinv(y::BigFloat)
451
451
x = - sqrt (- log ((2 - y)* sqrtπ))
452
452
end
453
453
# TODO : Newton convergence is slow near y=0 singularity; accelerate?
454
+ isfinite (x) || return x
454
455
end
455
- isfinite (x) || return x
456
456
sqrtπhalf = sqrtπ * 0.5
457
457
tol = 2 eps (abs (x))
458
458
while true # Newton iterations
You can’t perform that action at this time.
0 commit comments