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

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


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

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

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

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

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

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

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

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

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

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

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

