X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fmath%2Fcbrt.c;h=86ef6906314ebf8cdac7f38ad747e2e1a90db5ce;hp=cf6d16b8a0376ed73c0fa06c8f7891dbb00a6017;hb=0a5395faab237ba9008352b0f4bee9659bbd3d5f;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec diff --git a/functions/math/cbrt.c b/functions/math/cbrt.c index cf6d16b..86ef690 100644 --- a/functions/math/cbrt.c +++ b/functions/math/cbrt.c @@ -15,5 +15,18 @@ long double cbrt( long double x ) { /* TODO */ }; // Standard C double cbrt( double x ) { /* TODO */ }; + +/* Therx code +{ + double i = x / 4; + // (15 DP) HOW GET MORE? + while ( ( fabs( i - ( x / i / i ) ) / i ) > 0.00000000000001 ) + { + i = ( i + ( x / i / i ) + i ) / 3; + } + return i; +} +*/ + float cbrtf( float x ) { /* TODO */ }; long double cbrtl( long double x ) { /* TODO */ };