double pw10(x)
double x;
{
  double xi, ex, y;
  if (x > 38.0)
    return (1.7014117331926443e38);
  if (x < -38.0)
    return (0.0);
  xi = x;
  ex = 1.0;
  while (xi > 1.0) {
    ex *= 10.0;
    xi--;
  }
  while (xi < 0.0) {
    ex *= 0.1;
    xi++;
  }
  y = ((((((.00093264267 * xi + .00255491796) * xi + .01742111988) * xi +
          .07295173666) *
             xi +
         .25439357484) *
            xi +
        .66273088429) *
           xi +
       1.15129277603) *
          xi +
      1.0;
  y *= y;
  return (y * ex);
}


x86 assembly (clang, -O0):
<pw10>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1132 <pw10+0x32>
movsd  0xf40(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12a3 <pw10+0x1a3>
movsd  0xece(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1152 <pw10+0x52>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12a3 <pw10+0x1a3>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a9 <pw10+0xa9>
movsd  0xed8(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xebe(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1169 <pw10+0x69>
jmp    11ae <pw10+0xae>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11e5 <pw10+0xe5>
movsd  0xe8c(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe3a(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11ae <pw10+0xae>
movsd  -0x18(%rbp),%xmm0
movsd  0xe4e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe25(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe08(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdeb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdce(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdb1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd94(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pw10>:
ucomisd 0xf00(%rip),%xmm0
jbe    1113 <pw10+0x13>
movsd  0xeee(%rip),%xmm0
ret
xorpd  %xmm1,%xmm1
movsd  0xef1(%rip),%xmm2
ucomisd %xmm0,%xmm2
ja     1202 <pw10+0x102>
movsd  0xee7(%rip),%xmm2
ucomisd %xmm2,%xmm0
jbe    116e <pw10+0x6e>
movsd  0xed9(%rip),%xmm1
movsd  0xed9(%rip),%xmm3
movsd  0xed9(%rip),%xmm4
movapd %xmm1,%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mulsd  %xmm3,%xmm2
addsd  %xmm4,%xmm0
ucomisd %xmm1,%xmm0
ja     1160 <pw10+0x60>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    119e <pw10+0x9e>
movsd  0xeb0(%rip),%xmm3
movsd  0xe90(%rip),%xmm4
nopl   0x0(%rax,%rax,1)
mulsd  %xmm3,%xmm2
addsd  %xmm4,%xmm0
ucomisd %xmm0,%xmm1
ja     1190 <pw10+0x90>
movsd  0xe92(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe8e(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe8a(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe86(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe82(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe7e(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe7a(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe1e(%rip),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pw10(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
%7 = load double, double* %3
%8 = fcmp ogt double %7, 3.800000e+01
br i1 %8, label %9, label %10
9: ; preds = %1
store double 0x47DFFFFFE0000000, double* %2
br label %54
10: ; preds = %1
%11 = load double, double* %3
%12 = fcmp olt double %11, -3.800000e+01
br i1 %12, label %13, label %14
13: ; preds = %10
store double 0.000000e+00, double* %2
br label %54
14: ; preds = %10
%15 = load double, double* %3
store double %15, double* %4
store double 1.000000e+00, double* %5
br label %16
16: ; preds = %19, %14
%17 = load double, double* %4
%18 = fcmp ogt double %17, 1.000000e+00
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load double, double* %5
%21 = fmul double %20, 1.000000e+01
store double %21, double* %5
%22 = load double, double* %4
%23 = fadd double %22, -1.000000e+00
store double %23, double* %4
br label %16
24: ; preds = %16
br label %25
25: ; preds = %28, %24
%26 = load double, double* %4
%27 = fcmp olt double %26, 0.000000e+00
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load double, double* %5
%30 = fmul double %29, 1.000000e-01
store double %30, double* %5
%31 = load double, double* %4
%32 = fadd double %31, 1.000000e+00
store double %32, double* %4
br label %25
33: ; preds = %25
%34 = load double, double* %4
%35 = call double @llvm.fmuladd.f64(double 0x3F4E8F92E21CCE99, double %34, double 0x3F64EE0D22A11460)
%36 = load double, double* %4
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double 0x3F91D6D79093C22F)
%38 = load double, double* %4
%39 = call double @llvm.fmuladd.f64(double %37, double %38, double 0x3FB2ACF70B241F69)
%40 = load double, double* %4
%41 = call double @llvm.fmuladd.f64(double %39, double %40, double 0x3FD047FBFD100562)
%42 = load double, double* %4
%43 = call double @llvm.fmuladd.f64(double %41, double %42, double 0x3FE5351766426407)
%44 = load double, double* %4
%45 = call double @llvm.fmuladd.f64(double %43, double %44, double 0x3FF26BB1F952B7EC)
%46 = load double, double* %4
%47 = call double @llvm.fmuladd.f64(double %45, double %46, double 1.000000e+00)
store double %47, double* %6
%48 = load double, double* %6
%49 = load double, double* %6
%50 = fmul double %49, %48
store double %50, double* %6
%51 = load double, double* %6
%52 = load double, double* %5
%53 = fmul double %51, %52
store double %53, double* %2
br label %54
54: ; preds = %33, %13, %9
%55 = load double, double* %2
ret double %55
}

LLVM IR (-O2):
define double @pw10(double %0) {
%2 = fcmp ogt double %0, 3.800000e+01
br i1 %2, label %35, label %3
3: ; preds = %1
%4 = fcmp olt double %0, -3.800000e+01
br i1 %4, label %35, label %5
5: ; preds = %3
%6 = fcmp ogt double %0, 1.000000e+00
br i1 %6, label %11, label %7
7: ; preds = %11, %5
%8 = phi double [ %0, %5 ], [ %15, %11 ]
%9 = phi double [ 1.000000e+00, %5 ], [ %14, %11 ]
%10 = fcmp olt double %8, 0.000000e+00
br i1 %10, label %17, label %23
11: ; preds = %5, %11
%12 = phi double [ %14, %11 ], [ 1.000000e+00, %5 ]
%13 = phi double [ %15, %11 ], [ %0, %5 ]
%14 = fmul double %12, 1.000000e+01
%15 = fadd double %13, -1.000000e+00
%16 = fcmp ogt double %15, 1.000000e+00
br i1 %16, label %11, label %7
17: ; preds = %7, %17
%18 = phi double [ %20, %17 ], [ %9, %7 ]
%19 = phi double [ %21, %17 ], [ %8, %7 ]
%20 = fmul double %18, 1.000000e-01
%21 = fadd double %19, 1.000000e+00
%22 = fcmp olt double %21, 0.000000e+00
br i1 %22, label %17, label %23
23: ; preds = %17, %7
%24 = phi double [ %8, %7 ], [ %21, %17 ]
%25 = phi double [ %9, %7 ], [ %20, %17 ]
%26 = tail call double @llvm.fmuladd.f64(double %24, double 0x3F4E8F92E21CCE99, double 0x3F64EE0D22A11460)
%27 = tail call double @llvm.fmuladd.f64(double %26, double %24, double 0x3F91D6D79093C22F)
%28 = tail call double @llvm.fmuladd.f64(double %27, double %24, double 0x3FB2ACF70B241F69)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %24, double 0x3FD047FBFD100562)
%30 = tail call double @llvm.fmuladd.f64(double %29, double %24, double 0x3FE5351766426407)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %24, double 0x3FF26BB1F952B7EC)
%32 = tail call double @llvm.fmuladd.f64(double %31, double %24, double 1.000000e+00)
%33 = fmul double %32, %32
%34 = fmul double %25, %33
br label %35
35: ; preds = %3, %1, %23
%36 = phi double [ %34, %23 ], [ 0x47DFFFFFE0000000, %1 ], [ 0.000000e+00, %3 ]
ret double %36
}