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

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


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15493 = a;
        float r15494 = c;
        float r15495 = atan2(r15493, r15494);
        float r15496 = atan2(r15495, r15493);
        float r15497 = log(r15493);
        float r15498 = r15496 - 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 = log(r15499);
        double r15504 = r15502 - 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;

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);
}

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_log(r15515, r15511, MPFR_RNDN);
        mpfr_sub(r15516, r15514, r15515, MPFR_RNDN);
        return mpfr_get_d(r15516, MPFR_RNDN);
}

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

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

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

