#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 r15352 = a;
        float r15353 = c;
        float r15354 = atan2(r15352, r15353);
        float r15355 = atan2(r15354, r15352);
        float r15356 = log(r15352);
        float r15357 = r15355 - r15356;
        return r15357;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15358 = a;
        double r15359 = c;
        double r15360 = atan2(r15358, r15359);
        double r15361 = atan2(r15360, r15358);
        double r15362 = log(r15358);
        double r15363 = r15361 - r15362;
        return r15363;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15364 = a;
        float r15365 = c;
        float r15366 = atan2(r15364, r15365);
        float r15367 = atan2(r15366, r15364);
        float r15368 = cbrt(r15367);
        float r15369 = r15368 * (r15368 * r15368);
        float r15370 = log(r15364);
        float r15371 = r15369 - r15370;
        return r15371;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15372 = a;
        double r15373 = c;
        double r15374 = atan2(r15372, r15373);
        double r15375 = atan2(r15374, r15372);
        double r15376 = cbrt(r15375);
        double r15377 = r15376 * (r15376 * r15376);
        double r15378 = log(r15372);
        double r15379 = r15377 - r15378;
        return r15379;
}

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 r15380, r15381, r15382, r15383, r15384, r15385;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15380);
        mpfr_init(r15381);
        mpfr_init(r15382);
        mpfr_init(r15383);
        mpfr_init(r15384);
        mpfr_init(r15385);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15380, a, MPFR_RNDN);
        mpfr_set_d(r15381, c, MPFR_RNDN);
        mpfr_atan2(r15382, r15380, r15381, MPFR_RNDN);
        mpfr_atan2(r15383, r15382, r15380, MPFR_RNDN);
        mpfr_log(r15384, r15380, MPFR_RNDN);
        mpfr_sub(r15385, r15383, r15384, MPFR_RNDN);
        return mpfr_get_d(r15385, MPFR_RNDN);
}

static mpfr_t r15386, r15387, r15388, r15389, r15390, r15391, r15392, r15393;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15386);
        mpfr_init(r15387);
        mpfr_init(r15388);
        mpfr_init(r15389);
        mpfr_init(r15390);
        mpfr_init(r15391);
        mpfr_init(r15392);
        mpfr_init(r15393);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15386, a, MPFR_RNDN);
        mpfr_set_d(r15387, c, MPFR_RNDN);
        mpfr_atan2(r15388, r15386, r15387, MPFR_RNDN);
        mpfr_atan2(r15389, r15388, r15386, MPFR_RNDN);
        mpfr_cbrt(r15390, r15389, MPFR_RNDN);
        mpfr_mul(r15391, r15390, r15390, MPFR_RNDN); mpfr_mul(r15391, r15391, r15390, MPFR_RNDN);
        mpfr_log(r15392, r15386, MPFR_RNDN);
        mpfr_sub(r15393, r15391, r15392, MPFR_RNDN);
        return mpfr_get_d(r15393, MPFR_RNDN);
}

static mpfr_t r15394, r15395, r15396, r15397, r15398, r15399, r15400, r15401;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15394);
        mpfr_init(r15395);
        mpfr_init(r15396);
        mpfr_init(r15397);
        mpfr_init(r15398);
        mpfr_init(r15399);
        mpfr_init(r15400);
        mpfr_init(r15401);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15394, a, MPFR_RNDN);
        mpfr_set_d(r15395, c, MPFR_RNDN);
        mpfr_atan2(r15396, r15394, r15395, MPFR_RNDN);
        mpfr_atan2(r15397, r15396, r15394, MPFR_RNDN);
        mpfr_cbrt(r15398, r15397, MPFR_RNDN);
        mpfr_mul(r15399, r15398, r15398, MPFR_RNDN); mpfr_mul(r15399, r15399, r15398, MPFR_RNDN);
        mpfr_log(r15400, r15394, MPFR_RNDN);
        mpfr_sub(r15401, r15399, r15400, MPFR_RNDN);
        return mpfr_get_d(r15401, MPFR_RNDN);
}

