#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 r15476 = a;
        float r15477 = c;
        float r15478 = atan2(r15476, r15477);
        float r15479 = atan2(r15478, r15476);
        float r15480 = log(r15476);
        float r15481 = r15479 - r15480;
        return r15481;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15482 = a;
        double r15483 = c;
        double r15484 = atan2(r15482, r15483);
        double r15485 = atan2(r15484, r15482);
        double r15486 = log(r15482);
        double r15487 = r15485 - r15486;
        return r15487;
}


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

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15495 = a;
        double r15496 = c;
        double r15497 = atan2(r15495, r15496);
        double r15498 = atan2(r15497, r15495);
        double r15499 = exp(r15498);
        double r15500 = r15499 / r15495;
        double r15501 = log(r15500);
        return r15501;
}

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 r15502, r15503, r15504, r15505, r15506, r15507;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15502);
        mpfr_init(r15503);
        mpfr_init(r15504);
        mpfr_init(r15505);
        mpfr_init(r15506);
        mpfr_init(r15507);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15502, a, MPFR_RNDN);
        mpfr_set_d(r15503, c, MPFR_RNDN);
        mpfr_atan2(r15504, r15502, r15503, MPFR_RNDN);
        mpfr_atan2(r15505, r15504, r15502, MPFR_RNDN);
        mpfr_log(r15506, r15502, MPFR_RNDN);
        mpfr_sub(r15507, r15505, r15506, MPFR_RNDN);
        return mpfr_get_d(r15507, MPFR_RNDN);
}

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

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15508);
        mpfr_init(r15509);
        mpfr_init(r15510);
        mpfr_init(r15511);
        mpfr_init(r15512);
        mpfr_init(r15513);
        mpfr_init(r15514);
}

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

static mpfr_t r15515, r15516, r15517, r15518, r15519, r15520, r15521;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15515);
        mpfr_init(r15516);
        mpfr_init(r15517);
        mpfr_init(r15518);
        mpfr_init(r15519);
        mpfr_init(r15520);
        mpfr_init(r15521);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15515, a, MPFR_RNDN);
        mpfr_set_d(r15516, c, MPFR_RNDN);
        mpfr_atan2(r15517, r15515, r15516, MPFR_RNDN);
        mpfr_atan2(r15518, r15517, r15515, MPFR_RNDN);
        mpfr_exp(r15519, r15518, MPFR_RNDN);
        mpfr_div(r15520, r15519, r15515, MPFR_RNDN);
        mpfr_log(r15521, r15520, MPFR_RNDN);
        return mpfr_get_d(r15521, MPFR_RNDN);
}

