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

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


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15363 = a;
        float r15364 = c;
        float r15365 = atan2(r15363, r15364);
        float r15366 = atan2(r15365, r15363);
        float r15367 = exp(r15366);
        float r15368 = r15367 / r15363;
        float r15369 = log(r15368);
        return r15369;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15370 = a;
        double r15371 = c;
        double r15372 = atan2(r15370, r15371);
        double r15373 = atan2(r15372, r15370);
        double r15374 = exp(r15373);
        double r15375 = r15374 / r15370;
        double r15376 = log(r15375);
        return r15376;
}

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 r15377, r15378, r15379, r15380, r15381, r15382;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15377);
        mpfr_init(r15378);
        mpfr_init(r15379);
        mpfr_init(r15380);
        mpfr_init(r15381);
        mpfr_init(r15382);
}

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

static mpfr_t r15383, r15384, r15385, r15386, r15387, r15388, r15389;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15383);
        mpfr_init(r15384);
        mpfr_init(r15385);
        mpfr_init(r15386);
        mpfr_init(r15387);
        mpfr_init(r15388);
        mpfr_init(r15389);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15383, a, MPFR_RNDN);
        mpfr_set_d(r15384, c, MPFR_RNDN);
        mpfr_atan2(r15385, r15383, r15384, MPFR_RNDN);
        mpfr_atan2(r15386, r15385, r15383, MPFR_RNDN);
        mpfr_exp(r15387, r15386, MPFR_RNDN);
        mpfr_div(r15388, r15387, r15383, MPFR_RNDN);
        mpfr_log(r15389, r15388, MPFR_RNDN);
        return mpfr_get_d(r15389, MPFR_RNDN);
}

static mpfr_t r15390, r15391, r15392, r15393, r15394, r15395, r15396;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15390);
        mpfr_init(r15391);
        mpfr_init(r15392);
        mpfr_init(r15393);
        mpfr_init(r15394);
        mpfr_init(r15395);
        mpfr_init(r15396);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15390, a, MPFR_RNDN);
        mpfr_set_d(r15391, c, MPFR_RNDN);
        mpfr_atan2(r15392, r15390, r15391, MPFR_RNDN);
        mpfr_atan2(r15393, r15392, r15390, MPFR_RNDN);
        mpfr_exp(r15394, r15393, MPFR_RNDN);
        mpfr_div(r15395, r15394, r15390, MPFR_RNDN);
        mpfr_log(r15396, r15395, MPFR_RNDN);
        return mpfr_get_d(r15396, MPFR_RNDN);
}

