#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 r15461 = a;
        float r15462 = c;
        float r15463 = atan2(r15461, r15462);
        float r15464 = atan2(r15463, r15461);
        float r15465 = log(r15461);
        float r15466 = r15464 - r15465;
        return r15466;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15467 = a;
        double r15468 = c;
        double r15469 = atan2(r15467, r15468);
        double r15470 = atan2(r15469, r15467);
        double r15471 = log(r15467);
        double r15472 = r15470 - r15471;
        return r15472;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15473 = a;
        float r15474 = c;
        float r15475 = atan2(r15473, r15474);
        float r15476 = atan2(r15475, r15473);
        float r15477 = exp(r15476);
        float r15478 = r15477 / r15473;
        float r15479 = log(r15478);
        return r15479;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15480 = a;
        double r15481 = c;
        double r15482 = atan2(r15480, r15481);
        double r15483 = atan2(r15482, r15480);
        double r15484 = exp(r15483);
        double r15485 = r15484 / r15480;
        double r15486 = log(r15485);
        return r15486;
}

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 r15487, r15488, r15489, r15490, r15491, r15492;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15487);
        mpfr_init(r15488);
        mpfr_init(r15489);
        mpfr_init(r15490);
        mpfr_init(r15491);
        mpfr_init(r15492);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15487, a, MPFR_RNDN);
        mpfr_set_d(r15488, c, MPFR_RNDN);
        mpfr_atan2(r15489, r15487, r15488, MPFR_RNDN);
        mpfr_atan2(r15490, r15489, r15487, MPFR_RNDN);
        mpfr_log(r15491, r15487, MPFR_RNDN);
        mpfr_sub(r15492, r15490, r15491, MPFR_RNDN);
        return mpfr_get_d(r15492, MPFR_RNDN);
}

static mpfr_t r15493, r15494, r15495, r15496, r15497, r15498, r15499;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15493);
        mpfr_init(r15494);
        mpfr_init(r15495);
        mpfr_init(r15496);
        mpfr_init(r15497);
        mpfr_init(r15498);
        mpfr_init(r15499);
}

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

static mpfr_t r15500, r15501, r15502, r15503, r15504, r15505, r15506;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15500);
        mpfr_init(r15501);
        mpfr_init(r15502);
        mpfr_init(r15503);
        mpfr_init(r15504);
        mpfr_init(r15505);
        mpfr_init(r15506);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15500, a, MPFR_RNDN);
        mpfr_set_d(r15501, c, MPFR_RNDN);
        mpfr_atan2(r15502, r15500, r15501, MPFR_RNDN);
        mpfr_atan2(r15503, r15502, r15500, MPFR_RNDN);
        mpfr_exp(r15504, r15503, MPFR_RNDN);
        mpfr_div(r15505, r15504, r15500, MPFR_RNDN);
        mpfr_log(r15506, r15505, MPFR_RNDN);
        return mpfr_get_d(r15506, MPFR_RNDN);
}

