#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 r15468 = a;
        float r15469 = c;
        float r15470 = atan2(r15468, r15469);
        float r15471 = atan2(r15470, r15468);
        float r15472 = log(r15468);
        float r15473 = r15471 - r15472;
        return r15473;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15474 = a;
        double r15475 = c;
        double r15476 = atan2(r15474, r15475);
        double r15477 = atan2(r15476, r15474);
        double r15478 = log(r15474);
        double r15479 = r15477 - r15478;
        return r15479;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15480 = a;
        float r15481 = c;
        float r15482 = atan2(r15480, r15481);
        float r15483 = atan2(r15482, r15480);
        float r15484 = exp(r15483);
        float r15485 = r15484 / r15480;
        float r15486 = log(r15485);
        return r15486;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15487 = a;
        double r15488 = c;
        double r15489 = atan2(r15487, r15488);
        double r15490 = atan2(r15489, r15487);
        double r15491 = exp(r15490);
        double r15492 = r15491 / r15487;
        double r15493 = log(r15492);
        return r15493;
}

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 r15494, r15495, r15496, r15497, r15498, r15499;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15494);
        mpfr_init(r15495);
        mpfr_init(r15496);
        mpfr_init(r15497);
        mpfr_init(r15498);
        mpfr_init(r15499);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15494, a, MPFR_RNDN);
        mpfr_set_d(r15495, c, MPFR_RNDN);
        mpfr_atan2(r15496, r15494, r15495, MPFR_RNDN);
        mpfr_atan2(r15497, r15496, r15494, MPFR_RNDN);
        mpfr_log(r15498, r15494, MPFR_RNDN);
        mpfr_sub(r15499, r15497, r15498, MPFR_RNDN);
        return mpfr_get_d(r15499, MPFR_RNDN);
}

static mpfr_t r15500, r15501, r15502, r15503, r15504, r15505, r15506;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15500);
        mpfr_init(r15501);
        mpfr_init(r15502);
        mpfr_init(r15503);
        mpfr_init(r15504);
        mpfr_init(r15505);
        mpfr_init(r15506);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15500, a, MPFR_RNDN);
        mpfr_set_d(r15501, c, MPFR_RNDN);
        mpfr_atan2(r15502, r15500, r15501, MPFR_RNDN);
        mpfr_atan2(r15503, r15502, r15500, MPFR_RNDN);
        mpfr_exp(r15504, r15503, MPFR_RNDN);
        mpfr_div(r15505, r15504, r15500, MPFR_RNDN);
        mpfr_log(r15506, r15505, MPFR_RNDN);
        return mpfr_get_d(r15506, MPFR_RNDN);
}

static mpfr_t r15507, r15508, r15509, r15510, r15511, r15512, r15513;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15507);
        mpfr_init(r15508);
        mpfr_init(r15509);
        mpfr_init(r15510);
        mpfr_init(r15511);
        mpfr_init(r15512);
        mpfr_init(r15513);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15507, a, MPFR_RNDN);
        mpfr_set_d(r15508, c, MPFR_RNDN);
        mpfr_atan2(r15509, r15507, r15508, MPFR_RNDN);
        mpfr_atan2(r15510, r15509, r15507, MPFR_RNDN);
        mpfr_exp(r15511, r15510, MPFR_RNDN);
        mpfr_div(r15512, r15511, r15507, MPFR_RNDN);
        mpfr_log(r15513, r15512, MPFR_RNDN);
        return mpfr_get_d(r15513, MPFR_RNDN);
}

