In general yes. But every non-acient compiler will optimize a literal expression anyway.
I tested with gcc-4.8.1 following line
```c++
double input;
std::cin >> input;
double const a = (1. - input) * (1. + input) / 4; // *0.25
```
both resulting in the same assembly code:
```
  4007a3:	c5 fb 10 54 24 08    	vmovsd 0x8(%rsp),%xmm2
  4007ae:	c5 fb 10 0d e2 01 00 	vmovsd 0x1e2(%rip),%xmm1        # 400998 = 1.0
  4007b5:	00 
  4007b6:	c5 f3 5c c2          	vsubsd %xmm2,%xmm1,%xmm0
  4007ba:	c5 eb 58 c9          	vaddsd %xmm1,%xmm2,%xmm1
  4007be:	c5 fb 59 c1          	vmulsd %xmm1,%xmm0,%xmm0
  4007c2:	c5 fb 59 05 d6 01 00 	vmulsd 0x1d6(%rip),%xmm0,%xmm0        # 4009a0 = 0.25

Contents of section .rodata:
 400990 01000200 0a000000 00000000 0000f03f  ...............?
 4009a0 00000000 0000d03f                    .......?        
```