Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1.  
  2. a as float = 13.1
  3. b as float = 1.56
  4.  
  5. do
  6. Print( "Guessed result: " + str( MulAndDifferentiateLogarithmAt( a, b ) ))
  7. Print( "Real result: " + str( a / b ) )
  8.  
  9. Sync()
  10. loop
  11.  
  12. function MulAndDifferentiateLogarithmAt( c as float, x as float )
  13.  
  14. y_approximate as float
  15. local f_precision as float = 0.001
  16. local f_inverse_precision as float = 1000.0
  17.  
  18. y_approximate = c * ( log( x + f_precision ) - log( x ) ) * f_inverse_precision
  19.  
  20. endfunction y_approximate as float
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement