/*
    Copied from the C99 standard
 */
#include <math.h>
#include <complex.h>
/* Divide z / w ... */
long double complex _stdcall __CPLXDIVLIM(long double complex z, long double complex w)
{
    #pragma STDC FP_CONTRACT OFF
    long double a, b, c, d, denom, x, y;
    a = creall(z); b = cimagl(z);
    c = creall(w); d = cimagl(w);
    denom = c * c + d * d;
    x = (a * c + b * d) / denom;
    y = (b * c - a * d) / denom;
    return x + I * y;
}
