2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								USING:  help.markup  help.syntax  math.functions  math  ;
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IN:  math.libm  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ARTICLE: "math.libm"  "C standard library math functions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								"The words in the "  { $vocab-link "math.libm"  } " vocabulary call C standard library math functions. They are used to implement words in the "  { $vocab-link "math.functions"  } " vocabulary."  
						 
					
						
							
								
									
										
										
										
											2009-08-30 07:32:20 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $warning
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								"These functions are unsafe. The compiler special-cases them to operate on floats only. They can be called directly, however there is little reason to do so, since they only implement real-valued functions, and in some cases place restrictions on the domain:"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $example "USE: math.functions"  "2.0 acos ."  "C{ 0.0 1.316957896924817 }"  }
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 16:42:46 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $unchecked-example "USE: math.libm"  "2.0 facos ."  "0/0."  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								"Trigonometric functions:"  
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fcos
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fsin
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    facos
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fasin
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fatan
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fatan2
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								"Hyperbolic functions:"  
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fcosh
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fsinh
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								"Exponentials and logarithms:"  
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fexp
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    flog
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    flog10
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								"Powers:"  
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fpow
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    fsqrt
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ABOUT: "math.libm" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  facos  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the inverse trigonometric cosine function from the C standard library. User code should call "  { $link acos } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fasin  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the inverse trigonometric sine function from the C standard library. User code should call "  { $link asin } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fatan  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the inverse trigonometric tangent function from the C standard library. User code should call "  { $link atan } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fatan2  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "y"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the two-parameter inverse trigonometric tangent function from the C standard library. User code should call "  { $link arg } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fcos  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the trigonometric cosine function from the C standard library. User code should call "  { $link cos } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fsin  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the trigonometric sine function from the C standard library. User code should call "  { $link sin } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fcosh  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the hyperbolic cosine function from the C standard library. User code should call "  { $link cosh } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fsinh  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the hyperbolic sine function from the C standard library. User code should call "  { $link sinh } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fexp  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2012-05-02 12:59:09 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $description "Calls the exponential function ("  { $snippet "y=e^x"  } ") from the C standard library. User code should call "  { $link e^ } " instead."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  flog  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the natural logarithm function from the C standard library. User code should call "  { $link log } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 16:42:46 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								HELP:  flog10  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 16:42:46 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $description "Calls the base 10 logarithm function from the C standard library. User code should call "  { $link log10 } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								HELP:  fpow  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "y"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the power function ("  { $snippet "z=x^y"  } ") from the C standard library. User code should call "  { $link ^ } " instead."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  fsqrt  
						 
					
						
							
								
									
										
										
										
											2010-04-14 15:25:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "x"  real  } { "double"  real  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the square root function from the C standard library. User code should call "  { $link sqrt } " instead."  } ;