@knittl's answer is correct, and fully explains the behaviour you observe. That said, in case anyone arrives at this question and their code doesn't use the less precise float type, there is another more subtle reason that similar code might produce different results, so I think it is worth adding another answer about that.
In the code which doesn't use variables, (int) (10 * 0.75 / 0.6 + 0.5) is a constant expression (JLS §15.28), so it is evaluated at compile-time, not at runtime; and constant expressions are always FP-strict (JLS §15.4) meaning they may be evaluated with a different floating-point value set to non-FP-strict expressions, and that means sometimes they can have different results. Of course, the cast to int afterwards can amplify a small difference into a whole-number difference.
The two versions compile to significantly different bytecode:
public void withVars();
Code:
0: bipush 10
2: istore_1
3: ldc #2 // float 0.75f
5: fstore_2
6: ldc #3 // float 0.6f
8: fstore_3
9: getstatic #4 // Field java/lang/System.out:Ljava/io/PrintStream;
12: iload_1
13: i2f
14: fload_2
15: fmul
16: fload_3
17: fdiv
18: f2d
19: ldc2_w #5 // double 0.5d
22: dadd
23: d2i
24: invokedynamic #7, 0 // InvokeDynamic #0:makeConcatWithConstants:(I)Ljava/lang/String;
29: invokevirtual #8 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
32: return
public void withoutVars();
Code:
0: getstatic #4 // Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #9 // String (int) (10 * 0.75 / 0.6 + 0.5)=13
5: invokevirtual #8 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
8: return
Note that the version with variables does the arithmetic at runtime: the fmul, fdiv, dadd and d2i operations do the multiplication, division, addition and cast to int respectively. However, the version without variables simply has a ldc (load constant) instruction, and this constant is actually the whole string "(int) (10 * 0.75 / 0.6 + 0.5)=13" because even the string concatenation part is a constant expression, so not even the string concatenation is done at runtime.
As a side-note, if you use variables but declare them final, then the expression becomes a constant expression again, so it will compile to the same bytecode as the one without variables.