#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 r15501 = a;
        float r15502 = c;
        float r15503 = atan2(r15501, r15502);
        float r15504 = atan2(r15503, r15501);
        float r15505 = log(r15501);
        float r15506 = r15504 - r15505;
        return r15506;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15507 = a;
        double r15508 = c;
        double r15509 = atan2(r15507, r15508);
        double r15510 = atan2(r15509, r15507);
        double r15511 = log(r15507);
        double r15512 = r15510 - r15511;
        return r15512;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15513 = a;
        float r15514 = c;
        float r15515 = atan2(r15513, r15514);
        float r15516 = atan2(r15515, r15513);
        float r15517 = exp(r15516);
        float r15518 = r15517 / r15513;
        float r15519 = log(r15518);
        return r15519;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15520 = a;
        double r15521 = c;
        double r15522 = atan2(r15520, r15521);
        double r15523 = atan2(r15522, r15520);
        double r15524 = exp(r15523);
        double r15525 = r15524 / r15520;
        double r15526 = log(r15525);
        return r15526;
}

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 r15527, r15528, r15529, r15530, r15531, r15532;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15527);
        mpfr_init(r15528);
        mpfr_init(r15529);
        mpfr_init(r15530);
        mpfr_init(r15531);
        mpfr_init(r15532);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15527, a, MPFR_RNDN);
        mpfr_set_d(r15528, c, MPFR_RNDN);
        mpfr_atan2(r15529, r15527, r15528, MPFR_RNDN);
        mpfr_atan2(r15530, r15529, r15527, MPFR_RNDN);
        mpfr_log(r15531, r15527, MPFR_RNDN);
        mpfr_sub(r15532, r15530, r15531, MPFR_RNDN);
        return mpfr_get_d(r15532, MPFR_RNDN);
}

static mpfr_t r15533, r15534, r15535, r15536, r15537, r15538, r15539;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15533);
        mpfr_init(r15534);
        mpfr_init(r15535);
        mpfr_init(r15536);
        mpfr_init(r15537);
        mpfr_init(r15538);
        mpfr_init(r15539);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15533, a, MPFR_RNDN);
        mpfr_set_d(r15534, c, MPFR_RNDN);
        mpfr_atan2(r15535, r15533, r15534, MPFR_RNDN);
        mpfr_atan2(r15536, r15535, r15533, MPFR_RNDN);
        mpfr_exp(r15537, r15536, MPFR_RNDN);
        mpfr_div(r15538, r15537, r15533, MPFR_RNDN);
        mpfr_log(r15539, r15538, MPFR_RNDN);
        return mpfr_get_d(r15539, MPFR_RNDN);
}

static mpfr_t r15540, r15541, r15542, r15543, r15544, r15545, r15546;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15540);
        mpfr_init(r15541);
        mpfr_init(r15542);
        mpfr_init(r15543);
        mpfr_init(r15544);
        mpfr_init(r15545);
        mpfr_init(r15546);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15540, a, MPFR_RNDN);
        mpfr_set_d(r15541, c, MPFR_RNDN);
        mpfr_atan2(r15542, r15540, r15541, MPFR_RNDN);
        mpfr_atan2(r15543, r15542, r15540, MPFR_RNDN);
        mpfr_exp(r15544, r15543, MPFR_RNDN);
        mpfr_div(r15545, r15544, r15540, MPFR_RNDN);
        mpfr_log(r15546, r15545, MPFR_RNDN);
        return mpfr_get_d(r15546, MPFR_RNDN);
}

