Name:
 externalplot 
plots the error of an external code with regard to a function 
 
  
 
Library names:
 
void sollya_lib_externalplot(sollya_obj_t, sollya_obj_t, sollya_obj_t, 
                             sollya_obj_t, sollya_obj_t, ...) 
void sollya_lib_v_externalplot(sollya_obj_t, sollya_obj_t, sollya_obj_t, 
                               sollya_obj_t, sollya_obj_t, va_list) 
 
 
Usage: 
 
externalplot(filename, mode, function, range, precision) : (string, absolute|relative, function, range, integer) -> void 
externalplot(filename, mode, function, range, precision, perturb) : (string, absolute|relative, function, range, integer, perturb) -> void 
externalplot(filename, mode, function, range, precision, plot mode, result filename) : (string, absolute|relative, function, range, integer, file|postscript|postscriptfile, string) -> void 
externalplot(filename, mode, function, range, precision, perturb, plot mode, result filename) : (string, absolute|relative, function, range, integer, perturb, file|postscript|postscriptfile, string) -> void 
 
  
 
Description: 
 
- The command externalplot plots the error of an external function 
evaluation code sequence implemented in the object file named 
filename with regard to the function function.  If mode 
evaluates to absolute, the difference of both functions is 
considered as an error function; if mode evaluates to relative, 
the difference is divided by the function function. The resulting 
error function is plotted on all floating-point numbers with 
precision significant mantissa bits in the range range.  
 
If the sixth argument of the command externalplot is given and evaluates to 
perturb, each of the floating-point numbers the function is evaluated at gets perturbed by a 
random value that is uniformly distributed in +/-1 ulp 
around the original precision bit floating-point variable. 
 
If a sixth and seventh argument, respectively a seventh and eighth 
argument in the presence of perturb as a sixth argument, are given 
that evaluate to a variable of type file|postscript|postscriptfile respectively to a 
character sequence of type string, externalplot will plot 
(additionally) to a file in the same way as the command plot 
does. See plot for details. 
 
The external function evaluation code given in the object file name 
filename is supposed to define a function name f as 
follows (here in C syntax): void f(mpfr_t rop, mpfr_t op).  
This function is supposed to evaluate op with an accuracy corresponding 
to the precision of rop and assign this value to 
rop. 
 
 
  
 
 
Example 1: 
 
   > bashexecute("gcc -fPIC -c externalplotexample.c");
 
   > bashexecute("gcc -shared -o externalplotexample externalplotexample.o -lgmp -lmpfr");
 
   > externalplot("./externalplotexample",relative,exp(x),[-1/2;1/2],12,perturb);
 
 
  
 
See also: plot, 
asciiplot, 
perturb, 
absolute, 
relative, 
file, 
postscript, 
postscriptfile, 
bashexecute, 
externalproc, 
library 
  
Go back to the list of commands