#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 r15448 = a;
        float r15449 = c;
        float r15450 = atan2(r15448, r15449);
        float r15451 = atan2(r15450, r15448);
        float r15452 = log(r15448);
        float r15453 = r15451 - r15452;
        return r15453;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15454 = a;
        double r15455 = c;
        double r15456 = atan2(r15454, r15455);
        double r15457 = atan2(r15456, r15454);
        double r15458 = log(r15454);
        double r15459 = r15457 - r15458;
        return r15459;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15460 = a;
        float r15461 = c;
        float r15462 = atan2(r15460, r15461);
        float r15463 = atan2(r15462, r15460);
        float r15464 = cbrt(r15463);
        float r15465 = r15464 * (r15464 * r15464);
        float r15466 = log(r15460);
        float r15467 = r15465 - r15466;
        return r15467;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15468 = a;
        double r15469 = c;
        double r15470 = atan2(r15468, r15469);
        double r15471 = atan2(r15470, r15468);
        double r15472 = cbrt(r15471);
        double r15473 = r15472 * (r15472 * r15472);
        double r15474 = log(r15468);
        double r15475 = r15473 - r15474;
        return r15475;
}

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 r15476, r15477, r15478, r15479, r15480, r15481;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15476);
        mpfr_init(r15477);
        mpfr_init(r15478);
        mpfr_init(r15479);
        mpfr_init(r15480);
        mpfr_init(r15481);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15476, a, MPFR_RNDN);
        mpfr_set_d(r15477, c, MPFR_RNDN);
        mpfr_atan2(r15478, r15476, r15477, MPFR_RNDN);
        mpfr_atan2(r15479, r15478, r15476, MPFR_RNDN);
        mpfr_log(r15480, r15476, MPFR_RNDN);
        mpfr_sub(r15481, r15479, r15480, MPFR_RNDN);
        return mpfr_get_d(r15481, MPFR_RNDN);
}

static mpfr_t r15482, r15483, r15484, r15485, r15486, r15487, r15488, r15489;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15482);
        mpfr_init(r15483);
        mpfr_init(r15484);
        mpfr_init(r15485);
        mpfr_init(r15486);
        mpfr_init(r15487);
        mpfr_init(r15488);
        mpfr_init(r15489);
}

double f_fm(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_cbrt(r15486, r15485, MPFR_RNDN);
        mpfr_mul(r15487, r15486, r15486, MPFR_RNDN); mpfr_mul(r15487, r15487, r15486, MPFR_RNDN);
        mpfr_log(r15488, r15482, MPFR_RNDN);
        mpfr_sub(r15489, r15487, r15488, MPFR_RNDN);
        return mpfr_get_d(r15489, MPFR_RNDN);
}

static mpfr_t r15490, r15491, r15492, r15493, r15494, r15495, r15496, r15497;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15490);
        mpfr_init(r15491);
        mpfr_init(r15492);
        mpfr_init(r15493);
        mpfr_init(r15494);
        mpfr_init(r15495);
        mpfr_init(r15496);
        mpfr_init(r15497);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15490, a, MPFR_RNDN);
        mpfr_set_d(r15491, c, MPFR_RNDN);
        mpfr_atan2(r15492, r15490, r15491, MPFR_RNDN);
        mpfr_atan2(r15493, r15492, r15490, MPFR_RNDN);
        mpfr_cbrt(r15494, r15493, MPFR_RNDN);
        mpfr_mul(r15495, r15494, r15494, MPFR_RNDN); mpfr_mul(r15495, r15495, r15494, MPFR_RNDN);
        mpfr_log(r15496, r15490, MPFR_RNDN);
        mpfr_sub(r15497, r15495, r15496, MPFR_RNDN);
        return mpfr_get_d(r15497, MPFR_RNDN);
}

