#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 r15480 = a;
        float r15481 = c;
        float r15482 = atan2(r15480, r15481);
        float r15483 = atan2(r15482, r15480);
        float r15484 = log(r15480);
        float r15485 = r15483 - r15484;
        return r15485;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15486 = a;
        double r15487 = c;
        double r15488 = atan2(r15486, r15487);
        double r15489 = atan2(r15488, r15486);
        double r15490 = log(r15486);
        double r15491 = r15489 - r15490;
        return r15491;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15492 = a;
        float r15493 = c;
        float r15494 = atan2(r15492, r15493);
        float r15495 = atan2(r15494, r15492);
        float r15496 = exp(r15495);
        float r15497 = r15496 / r15492;
        float r15498 = log(r15497);
        return r15498;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15499 = a;
        double r15500 = c;
        double r15501 = atan2(r15499, r15500);
        double r15502 = atan2(r15501, r15499);
        double r15503 = exp(r15502);
        double r15504 = r15503 / r15499;
        double r15505 = log(r15504);
        return r15505;
}

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 r15506, r15507, r15508, r15509, r15510, r15511;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15506);
        mpfr_init(r15507);
        mpfr_init(r15508);
        mpfr_init(r15509);
        mpfr_init(r15510);
        mpfr_init(r15511);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15506, a, MPFR_RNDN);
        mpfr_set_d(r15507, c, MPFR_RNDN);
        mpfr_atan2(r15508, r15506, r15507, MPFR_RNDN);
        mpfr_atan2(r15509, r15508, r15506, MPFR_RNDN);
        mpfr_log(r15510, r15506, MPFR_RNDN);
        mpfr_sub(r15511, r15509, r15510, MPFR_RNDN);
        return mpfr_get_d(r15511, MPFR_RNDN);
}

static mpfr_t r15512, r15513, r15514, r15515, r15516, r15517, r15518;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15512);
        mpfr_init(r15513);
        mpfr_init(r15514);
        mpfr_init(r15515);
        mpfr_init(r15516);
        mpfr_init(r15517);
        mpfr_init(r15518);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15512, a, MPFR_RNDN);
        mpfr_set_d(r15513, c, MPFR_RNDN);
        mpfr_atan2(r15514, r15512, r15513, MPFR_RNDN);
        mpfr_atan2(r15515, r15514, r15512, MPFR_RNDN);
        mpfr_exp(r15516, r15515, MPFR_RNDN);
        mpfr_div(r15517, r15516, r15512, MPFR_RNDN);
        mpfr_log(r15518, r15517, MPFR_RNDN);
        return mpfr_get_d(r15518, MPFR_RNDN);
}

static mpfr_t r15519, r15520, r15521, r15522, r15523, r15524, r15525;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15519);
        mpfr_init(r15520);
        mpfr_init(r15521);
        mpfr_init(r15522);
        mpfr_init(r15523);
        mpfr_init(r15524);
        mpfr_init(r15525);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15519, a, MPFR_RNDN);
        mpfr_set_d(r15520, c, MPFR_RNDN);
        mpfr_atan2(r15521, r15519, r15520, MPFR_RNDN);
        mpfr_atan2(r15522, r15521, r15519, MPFR_RNDN);
        mpfr_exp(r15523, r15522, MPFR_RNDN);
        mpfr_div(r15524, r15523, r15519, MPFR_RNDN);
        mpfr_log(r15525, r15524, MPFR_RNDN);
        return mpfr_get_d(r15525, MPFR_RNDN);
}

