#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 r15456 = a;
        float r15457 = c;
        float r15458 = atan2(r15456, r15457);
        float r15459 = atan2(r15458, r15456);
        float r15460 = log(r15456);
        float r15461 = r15459 - r15460;
        return r15461;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15462 = a;
        double r15463 = c;
        double r15464 = atan2(r15462, r15463);
        double r15465 = atan2(r15464, r15462);
        double r15466 = log(r15462);
        double r15467 = r15465 - r15466;
        return r15467;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15468 = a;
        float r15469 = c;
        float r15470 = atan2(r15468, r15469);
        float r15471 = atan2(r15470, r15468);
        float r15472 = exp(r15471);
        float r15473 = r15472 / r15468;
        float r15474 = log(r15473);
        return r15474;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15475 = a;
        double r15476 = c;
        double r15477 = atan2(r15475, r15476);
        double r15478 = atan2(r15477, r15475);
        double r15479 = exp(r15478);
        double r15480 = r15479 / r15475;
        double r15481 = log(r15480);
        return r15481;
}

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 r15482, r15483, r15484, r15485, r15486, r15487;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15482);
        mpfr_init(r15483);
        mpfr_init(r15484);
        mpfr_init(r15485);
        mpfr_init(r15486);
        mpfr_init(r15487);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15482, a, MPFR_RNDN);
        mpfr_set_d(r15483, c, MPFR_RNDN);
        mpfr_atan2(r15484, r15482, r15483, MPFR_RNDN);
        mpfr_atan2(r15485, r15484, r15482, MPFR_RNDN);
        mpfr_log(r15486, r15482, MPFR_RNDN);
        mpfr_sub(r15487, r15485, r15486, MPFR_RNDN);
        return mpfr_get_d(r15487, MPFR_RNDN);
}

static mpfr_t r15488, r15489, r15490, r15491, r15492, r15493, r15494;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15488);
        mpfr_init(r15489);
        mpfr_init(r15490);
        mpfr_init(r15491);
        mpfr_init(r15492);
        mpfr_init(r15493);
        mpfr_init(r15494);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15488, a, MPFR_RNDN);
        mpfr_set_d(r15489, c, MPFR_RNDN);
        mpfr_atan2(r15490, r15488, r15489, MPFR_RNDN);
        mpfr_atan2(r15491, r15490, r15488, MPFR_RNDN);
        mpfr_exp(r15492, r15491, MPFR_RNDN);
        mpfr_div(r15493, r15492, r15488, MPFR_RNDN);
        mpfr_log(r15494, r15493, MPFR_RNDN);
        return mpfr_get_d(r15494, MPFR_RNDN);
}

static mpfr_t r15495, r15496, r15497, r15498, r15499, r15500, r15501;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15495);
        mpfr_init(r15496);
        mpfr_init(r15497);
        mpfr_init(r15498);
        mpfr_init(r15499);
        mpfr_init(r15500);
        mpfr_init(r15501);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15495, a, MPFR_RNDN);
        mpfr_set_d(r15496, c, MPFR_RNDN);
        mpfr_atan2(r15497, r15495, r15496, MPFR_RNDN);
        mpfr_atan2(r15498, r15497, r15495, MPFR_RNDN);
        mpfr_exp(r15499, r15498, MPFR_RNDN);
        mpfr_div(r15500, r15499, r15495, MPFR_RNDN);
        mpfr_log(r15501, r15500, MPFR_RNDN);
        return mpfr_get_d(r15501, MPFR_RNDN);
}

