#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 r15484 = a;
        float r15485 = c;
        float r15486 = atan2(r15484, r15485);
        float r15487 = atan2(r15486, r15484);
        float r15488 = log(r15484);
        float r15489 = r15487 - r15488;
        return r15489;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15490 = a;
        double r15491 = c;
        double r15492 = atan2(r15490, r15491);
        double r15493 = atan2(r15492, r15490);
        double r15494 = log(r15490);
        double r15495 = r15493 - r15494;
        return r15495;
}


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

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15503 = a;
        double r15504 = c;
        double r15505 = atan2(r15503, r15504);
        double r15506 = atan2(r15505, r15503);
        double r15507 = exp(r15506);
        double r15508 = r15507 / r15503;
        double r15509 = log(r15508);
        return r15509;
}

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 r15510, r15511, r15512, r15513, r15514, r15515;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15510);
        mpfr_init(r15511);
        mpfr_init(r15512);
        mpfr_init(r15513);
        mpfr_init(r15514);
        mpfr_init(r15515);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15510, a, MPFR_RNDN);
        mpfr_set_d(r15511, c, MPFR_RNDN);
        mpfr_atan2(r15512, r15510, r15511, MPFR_RNDN);
        mpfr_atan2(r15513, r15512, r15510, MPFR_RNDN);
        mpfr_log(r15514, r15510, MPFR_RNDN);
        mpfr_sub(r15515, r15513, r15514, MPFR_RNDN);
        return mpfr_get_d(r15515, MPFR_RNDN);
}

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

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15516);
        mpfr_init(r15517);
        mpfr_init(r15518);
        mpfr_init(r15519);
        mpfr_init(r15520);
        mpfr_init(r15521);
        mpfr_init(r15522);
}

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

static mpfr_t r15523, r15524, r15525, r15526, r15527, r15528, r15529;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15523);
        mpfr_init(r15524);
        mpfr_init(r15525);
        mpfr_init(r15526);
        mpfr_init(r15527);
        mpfr_init(r15528);
        mpfr_init(r15529);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15523, a, MPFR_RNDN);
        mpfr_set_d(r15524, c, MPFR_RNDN);
        mpfr_atan2(r15525, r15523, r15524, MPFR_RNDN);
        mpfr_atan2(r15526, r15525, r15523, MPFR_RNDN);
        mpfr_exp(r15527, r15526, MPFR_RNDN);
        mpfr_div(r15528, r15527, r15523, MPFR_RNDN);
        mpfr_log(r15529, r15528, MPFR_RNDN);
        return mpfr_get_d(r15529, MPFR_RNDN);
}

