aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Smith <js5@sanger.ac.uk>2022-05-31 11:24:10 +0100
committerGitHub <noreply@github.com>2022-05-31 11:24:10 +0100
commit4fe3f931766494a2326a8278559c1098acb8cb1d (patch)
treef98be4ec27f2e2cccbf1b8fa03f3fb2a69c7838d
parent4e47bdb958f1f413e94a16038aeb4351b90e6447 (diff)
downloadperlweeklychallenge-club-4fe3f931766494a2326a8278559c1098acb8cb1d.tar.gz
perlweeklychallenge-club-4fe3f931766494a2326a8278559c1098acb8cb1d.tar.bz2
perlweeklychallenge-club-4fe3f931766494a2326a8278559c1098acb8cb1d.zip
Update README.md
-rw-r--r--challenge-167/james-smith/README.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/challenge-167/james-smith/README.md b/challenge-167/james-smith/README.md
index ec7467c314..17a6e5bc23 100644
--- a/challenge-167/james-smith/README.md
+++ b/challenge-167/james-smith/README.md
@@ -82,9 +82,10 @@ const my @PV => (
sub gamma {
my($i,$x,$z)=(0,$X,$_[0]);
- return ($z<=0 && abs($z-int$z)<$EP) ? 'inf'
- : $z < 0.5 ? $PI / sin($PI*$z) * gamma( 1-$z )
- : (map({$x+=$_/($z+$i++)}@PV),abs(($i=$RP*($i=$z+@PV-1.5)**($z-0.5)*exp(-$i)*$x)-int$i)<$EP?int$i:$i)[-1]
- ;
+ ( $z<=0 && abs( $z - int$z ) < $EP ) ? 'inf'
+ : $z < 0.5 ? $PI / sin( $PI * $z ) * gamma( 1 - $z )
+ : ( map( { $x += $_ / ( $z + $i++ ) } @PV ),
+ abs( ( $i = $RP * ( $i = $z + @PV - 1.5 ) ** ( $z - 0.5 ) * $x * exp -$i ) - int $i
+ ) < $EP ? int $i : $i )[-1]
}
```