Skip to content

Commit

Permalink
Weierstrass special cases
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmasson committed Mar 14, 2024
1 parent f0a4e40 commit 00957bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,8 @@ function weierstrassP( x, g2, g3 ) {

if ( !isComplex(x) ) x = complex(x);

if ( isZero(g2) && isZero(g3) ) return pow( x, -2 );

var [ e1, e2, e3 ] = weierstrassRoots( g2, g3 );

// Whittaker & Watson, Section 22.351
Expand All @@ -1415,6 +1417,8 @@ function weierstrassPPrime( x, g2, g3 ) {

if ( !isComplex(x) ) x = complex(x);

if ( isZero(g2) && isZero(g3) ) return mul( -2, pow( x, -3 ) );

var [ e1, e2, e3 ] = weierstrassRoots( g2, g3 );

// Whittaker & Watson, Section 22.351
Expand Down
4 changes: 4 additions & 0 deletions src/functions/elliptic-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ function weierstrassP( x, g2, g3 ) {

if ( !isComplex(x) ) x = complex(x);

if ( isZero(g2) && isZero(g3) ) return pow( x, -2 );

var [ e1, e2, e3 ] = weierstrassRoots( g2, g3 );

// Whittaker & Watson, Section 22.351
Expand All @@ -459,6 +461,8 @@ function weierstrassPPrime( x, g2, g3 ) {

if ( !isComplex(x) ) x = complex(x);

if ( isZero(g2) && isZero(g3) ) return mul( -2, pow( x, -3 ) );

var [ e1, e2, e3 ] = weierstrassRoots( g2, g3 );

// Whittaker & Watson, Section 22.351
Expand Down

0 comments on commit 00957bd

Please sign in to comment.