Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a as float = 13.1
- b as float = 1.56
- do
- Print( "Guessed result: " + str( MulAndDifferentiateLogarithmAt( a, b ) ))
- Print( "Real result: " + str( a / b ) )
- Sync()
- loop
- function MulAndDifferentiateLogarithmAt( c as float, x as float )
- y_approximate as float
- local f_precision as float = 0.001
- local f_inverse_precision as float = 1000.0
- y_approximate = c * ( log( x + f_precision ) - log( x ) ) * f_inverse_precision
- endfunction y_approximate as float
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement