#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 r15464 = a;
        float r15465 = c;
        float r15466 = atan2(r15464, r15465);
        float r15467 = atan2(r15466, r15464);
        float r15468 = log(r15464);
        float r15469 = r15467 - r15468;
        return r15469;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15470 = a;
        double r15471 = c;
        double r15472 = atan2(r15470, r15471);
        double r15473 = atan2(r15472, r15470);
        double r15474 = log(r15470);
        double r15475 = r15473 - r15474;
        return r15475;
}


double f_of(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 = exp(r15479);
        float r15481 = r15480 / r15476;
        float r15482 = log(r15481);
        return r15482;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15483 = a;
        double r15484 = c;
        double r15485 = atan2(r15483, r15484);
        double r15486 = atan2(r15485, r15483);
        double r15487 = exp(r15486);
        double r15488 = r15487 / r15483;
        double r15489 = log(r15488);
        return r15489;
}

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 r15490, r15491, r15492, r15493, r15494, r15495;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15490);
        mpfr_init(r15491);
        mpfr_init(r15492);
        mpfr_init(r15493);
        mpfr_init(r15494);
        mpfr_init(r15495);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15490, a, MPFR_RNDN);
        mpfr_set_d(r15491, c, MPFR_RNDN);
        mpfr_atan2(r15492, r15490, r15491, MPFR_RNDN);
        mpfr_atan2(r15493, r15492, r15490, MPFR_RNDN);
        mpfr_log(r15494, r15490, MPFR_RNDN);
        mpfr_sub(r15495, r15493, r15494, MPFR_RNDN);
        return mpfr_get_d(r15495, MPFR_RNDN);
}

static mpfr_t r15496, r15497, r15498, r15499, r15500, r15501, r15502;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15496);
        mpfr_init(r15497);
        mpfr_init(r15498);
        mpfr_init(r15499);
        mpfr_init(r15500);
        mpfr_init(r15501);
        mpfr_init(r15502);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15496, a, MPFR_RNDN);
        mpfr_set_d(r15497, c, MPFR_RNDN);
        mpfr_atan2(r15498, r15496, r15497, MPFR_RNDN);
        mpfr_atan2(r15499, r15498, r15496, MPFR_RNDN);
        mpfr_exp(r15500, r15499, MPFR_RNDN);
        mpfr_div(r15501, r15500, r15496, MPFR_RNDN);
        mpfr_log(r15502, r15501, MPFR_RNDN);
        return mpfr_get_d(r15502, MPFR_RNDN);
}

static mpfr_t r15503, r15504, r15505, r15506, r15507, r15508, r15509;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15503);
        mpfr_init(r15504);
        mpfr_init(r15505);
        mpfr_init(r15506);
        mpfr_init(r15507);
        mpfr_init(r15508);
        mpfr_init(r15509);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15503, a, MPFR_RNDN);
        mpfr_set_d(r15504, c, MPFR_RNDN);
        mpfr_atan2(r15505, r15503, r15504, MPFR_RNDN);
        mpfr_atan2(r15506, r15505, r15503, MPFR_RNDN);
        mpfr_exp(r15507, r15506, MPFR_RNDN);
        mpfr_div(r15508, r15507, r15503, MPFR_RNDN);
        mpfr_log(r15509, r15508, MPFR_RNDN);
        return mpfr_get_d(r15509, MPFR_RNDN);
}

