#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "(- (atan2 (atan2 a c) a) (log a))";

double f_if(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15428 = a;
        float r15429 = c;
        float r15430 = atan2(r15428, r15429);
        float r15431 = atan2(r15430, r15428);
        float r15432 = log(r15428);
        float r15433 = r15431 - r15432;
        return r15433;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15434 = a;
        double r15435 = c;
        double r15436 = atan2(r15434, r15435);
        double r15437 = atan2(r15436, r15434);
        double r15438 = log(r15434);
        double r15439 = r15437 - r15438;
        return r15439;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15440 = a;
        float r15441 = c;
        float r15442 = atan2(r15440, r15441);
        float r15443 = atan2(r15442, r15440);
        float r15444 = exp(r15443);
        float r15445 = r15444 / r15440;
        float r15446 = log(r15445);
        return r15446;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15447 = a;
        double r15448 = c;
        double r15449 = atan2(r15447, r15448);
        double r15450 = atan2(r15449, r15447);
        double r15451 = exp(r15450);
        double r15452 = r15451 / r15447;
        double r15453 = log(r15452);
        return r15453;
}

void mpfr_fmod2(mpfr_t r, mpfr_t n, mpfr_t d, mpfr_rnd_t rmd) {
        mpfr_fmod(r, n, d, rmd);
        if (mpfr_cmp_ui(r, 0) < 0) mpfr_add(r, r, d, rmd);
}


static mpfr_t r15454, r15455, r15456, r15457, r15458, r15459;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15454);
        mpfr_init(r15455);
        mpfr_init(r15456);
        mpfr_init(r15457);
        mpfr_init(r15458);
        mpfr_init(r15459);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15454, a, MPFR_RNDN);
        mpfr_set_d(r15455, c, MPFR_RNDN);
        mpfr_atan2(r15456, r15454, r15455, MPFR_RNDN);
        mpfr_atan2(r15457, r15456, r15454, MPFR_RNDN);
        mpfr_log(r15458, r15454, MPFR_RNDN);
        mpfr_sub(r15459, r15457, r15458, MPFR_RNDN);
        return mpfr_get_d(r15459, MPFR_RNDN);
}

static mpfr_t r15460, r15461, r15462, r15463, r15464, r15465, r15466;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15460);
        mpfr_init(r15461);
        mpfr_init(r15462);
        mpfr_init(r15463);
        mpfr_init(r15464);
        mpfr_init(r15465);
        mpfr_init(r15466);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15460, a, MPFR_RNDN);
        mpfr_set_d(r15461, c, MPFR_RNDN);
        mpfr_atan2(r15462, r15460, r15461, MPFR_RNDN);
        mpfr_atan2(r15463, r15462, r15460, MPFR_RNDN);
        mpfr_exp(r15464, r15463, MPFR_RNDN);
        mpfr_div(r15465, r15464, r15460, MPFR_RNDN);
        mpfr_log(r15466, r15465, MPFR_RNDN);
        return mpfr_get_d(r15466, MPFR_RNDN);
}

static mpfr_t r15467, r15468, r15469, r15470, r15471, r15472, r15473;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15467);
        mpfr_init(r15468);
        mpfr_init(r15469);
        mpfr_init(r15470);
        mpfr_init(r15471);
        mpfr_init(r15472);
        mpfr_init(r15473);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15467, a, MPFR_RNDN);
        mpfr_set_d(r15468, c, MPFR_RNDN);
        mpfr_atan2(r15469, r15467, r15468, MPFR_RNDN);
        mpfr_atan2(r15470, r15469, r15467, MPFR_RNDN);
        mpfr_exp(r15471, r15470, MPFR_RNDN);
        mpfr_div(r15472, r15471, r15467, MPFR_RNDN);
        mpfr_log(r15473, r15472, MPFR_RNDN);
        return mpfr_get_d(r15473, MPFR_RNDN);
}

