#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 r15488 = a;
        float r15489 = c;
        float r15490 = atan2(r15488, r15489);
        float r15491 = atan2(r15490, r15488);
        float r15492 = log(r15488);
        float r15493 = r15491 - r15492;
        return r15493;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15494 = a;
        double r15495 = c;
        double r15496 = atan2(r15494, r15495);
        double r15497 = atan2(r15496, r15494);
        double r15498 = log(r15494);
        double r15499 = r15497 - r15498;
        return r15499;
}


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

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15507 = a;
        double r15508 = c;
        double r15509 = atan2(r15507, r15508);
        double r15510 = atan2(r15509, r15507);
        double r15511 = exp(r15510);
        double r15512 = r15511 / r15507;
        double r15513 = log(r15512);
        return r15513;
}

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 r15514, r15515, r15516, r15517, r15518, r15519;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15514);
        mpfr_init(r15515);
        mpfr_init(r15516);
        mpfr_init(r15517);
        mpfr_init(r15518);
        mpfr_init(r15519);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15514, a, MPFR_RNDN);
        mpfr_set_d(r15515, c, MPFR_RNDN);
        mpfr_atan2(r15516, r15514, r15515, MPFR_RNDN);
        mpfr_atan2(r15517, r15516, r15514, MPFR_RNDN);
        mpfr_log(r15518, r15514, MPFR_RNDN);
        mpfr_sub(r15519, r15517, r15518, MPFR_RNDN);
        return mpfr_get_d(r15519, MPFR_RNDN);
}

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

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15520);
        mpfr_init(r15521);
        mpfr_init(r15522);
        mpfr_init(r15523);
        mpfr_init(r15524);
        mpfr_init(r15525);
        mpfr_init(r15526);
}

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

static mpfr_t r15527, r15528, r15529, r15530, r15531, r15532, r15533;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15527);
        mpfr_init(r15528);
        mpfr_init(r15529);
        mpfr_init(r15530);
        mpfr_init(r15531);
        mpfr_init(r15532);
        mpfr_init(r15533);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15527, a, MPFR_RNDN);
        mpfr_set_d(r15528, c, MPFR_RNDN);
        mpfr_atan2(r15529, r15527, r15528, MPFR_RNDN);
        mpfr_atan2(r15530, r15529, r15527, MPFR_RNDN);
        mpfr_exp(r15531, r15530, MPFR_RNDN);
        mpfr_div(r15532, r15531, r15527, MPFR_RNDN);
        mpfr_log(r15533, r15532, MPFR_RNDN);
        return mpfr_get_d(r15533, MPFR_RNDN);
}

