Go back to the main page of Sollya

Commands available within Sollya

Help pages

Name:

abs the absolute value.

Library names:

sollya_obj_t sollya_lib_abs(sollya_obj_t) sollya_obj_t sollya_lib_build_function_abs(sollya_obj_t) #define SOLLYA_ABS(x) sollya_lib_build_function_abs(x)

Description:

Go back to the list of commands

Name:

absolute indicates an absolute error for externalplot, fpminimax or supnorm

Library names:

sollya_obj_t sollya_lib_absolute() int sollya_lib_is_absolute(sollya_obj_t)

Usage:

absolute : absolute|relative

Description:

Example 1:

   > bashexecute("gcc -fPIC -c externalplotexample.c");
   > bashexecute("gcc -shared -o externalplotexample externalplotexample.o -lgmp -lmpfr");
   > externalplot("./externalplotexample",absolute,exp(x),[-1/2;1/2],12,perturb);
See also: externalplot, fpminimax, relative, bashexecute, supnorm
Go back to the list of commands

Name:

accurateinfnorm computes a faithful rounding of the infinity norm of a function

Usage:

accurateinfnorm(function,range,constant) : (function, range, constant) -> constant accurateinfnorm(function,range,constant,exclusion range 1,...,exclusion range n) : (function, range, constant, range, ..., range) -> constant

Parameters:

Description:

Example 1:

   > p = remez(exp(x), 5, [-1;1]);
   > accurateinfnorm(p - exp(x), [-1;1], 20);
   4.52055246569216251373291015625e-5
   > accurateinfnorm(p - exp(x), [-1;1], 30);
   4.5205513970358879305422306060791015625e-5
   > accurateinfnorm(p - exp(x), [-1;1], 40);
   4.520551396713923253400935209356248378753662109375e-5

Example 2:

   > p = remez(exp(x), 5, [-1;1]);
   > midpointmode = on!;
   > infnorm(p - exp(x), [-1;1]);
   0.45205~5/7~e-4
   > accurateinfnorm(p - exp(x), [-1;1], 40);
   4.520551396713923253400935209356248378753662109375e-5
See also: infnorm, dirtyinfnorm, supnorm, checkinfnorm, remez, diam
Go back to the list of commands

Name:

acos the arccosine function.

Library names:

sollya_obj_t sollya_lib_acos(sollya_obj_t) sollya_obj_t sollya_lib_build_function_acos(sollya_obj_t) #define SOLLYA_ACOS(x) sollya_lib_build_function_acos(x)

Description:

See also: cos
Go back to the list of commands

Name:

acosh the arg-hyperbolic cosine function.

Library names:

sollya_obj_t sollya_lib_acosh(sollya_obj_t) sollya_obj_t sollya_lib_build_function_acosh(sollya_obj_t) #define SOLLYA_ACOSH(x) sollya_lib_build_function_acosh(x)

Description:

See also: cosh
Go back to the list of commands

Name:

&& boolean AND operator

Library name:

sollya_obj_t sollya_lib_and(sollya_obj_t, sollya_obj_t)

Usage:

expr1 && expr2 : (boolean, boolean) -> boolean

Parameters:

Description:

Example 1:

   > true && false;
   false

Example 2:

   > (1 == exp(0)) && (0 == log(1));
   true
See also: ||, !
Go back to the list of commands

Name:

annotatefunction Annotates a Sollya function object with an approximation that is faster to evaluate

Library names:

sollya_obj_t sollya_lib_annotatefunction(sollya_obj_t, sollya_obj_t,                                          sollya_obj_t, sollya_obj_t, ...); sollya_obj_t sollya_lib_v_annotatefunction(sollya_obj_t, sollya_obj_t,                                            sollya_obj_t, sollya_obj_t,                                            va_list);

Usage:

annotatefunction(f, g, I, d) : (function, function, range, range) -> function annotatefunction(f, g, I, d, x0) : (function, function, range, range, constant) -> function

Parameters:

Description:

Example 1:

   > verbosity=1!;
   > procedure EXP(X,n,p) {
               var res, oldPrec;
               oldPrec = prec;
               prec = p!;
               "Using procedure function exponential with X=" @ X @ ", n=" @ n @ ", and p=" @ p;
               res = exp(X);
               prec = oldPrec!;
               return res;
          };
   > g = function(EXP);
   > p = 46768052394588893382516870161332864698044514954899b-165 + x * (23384026197294446691258465802074096632225783601255b-164 + x * (5846006549323611672948426613035653821819225877423b-163 + x * (3897337699549074448627696490806815137319821946501b-164 + x * (7794675399098148717422744621371434831048848817417b-167 + x * (24942961277114075921122941174178849425809856036737b-171 + x * (8314320425704876115613838900105097456456371179471b-172 + x * (19004160973039701371579356991645932289422670402995b-176 + x * (19004160972669324148912122254449912156003926801563b-179 + x * (33785175062542597526738679493857229456702396042255b-183 + x * (6757035113643674378393625988264926886191860669891b-184 + x * (9828414707511252769908089206114262766633532289937b-188 + x * (26208861108003813314724515233584738706961162212965b-193 + x * (32257064253325954315953742396999456577223350602741b-197 + x * (578429089657689569703509185903214676926704485495b-195 + x * 2467888542176675658523627105540996778984959471957b-201))))))))))))));
   > h = annotatefunction(g, p, [-1/2;1/2], [-475294848522543b-124;475294848522543b-124]);
   > h == g;
   true
   > prec = 24;
   The precision has been set to 24 bits.
   > h(0.25);
   Warning: rounding has happened. The value displayed is a faithful rounding to 24 bits of the true result.
   1.2840254
   > prec = 165;
   The precision has been set to 165 bits.
   > h(0.25);
   Using procedure function exponential with X=[0.25;0.25], n=0, and p=185
   Warning: rounding has happened. The value displayed is a faithful rounding to 165 bits of the true result.
   1.28402541668774148407342056806243645833628086528147
See also: chebyshevform, taylorform, remez, supnorm, infnorm
Go back to the list of commands

Name:

:. add an element at the end of a list.

Library name:

sollya_obj_t sollya_lib_append(sollya_obj_t, sollya_obj_t)

Usage:

L:.x : (list, any type) -> list

Parameters:

Description:

Example 1:

   > [|2,3,4|]:.5;
   [|2, 3, 4, 5|]

Example 2:

   > [|1,2,3|]:.[|4,5,6|];
   [|1, 2, 3, [|4, 5, 6|]|]

Example 3:

   > [||]:.1;
   [|1|]
See also: .:, @
Go back to the list of commands

Name:

~ floating-point evaluation of a constant expression

Library name:

sollya_obj_t sollya_lib_approx(sollya_obj_t)

Usage:

~ expression : function -> constant ~ something : any type -> any type

Parameters:

Description:

Example 1:

   > print(exp(5));
   exp(5)
   > print(~ exp(5));
   148.41315910257660342111558004055227962348766759388

Example 2:

   > autosimplify = off!;

Example 3:

   > print(~sin(5 * pi));
   0

Example 4:

   > print(~exp(x));
   exp(x)
   > print(~ "Hello");
   Hello

Example 5:

   > print(~exp(x*5*Pi));
   exp((pi) * 5 * x)
   > print(exp(x* ~(5*Pi)));
   exp(x * 15.7079632679489661923132169163975144209858469968757)

Example 6:

   > print(~exp(5)*x);
   148.41315910257660342111558004055227962348766759388 * x
   > print( (~exp(5))*x);
   148.41315910257660342111558004055227962348766759388 * x
   > print(~(exp(5)*x));
   exp(5) * x
See also: evaluate, prec, error
Go back to the list of commands

Name:

asciiplot plots a function in a range using ASCII characters

Library name:

void sollya_lib_asciiplot(sollya_obj_t, sollya_obj_t)

Usage:

asciiplot(function, range) : (function, range) -> void

Parameters:

Description:

Example 1:

   > asciiplot(exp(x),[1;2]);
                                                                             xx
                                                                           xx  
                                                                         xx    
                                                                       xx      
                                                                     xx        
                                                                  xxx          
                                                                xx             
                                                             xxx               
                                                           xx                  
                                                        xxx                    
                                                     xxx                       
                                                  xxx                          
                                               xxx                             
                                            xxx                                
                                        xxxx                                   
                                     xxx                                       
                                 xxxx                                          
                             xxxx                                              
                         xxxx                                                  
                     xxxx                                                      
                xxxxx                                                          
           xxxxx                                                               
      xxxxx                                                                    
   xxx                                                                         

Example 2:

   > asciiplot(expm1(x),[-1;2]);
                            |                                                 x
                            |                                                x
                            |                                               x  
                            |                                              x   
                            |                                            xx    
                            |                                           x      
                            |                                          x       
                            |                                        xx        
                            |                                       x          
                            |                                     xx           
                            |                                   xx             
                            |                                 xx               
                            |                               xx                 
                            |                             xx                   
                            |                           xx                     
                            |                        xxx                       
                            |                     xxx                          
                            |                 xxxx                             
                            |             xxxx                                 
                            |         xxxx                                     
                            |   xxxxxx                                         
   ---------------------xxxxxxxx-----------------------------------------------
            xxxxxxxxxxxx    |                                                  
   xxxxxxxxx                |                                                  

Example 3:

   > asciiplot(5,[-1;1]);
   5

Example 4:

   > asciiplot(exp(x),[1;1]);
   2.7182818284590452353602874713526624977572470937
See also: plot, externalplot
Go back to the list of commands

Name:

asin the arcsine function.

Library names:

sollya_obj_t sollya_lib_asin(sollya_obj_t) sollya_obj_t sollya_lib_build_function_asin(sollya_obj_t) #define SOLLYA_ASIN(x) sollya_lib_build_function_asin(x)

Description:

See also: sin
Go back to the list of commands

Name:

asinh the arg-hyperbolic sine function.

Library names:

sollya_obj_t sollya_lib_asinh(sollya_obj_t) sollya_obj_t sollya_lib_build_function_asinh(sollya_obj_t) #define SOLLYA_ASINH(x) sollya_lib_build_function_asinh(x)

Description:

See also: sinh
Go back to the list of commands

Name:

atan the arctangent function.

Library names:

sollya_obj_t sollya_lib_atan(sollya_obj_t) sollya_obj_t sollya_lib_build_function_atan(sollya_obj_t) #define SOLLYA_ATAN(x) sollya_lib_build_function_atan(x)

Description:

See also: tan
Go back to the list of commands

Name:

atanh the hyperbolic arctangent function.

Library names:

sollya_obj_t sollya_lib_atanh(sollya_obj_t) sollya_obj_t sollya_lib_build_function_atanh(sollya_obj_t) #define SOLLYA_ATANH(x) sollya_lib_build_function_atanh(x)

Description:

See also: tanh
Go back to the list of commands

Name:

autodiff Computes the first n derivatives of a function at a point or over an interval.

Library name:

sollya_obj_t sollya_lib_autodiff(sollya_obj_t, sollya_obj_t, sollya_obj_t)

Usage:

autodiff(f, n, x0) : (function, integer, constant) -> list autodiff(f, n, I) : (function, integer, range) -> list

Parameters:

Description:

Example 1:

   > L = autodiff(exp(cos(x))+sin(exp(x)), 5, 0);
   > midpointmode = on!;
   > for f_i in L do f_i;
   0.3559752813266941742012789792982961497379810154498~2/4~e1
   0.5403023058681397174009366074429766037323104206179~0/3~
   -0.3019450507398802024611853185539984893647499733880~6/2~e1
   -0.252441295442368951995750696489089699886768918239~6/4~e1
   0.31227898756481033145214529184139729746320579069~1/3~e1
   -0.16634307959006696033484053579339956883955954978~3/1~e2

Example 2:

   > f = log(cos(x)+x);
   > L = autodiff(log(cos(x)+x), 5, [2,4]);
   > L[0];
   [0;1.27643852425465597132446653114905059102580436018893]
   > evaluate(f, [2,4]);
   [0.45986058925497069206106494332976097408234056912429;1.20787210589964169595901037621103012113048821362855]
   > fprime = diff(f);
   > L[1];
   [2.53086745013099407167484456656211083053393118778677e-2;1.7568024953079282513726390945118290941359128873365]
   > evaluate(fprime,[2,4]);
   [2.71048755415961996452136364304380881763456815673085e-2;1.1091953066394329083739722578862353140555843127995]

Example 3:

   > L = autodiff(sin(x)/x, 0, [-1,1]);
   > L[0];
   [-infty;infty]
   > evaluate(sin(x)/x, [-1,1]);
   [0.5403023058681397174009366074429766037323104206179;1]
See also: diff, evaluate
Go back to the list of commands

Name:

autosimplify activates, deactivates or inspects the value of the automatic simplification state variable

Library names:

void sollya_lib_set_autosimplify_and_print(sollya_obj_t) void sollya_lib_set_autosimplify(sollya_obj_t) sollya_obj_t sollya_lib_get_autosimplify()

Usage:

autosimplify = activation value : on|off -> void autosimplify = activation value ! : on|off -> void autosimplify : on|off

Parameters:

Description:

mpec="#evaluate">evaluate
evaluate evaluate evaluate evaluate ar onvalu="#taylor">taylor or taylor or taylor or taylor or p; &nbs="#taylor">taylor or taylor or taylor or sometimes produce expressioaylor">taylor or Go back to the list of commands
actipautosimplify"> Name: autosimplify activates, deactivates or insexecuificimphellref="#eva#eva] such tier,outputicesatreex0)."divLibraryName">

Library names:

sollya_obj_t sollya_lib_atanh(sollya_obj_t)
sollya_obj_t sollya_lib_get_autosimplify() s="divUsage">

Usage:

autodiff( nodifffunction void voiline">autosimplify nodifffunct,span class="arg">ninput">function, voipan>) -> voist
reex0)pe">voiline">

Parameters: