#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double erf(double);
int /*<<< orphan*/ exit(int);
int exp(int /*<<< orphan*/);
double fabs(double);
double log(double);
int /*<<< orphan*/ pow(double, double);
int /*<<< orphan*/ printf(char *);
int sqrt(double);
double erfinv(double x) {
  double a, t, oup, num, den, xinf, sign, temp, pi;
  if (x > 0.0) {
    sign = 1.0;
  } else {
    sign = -1.0;
  }
  a = fabs(x);
  xinf = 1.79e308;
  pi = 3.1415926535897932384626434;
  if (a > 1.) {
    printf("The Input takes values between -1 and +1");
    exit(1);
  }
  if (a <= 0.75) {
    double p[5] = {4.62680202125696, -16.6805947126248, 17.6230176190819,
                   -5.4309342907266, 0.236997019142};
    double q[5] = {4.26606447606664, -17.5930726990431, 22.7331464544494,
                   -9.9016863476727, 1.000000000000};
    t = x * x - 0.75 * 0.75;
    num = p[0] + t * (p[1] + t * (p[2] + t * (p[3] + t * p[4])));
    den = q[0] + t * (q[1] + t * (q[2] + t * (q[3] + t * q[4])));
    oup = x * num / den;
  } else if (0.75 < a && a <= 0.9375) {
    double p[6] = {-0.041199817067782, 0.643729854003468, -3.28902674093993,
                   6.24518431579026,   -3.65953596495117, 0.30260114943200};
    double q[6] = {-0.029324540620124, 0.501148500527886, -2.90144687299145,
                   6.65393051963183,   -5.40640580412825, 1.0000000000000};
    t = x * x - 0.9375 * 0.9375;
    num = p[0] + t * (p[1] + t * (p[2] + t * (p[3] + t * (p[4] + t * p[5]))));
    den = q[0] + t * (q[1] + t * (q[2] + t * (q[3] + t * (q[4] + t * q[5]))));
    oup = x * num / den;
  } else if (0.9375 < a && a < 1.) {
    double p[6] = {.1550470003116,  1.382719649631, .690969348887,
                   -1.128081391617, .680544246825,  -.16444156791};
    double q[3] = {.155024849822, 1.385228141995, 1.000000000000};
    t = 1.0 / sqrt(-log(1.0 - a));
    oup = sign *
          (p[0] / t + p[1] + t * (p[2] + t * (p[3] + t * (p[4] + t * p[5])))) /
          (q[0] + t * (q[1] + t * (q[2])));
  } else {
    oup = sign * xinf;
  }
  if (a < 1.) {
    temp = (erf(oup) - x) / (2 / sqrt(pi) * exp(-pow(oup, 2.0)));
    oup -= temp / (1 + temp * oup);
  }
  return oup;
}


x86 assembly (clang, -O0):
<erfinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11b4 <erfinv+0x34>
movsd  0xe5e(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11c1 <erfinv+0x41>
movsd  0xe44(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xf53(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe3a(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe25(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe0b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    121d <erfinv+0x9d>
lea    0xf22(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
movsd  0xdfb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     13d3 <erfinv+0x253>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe6c(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xe44(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xe2c(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xe14(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xdfc(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xd2c(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x80(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm5
movsd  -0x18(%rbp),%xmm4
movsd  -0x68(%rbp),%xmm7
movsd  -0x18(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm8
mulsd  %xmm8,%xmm6
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0x18(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm3
ff
movsd  -0x18(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm5
ff
movsd  -0x18(%rbp),%xmm4
movsd  -0x98(%rbp),%xmm7
ff
movsd  -0x18(%rbp),%xmm6
movsd  -0x90(%rbp),%xmm8
ff ff
mulsd  %xmm8,%xmm6
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    17ec <erfinv+0x66c>
movsd  -0x10(%rbp),%xmm0
movsd  0xc40(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1613 <erfinv+0x493>
movsd  0xc36(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1613 <erfinv+0x493>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xca0(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xc88(%rip),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  0xc70(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xc58(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xc40(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0xc28(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xbfd(%rip),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  0xbe5(%rip),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  0xbcd(%rip),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  0xbb5(%rip),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  0xb9d(%rip),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  0xb2d(%rip),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb67(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0xe0(%rbp),%xmm1
ff
movsd  -0x18(%rbp),%xmm0
movsd  -0xd8(%rbp),%xmm3
ff
movsd  -0x18(%rbp),%xmm2
movsd  -0xd0(%rbp),%xmm5
ff
movsd  -0x18(%rbp),%xmm4
movsd  -0xc8(%rbp),%xmm7
ff
movsd  -0x18(%rbp),%xmm6
movsd  -0xc0(%rbp),%xmm9
ff ff
movsd  -0x18(%rbp),%xmm8
movsd  -0xb8(%rbp),%xmm10
ff ff
mulsd  %xmm10,%xmm8
addsd  %xmm9,%xmm8
mulsd  %xmm8,%xmm6
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x110(%rbp),%xmm1
ff
movsd  -0x18(%rbp),%xmm0
movsd  -0x108(%rbp),%xmm3
ff
movsd  -0x18(%rbp),%xmm2
movsd  -0x100(%rbp),%xmm5
ff
movsd  -0x18(%rbp),%xmm4
movsd  -0xf8(%rbp),%xmm7
ff
movsd  -0x18(%rbp),%xmm6
movsd  -0xf0(%rbp),%xmm9
ff ff
movsd  -0x18(%rbp),%xmm8
movsd  -0xe8(%rbp),%xmm10
ff ff
mulsd  %xmm10,%xmm8
addsd  %xmm9,%xmm8
mulsd  %xmm8,%xmm6
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    17e7 <erfinv+0x667>
movsd  -0x10(%rbp),%xmm0
movsd  0xa08(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17d3 <erfinv+0x653>
movsd  0x9d6(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    17d3 <erfinv+0x653>
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xa00(%rip),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  0x9e8(%rip),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  0x9d0(%rip),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  0x9b8(%rip),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  0x9a0(%rip),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  0x988(%rip),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
mov    0xaa9(%rip),%rax
mov    %rax,-0x160(%rbp)
mov    0xaa3(%rip),%rax
mov    %rax,-0x158(%rbp)
mov    0xa9d(%rip),%rax
mov    %rax,-0x150(%rbp)
movsd  0x926(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1080 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0x8f4(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x140(%rbp),%xmm2
ff
divsd  -0x18(%rbp),%xmm2
addsd  -0x138(%rbp),%xmm2
ff
movsd  -0x18(%rbp),%xmm1
movsd  -0x130(%rbp),%xmm4
ff
movsd  -0x18(%rbp),%xmm3
movsd  -0x128(%rbp),%xmm6
ff
movsd  -0x18(%rbp),%xmm5
movsd  -0x120(%rbp),%xmm8
ff ff
movsd  -0x18(%rbp),%xmm7
movsd  -0x118(%rbp),%xmm9
ff ff
mulsd  %xmm9,%xmm7
addsd  %xmm8,%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x160(%rbp),%xmm2
ff
movsd  -0x18(%rbp),%xmm1
movsd  -0x158(%rbp),%xmm4
ff
movsd  -0x18(%rbp),%xmm3
movsd  -0x150(%rbp),%xmm5
ff
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    17e2 <erfinv+0x662>
movsd  -0x40(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    17e7 <erfinv+0x667>
jmp    17ec <erfinv+0x66c>
movsd  0x814(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    189c <erfinv+0x71c>
movsd  -0x20(%rbp),%xmm0
call   1090 <erf@plt>
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1080 <sqrt@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cltd
idiv   %ecx
mov    %eax,-0x164(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0x8d3(%rip),%xmm1
call   1070 <pow@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1050 <exp@plt>
movsd  -0x170(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    -0x164(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x782(%rip),%xmm2
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfinv>:
push   %rbx
sub    $0x30,%rsp
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm3
seta   %cl
movapd 0xe82(%rip),%xmm4
andpd  %xmm3,%xmm4
ucomisd 0xe96(%rip),%xmm4
ja     147e <erfinv+0x30e>
movsd  0xe90(%rip),%xmm0
ucomisd %xmm4,%xmm0
jae    1264 <erfinv+0xf4>
ucomisd 0xe7e(%rip),%xmm4
jbe    1389 <erfinv+0x219>
movsd  0xec8(%rip),%xmm0
ucomisd %xmm4,%xmm0
jb     1389 <erfinv+0x219>
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  0xefe(%rip),%xmm0
movsd  0xefe(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xefa(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xef6(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xef2(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xeee(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xeea(%rip),%xmm2
movsd  0xeea(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee2(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xede(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeda(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed6(%rip),%xmm1
jmp    12dc <erfinv+0x16c>
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  0xdcc(%rip),%xmm0
movsd  0xdcc(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xdc8(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xdc4(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xdc0(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xdbc(%rip),%xmm2
movsd  0xdbc(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdb4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdb0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdac(%rip),%xmm1
mulsd  %xmm3,%xmm2
divsd  %xmm1,%xmm2
movsd  0xd44(%rip),%xmm0
ucomisd %xmm4,%xmm0
jbe    137f <erfinv+0x20f>
movapd %xmm2,%xmm0
movsd  %xmm2,0x8(%rsp)
movapd %xmm3,0x10(%rsp)
call   1080 <erf@plt>
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe21(%rip),%xmm0
call   1070 <sqrt@plt>
mov    %eax,%ecx
mov    $0x2,%eax
xor    %edx,%edx
idiv   %ecx
mov    %eax,%ebx
movsd  0xe0f(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1060 <pow@plt>
neg    %eax
mov    %eax,%edi
call   1040 <exp@plt>
movsd  0x8(%rsp),%xmm2
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  0xcb9(%rip),%xmm0
divsd  %xmm0,%xmm1
subsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
add    $0x30,%rsp
pop    %rbx
ret
mov    %cl,%al
lea    0xc6e(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm2
ucomisd 0xcf1(%rip),%xmm4
jbe    1471 <erfinv+0x301>
movsd  0xc83(%rip),%xmm0
ucomisd %xmm4,%xmm0
jbe    1471 <erfinv+0x301>
subsd  %xmm4,%xmm0
movsd  %xmm2,0x8(%rsp)
movapd %xmm3,0x10(%rsp)
movapd %xmm4,0x20(%rsp)
call   1050 <log@plt>
xorpd  0xc46(%rip),%xmm0
call   1070 <sqrt@plt>
movapd 0x20(%rsp),%xmm4
movapd 0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xc30(%rip),%xmm5
divsd  %xmm0,%xmm5
movsd  0xc94(%rip),%xmm0
divsd  %xmm5,%xmm0
addsd  0xc90(%rip),%xmm0
movsd  0xc90(%rip),%xmm1
mulsd  %xmm5,%xmm1
addsd  0xc8c(%rip),%xmm1
mulsd  %xmm5,%xmm1
addsd  0xc88(%rip),%xmm1
mulsd  %xmm5,%xmm1
addsd  0xc84(%rip),%xmm1
mulsd  %xmm5,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm2
movsd  0xc78(%rip),%xmm0
addsd  %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  0xc70(%rip),%xmm0
divsd  %xmm0,%xmm2
jmp    12e4 <erfinv+0x174>
mulsd  0xc1f(%rip),%xmm2
jmp    12e4 <erfinv+0x174>
lea    0xccb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"The Input takes values between -1 and +1\00"
@__const.erfinv.q = [3 x double] [double 0x3FC3D7DAB206C232, double 0x3FF629E4FBF5E0BF, double 1.000000e+00]
define double @erfinv(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca [5 x double]
%13 = alloca [5 x double]
%14 = alloca [6 x double]
%15 = alloca [6 x double]
%16 = alloca [6 x double]
%17 = alloca [3 x double]
store double %0, double* %2
%18 = load double, double* %2
%19 = fcmp ogt double %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %1
store double 1.000000e+00, double* %9
br label %22
21: ; preds = %1
store double -1.000000e+00, double* %9
br label %22
22: ; preds = %21, %20
%23 = load double, double* %2
%24 = call double @llvm.fabs.f64(double %23)
store double %24, double* %3
store double 1.790000e+308, double* %8
store double 0x400921FB54442D18, double* %11
%25 = load double, double* %3
%26 = fcmp ogt double %25, 1.000000e+00
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %22
%31 = load double, double* %3
%32 = fcmp ole double %31, 7.500000e-01
br i1 %32, label %33, label %92
33: ; preds = %30
%34 = bitcast [5 x double]* %12 to i8*
%35 = bitcast i8* %34 to [5 x double]*
%36 = getelementptr inbounds [5 x double], [5 x double]* %35, i32 0, i32 0
store double 0x401281D86399761C, double* %36
%37 = getelementptr inbounds [5 x double], [5 x double]* %35, i32 0, i32 1
store double 0xC030AE3B74808DD5, double* %37
%38 = getelementptr inbounds [5 x double], [5 x double]* %35, i32 0, i32 2
store double 0x40319F7E152AC9DE, double* %38
%39 = getelementptr inbounds [5 x double], [5 x double]* %35, i32 0, i32 3
store double 0xC015B946D6B59533, double* %39
%40 = getelementptr inbounds [5 x double], [5 x double]* %35, i32 0, i32 4
store double 0x3FCE55EB173B70AC, double* %40
%41 = bitcast [5 x double]* %13 to i8*
%42 = bitcast i8* %41 to [5 x double]*
%43 = getelementptr inbounds [5 x double], [5 x double]* %42, i32 0, i32 0
store double 0x4011107334BD559A, double* %43
%44 = getelementptr inbounds [5 x double], [5 x double]* %42, i32 0, i32 1
store double 0xC03197D39CC68A62, double* %44
%45 = getelementptr inbounds [5 x double], [5 x double]* %42, i32 0, i32 2
store double 0x4036BBAF7C6D09DD, double* %45
%46 = getelementptr inbounds [5 x double], [5 x double]* %42, i32 0, i32 3
store double 0xC023CDA9D53D0203, double* %46
%47 = getelementptr inbounds [5 x double], [5 x double]* %42, i32 0, i32 4
store double 1.000000e+00, double* %47
%48 = load double, double* %2
%49 = load double, double* %2
%50 = call double @llvm.fmuladd.f64(double %48, double %49, double -5.625000e-01)
store double %50, double* %4
%51 = getelementptr inbounds [5 x double], [5 x double]* %12, i64 0, i64 0
%52 = load double, double* %51
%53 = load double, double* %4
%54 = getelementptr inbounds [5 x double], [5 x double]* %12, i64 0, i64 1
%55 = load double, double* %54
%56 = load double, double* %4
%57 = getelementptr inbounds [5 x double], [5 x double]* %12, i64 0, i64 2
%58 = load double, double* %57
%59 = load double, double* %4
%60 = getelementptr inbounds [5 x double], [5 x double]* %12, i64 0, i64 3
%61 = load double, double* %60
%62 = load double, double* %4
%63 = getelementptr inbounds [5 x double], [5 x double]* %12, i64 0, i64 4
%64 = load double, double* %63
%65 = call double @llvm.fmuladd.f64(double %62, double %64, double %61)
%66 = call double @llvm.fmuladd.f64(double %59, double %65, double %58)
%67 = call double @llvm.fmuladd.f64(double %56, double %66, double %55)
%68 = call double @llvm.fmuladd.f64(double %53, double %67, double %52)
store double %68, double* %6
%69 = getelementptr inbounds [5 x double], [5 x double]* %13, i64 0, i64 0
%70 = load double, double* %69
%71 = load double, double* %4
%72 = getelementptr inbounds [5 x double], [5 x double]* %13, i64 0, i64 1
%73 = load double, double* %72
%74 = load double, double* %4
%75 = getelementptr inbounds [5 x double], [5 x double]* %13, i64 0, i64 2
%76 = load double, double* %75
%77 = load double, double* %4
%78 = getelementptr inbounds [5 x double], [5 x double]* %13, i64 0, i64 3
%79 = load double, double* %78
%80 = load double, double* %4
%81 = getelementptr inbounds [5 x double], [5 x double]* %13, i64 0, i64 4
%82 = load double, double* %81
%83 = call double @llvm.fmuladd.f64(double %80, double %82, double %79)
%84 = call double @llvm.fmuladd.f64(double %77, double %83, double %76)
%85 = call double @llvm.fmuladd.f64(double %74, double %84, double %73)
%86 = call double @llvm.fmuladd.f64(double %71, double %85, double %70)
store double %86, double* %7
%87 = load double, double* %2
%88 = load double, double* %6
%89 = fmul double %87, %88
%90 = load double, double* %7
%91 = fdiv double %89, %90
store double %91, double* %5
br label %232
92: ; preds = %30
%93 = load double, double* %3
%94 = fcmp olt double 7.500000e-01, %93
br i1 %94, label %95, label %167
95: ; preds = %92
%96 = load double, double* %3
%97 = fcmp ole double %96, 9.375000e-01
br i1 %97, label %98, label %167
98: ; preds = %95
%99 = bitcast [6 x double]* %14 to i8*
%100 = bitcast i8* %99 to [6 x double]*
%101 = getelementptr inbounds [6 x double], [6 x double]* %100, i32 0, i32 0
store double 0xBFA5182475D08A74, double* %101
%102 = getelementptr inbounds [6 x double], [6 x double]* %100, i32 0, i32 1
store double 0x3FE4996F59CCEB85, double* %102
%103 = getelementptr inbounds [6 x double], [6 x double]* %100, i32 0, i32 2
store double 0xC00A4FED40800D3D, double* %103
%104 = getelementptr inbounds [6 x double], [6 x double]* %100, i32 0, i32 3
store double 0x4018FB1198E73EC6, double* %104
%105 = getelementptr inbounds [6 x double], [6 x double]* %100, i32 0, i32 4
store double 0xC00D46BACAC00235, double* %105
%106 = getelementptr inbounds [6 x double], [6 x double]* %100, i32 0, i32 5
store double 0x3FD35DD13622B77C, double* %106
%107 = bitcast [6 x double]* %15 to i8*
%108 = bitcast i8* %107 to [6 x double]*
%109 = getelementptr inbounds [6 x double], [6 x double]* %108, i32 0, i32 0
store double 0xBF9E07409BBC105B, double* %109
%110 = getelementptr inbounds [6 x double], [6 x double]* %108, i32 0, i32 1
store double 0x3FE0096894869D5C, double* %110
%111 = getelementptr inbounds [6 x double], [6 x double]* %108, i32 0, i32 2
store double 0xC0073629C734A351, double* %111
%112 = getelementptr inbounds [6 x double], [6 x double]* %108, i32 0, i32 3
store double 0x401A9D9FF64EB332, double* %112
%113 = getelementptr inbounds [6 x double], [6 x double]* %108, i32 0, i32 4
store double 0xC015A028D7D68AAA, double* %113
%114 = getelementptr inbounds [6 x double], [6 x double]* %108, i32 0, i32 5
store double 1.000000e+00, double* %114
%115 = load double, double* %2
%116 = load double, double* %2
%117 = call double @llvm.fmuladd.f64(double %115, double %116, double 0xBFEC200000000000)
store double %117, double* %4
%118 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 0
%119 = load double, double* %118
%120 = load double, double* %4
%121 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 1
%122 = load double, double* %121
%123 = load double, double* %4
%124 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 2
%125 = load double, double* %124
%126 = load double, double* %4
%127 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 3
%128 = load double, double* %127
%129 = load double, double* %4
%130 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 4
%131 = load double, double* %130
%132 = load double, double* %4
%133 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 5
%134 = load double, double* %133
%135 = call double @llvm.fmuladd.f64(double %132, double %134, double %131)
%136 = call double @llvm.fmuladd.f64(double %129, double %135, double %128)
%137 = call double @llvm.fmuladd.f64(double %126, double %136, double %125)
%138 = call double @llvm.fmuladd.f64(double %123, double %137, double %122)
%139 = call double @llvm.fmuladd.f64(double %120, double %138, double %119)
store double %139, double* %6
%140 = getelementptr inbounds [6 x double], [6 x double]* %15, i64 0, i64 0
%141 = load double, double* %140
%142 = load double, double* %4
%143 = getelementptr inbounds [6 x double], [6 x double]* %15, i64 0, i64 1
%144 = load double, double* %143
%145 = load double, double* %4
%146 = getelementptr inbounds [6 x double], [6 x double]* %15, i64 0, i64 2
%147 = load double, double* %146
%148 = load double, double* %4
%149 = getelementptr inbounds [6 x double], [6 x double]* %15, i64 0, i64 3
%150 = load double, double* %149
%151 = load double, double* %4
%152 = getelementptr inbounds [6 x double], [6 x double]* %15, i64 0, i64 4
%153 = load double, double* %152
%154 = load double, double* %4
%155 = getelementptr inbounds [6 x double], [6 x double]* %15, i64 0, i64 5
%156 = load double, double* %155
%157 = call double @llvm.fmuladd.f64(double %154, double %156, double %153)
%158 = call double @llvm.fmuladd.f64(double %151, double %157, double %150)
%159 = call double @llvm.fmuladd.f64(double %148, double %158, double %147)
%160 = call double @llvm.fmuladd.f64(double %145, double %159, double %144)
%161 = call double @llvm.fmuladd.f64(double %142, double %160, double %141)
store double %161, double* %7
%162 = load double, double* %2
%163 = load double, double* %6
%164 = fmul double %162, %163
%165 = load double, double* %7
%166 = fdiv double %164, %165
store double %166, double* %5
br label %231
167: ; preds = %95, %92
%168 = load double, double* %3
%169 = fcmp olt double 9.375000e-01, %168
br i1 %169, label %170, label %226
170: ; preds = %167
%171 = load double, double* %3
%172 = fcmp olt double %171, 1.000000e+00
br i1 %172, label %173, label %226
173: ; preds = %170
%174 = bitcast [6 x double]* %16 to i8*
%175 = bitcast i8* %174 to [6 x double]*
%176 = getelementptr inbounds [6 x double], [6 x double]* %175, i32 0, i32 0
store double 0x3FC3D89481D73257, double* %176
%177 = getelementptr inbounds [6 x double], [6 x double]* %175, i32 0, i32 1
store double 0x3FF61F9EA3AB3A42, double* %177
%178 = getelementptr inbounds [6 x double], [6 x double]* %175, i32 0, i32 2
store double 0x3FE61C6BC080422F, double* %178
%179 = getelementptr inbounds [6 x double], [6 x double]* %175, i32 0, i32 3
store double 0xBFF20C9F12C389F8, double* %179
%180 = getelementptr inbounds [6 x double], [6 x double]* %175, i32 0, i32 4
store double 0x3FE5C704BA7304BA, double* %180
%181 = getelementptr inbounds [6 x double], [6 x double]* %175, i32 0, i32 5
store double 0xBFC50C6BDA236181, double* %181
%182 = bitcast [3 x double]* %17 to i8*
%183 = load double, double* %3
%184 = fsub double 1.000000e+00, %183
%185 = call double @log(double %184)
%186 = fneg double %185
%187 = call i32 @sqrt(double %186)
%188 = sitofp i32 %187 to double
%189 = fdiv double 1.000000e+00, %188
store double %189, double* %4
%190 = load double, double* %9
%191 = getelementptr inbounds [6 x double], [6 x double]* %16, i64 0, i64 0
%192 = load double, double* %191
%193 = load double, double* %4
%194 = fdiv double %192, %193
%195 = getelementptr inbounds [6 x double], [6 x double]* %16, i64 0, i64 1
%196 = load double, double* %195
%197 = fadd double %194, %196
%198 = load double, double* %4
%199 = getelementptr inbounds [6 x double], [6 x double]* %16, i64 0, i64 2
%200 = load double, double* %199
%201 = load double, double* %4
%202 = getelementptr inbounds [6 x double], [6 x double]* %16, i64 0, i64 3
%203 = load double, double* %202
%204 = load double, double* %4
%205 = getelementptr inbounds [6 x double], [6 x double]* %16, i64 0, i64 4
%206 = load double, double* %205
%207 = load double, double* %4
%208 = getelementptr inbounds [6 x double], [6 x double]* %16, i64 0, i64 5
%209 = load double, double* %208
%210 = call double @llvm.fmuladd.f64(double %207, double %209, double %206)
%211 = call double @llvm.fmuladd.f64(double %204, double %210, double %203)
%212 = call double @llvm.fmuladd.f64(double %201, double %211, double %200)
%213 = call double @llvm.fmuladd.f64(double %198, double %212, double %197)
%214 = fmul double %190, %213
%215 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 0
%216 = load double, double* %215
%217 = load double, double* %4
%218 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 1
%219 = load double, double* %218
%220 = load double, double* %4
%221 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 2
%222 = load double, double* %221
%223 = call double @llvm.fmuladd.f64(double %220, double %222, double %219)
%224 = call double @llvm.fmuladd.f64(double %217, double %223, double %216)
%225 = fdiv double %214, %224
store double %225, double* %5
br label %230
226: ; preds = %170, %167
%227 = load double, double* %9
%228 = load double, double* %8
%229 = fmul double %227, %228
store double %229, double* %5
br label %230
230: ; preds = %226, %173
br label %231
231: ; preds = %230, %98
br label %232
232: ; preds = %231, %33
%233 = load double, double* %3
%234 = fcmp olt double %233, 1.000000e+00
br i1 %234, label %235, label %257
235: ; preds = %232
%236 = load double, double* %5
%237 = call double @erf(double %236)
%238 = load double, double* %2
%239 = fsub double %237, %238
%240 = load double, double* %11
%241 = call i32 @sqrt(double %240)
%242 = sdiv i32 2, %241
%243 = load double, double* %5
%244 = call i32 @pow(double %243, double 2.000000e+00)
%245 = sub nsw i32 0, %244
%246 = call i32 @exp(i32 %245)
%247 = mul nsw i32 %242, %246
%248 = sitofp i32 %247 to double
%249 = fdiv double %239, %248
store double %249, double* %10
%250 = load double, double* %10
%251 = load double, double* %10
%252 = load double, double* %5
%253 = call double @llvm.fmuladd.f64(double %251, double %252, double 1.000000e+00)
%254 = fdiv double %250, %253
%255 = load double, double* %5
%256 = fsub double %255, %254
store double %256, double* %5
br label %257
257: ; preds = %235, %232
%258 = load double, double* %5
ret double %258
}

LLVM IR (-O2):
@.str = [41 x i8] c"The Input takes values between -1 and +1\00"
define double @erfinv(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = select i1 %2, double 1.000000e+00, double -1.000000e+00
%4 = tail call double @llvm.fabs.f64(double %0)
%5 = fcmp ogt double %4, 1.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = fcmp ugt double %4, 7.500000e-01
br i1 %10, label %23, label %11
11: ; preds = %9
%12 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -5.625000e-01)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3FCE55EB173B70AC, double 0xC015B946D6B59533)
%14 = tail call double @llvm.fmuladd.f64(double %12, double %13, double 0x40319F7E152AC9DE)
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double 0xC030AE3B74808DD5)
%16 = tail call double @llvm.fmuladd.f64(double %12, double %15, double 0x401281D86399761C)
%17 = fadd double %12, 0xC023CDA9D53D0203
%18 = tail call double @llvm.fmuladd.f64(double %12, double %17, double 0x4036BBAF7C6D09DD)
%19 = tail call double @llvm.fmuladd.f64(double %12, double %18, double 0xC03197D39CC68A62)
%20 = tail call double @llvm.fmuladd.f64(double %12, double %19, double 0x4011107334BD559A)
%21 = fmul double %16, %0
%22 = fdiv double %21, %20
br label %64
23: ; preds = %9
%24 = fcmp ogt double %4, 7.500000e-01
%25 = fcmp ole double %4, 9.375000e-01
%26 = and i1 %24, %25
br i1 %26, label %27, label %41
27: ; preds = %23
%28 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 0xBFEC200000000000)
%29 = tail call double @llvm.fmuladd.f64(double %28, double 0x3FD35DD13622B77C, double 0xC00D46BACAC00235)
%30 = tail call double @llvm.fmuladd.f64(double %28, double %29, double 0x4018FB1198E73EC6)
%31 = tail call double @llvm.fmuladd.f64(double %28, double %30, double 0xC00A4FED40800D3D)
%32 = tail call double @llvm.fmuladd.f64(double %28, double %31, double 0x3FE4996F59CCEB85)
%33 = tail call double @llvm.fmuladd.f64(double %28, double %32, double 0xBFA5182475D08A74)
%34 = fadd double %28, 0xC015A028D7D68AAA
%35 = tail call double @llvm.fmuladd.f64(double %28, double %34, double 0x401A9D9FF64EB332)
%36 = tail call double @llvm.fmuladd.f64(double %28, double %35, double 0xC0073629C734A351)
%37 = tail call double @llvm.fmuladd.f64(double %28, double %36, double 0x3FE0096894869D5C)
%38 = tail call double @llvm.fmuladd.f64(double %28, double %37, double 0xBF9E07409BBC105B)
%39 = fmul double %33, %0
%40 = fdiv double %39, %38
br label %64
41: ; preds = %23
%42 = fcmp ogt double %4, 9.375000e-01
%43 = fcmp olt double %4, 1.000000e+00
%44 = and i1 %42, %43
br i1 %44, label %45, label %62
45: ; preds = %41
%46 = fsub double 1.000000e+00, %4
%47 = tail call double @log(double %46)
%48 = fneg double %47
%49 = tail call i32 @sqrt(double %48)
%50 = sitofp i32 %49 to double
%51 = fdiv double 1.000000e+00, %50
%52 = fdiv double 0x3FC3D89481D73257, %51
%53 = fadd double %52, 0x3FF61F9EA3AB3A42
%54 = tail call double @llvm.fmuladd.f64(double %51, double 0xBFC50C6BDA236181, double 0x3FE5C704BA7304BA)
%55 = tail call double @llvm.fmuladd.f64(double %51, double %54, double 0xBFF20C9F12C389F8)
%56 = tail call double @llvm.fmuladd.f64(double %51, double %55, double 0x3FE61C6BC080422F)
%57 = tail call double @llvm.fmuladd.f64(double %51, double %56, double %53)
%58 = fmul double %3, %57
%59 = fadd double %51, 0x3FF629E4FBF5E0BF
%60 = tail call double @llvm.fmuladd.f64(double %51, double %59, double 0x3FC3D7DAB206C232)
%61 = fdiv double %58, %60
br label %64
62: ; preds = %41
%63 = fmul double %3, 1.790000e+308
br label %64
64: ; preds = %27, %62, %45, %11
%65 = phi double [ %22, %11 ], [ %40, %27 ], [ %61, %45 ], [ %63, %62 ]
%66 = fcmp olt double %4, 1.000000e+00
br i1 %66, label %67, label %81
67: ; preds = %64
%68 = tail call double @erf(double %65)
%69 = fsub double %68, %0
%70 = tail call i32 @sqrt(double 0x400921FB54442D18)
%71 = sdiv i32 2, %70
%72 = tail call i32 @pow(double %65, double 2.000000e+00)
%73 = sub nsw i32 0, %72
%74 = tail call i32 @exp(i32 %73)
%75 = mul nsw i32 %74, %71
%76 = sitofp i32 %75 to double
%77 = fdiv double %69, %76
%78 = tail call double @llvm.fmuladd.f64(double %77, double %65, double 1.000000e+00)
%79 = fdiv double %77, %78
%80 = fsub double %65, %79
br label %81
81: ; preds = %67, %64
%82 = phi double [ %80, %67 ], [ %65, %64 ]
ret double %82
}