Translate Fortran code into a formula

I want to check some parts of my fortran code. I know that there is a “FortranForm” command for mathematics that does the opposite. If there is anything else on the Internet that would be great too.

Is there something like this for simple Fortran code cases? For example, I want to convert now: result = exp ((- 0.5) * ((delta_w / delta) * (delta_w / delta)))

+3
source share
3 answers

I already did this with Mathematica v6 to help me understand the Fortran IV function, and the only way I found was to systematically replace Fortran constructs with Mathematica manually. Although not necessary in your case, Mathematica has Gotoand Label. For longer functions, this requires some discipline, but doable. In your case, the translation is quite simple; it's simple

Exp[ -0.5*(deltaw/delta)^2]

By the way, in your code (delta_w/delta)*(delta_w/delta)you can simplify to (delta_w/delta)**2.

, v8, Wolfram LibraryLink Mathematica. , C, , , , , . , , .

+2

, - TraditionalForm, , , , , . , StringReplace.

, - . ( ) , - f(x) , .

TradinionalForm ( , ctrl-shift-t), , .

+2

, , , , , .

(1) "+" . " ". .

(2) " ".

(3) "=" . . , Unevaluated [], .

.

enter image description here

, .

+2
source

All Articles