#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 r15324 = a;
        float r15325 = c;
        float r15326 = atan2(r15324, r15325);
        float r15327 = atan2(r15326, r15324);
        float r15328 = log(r15324);
        float r15329 = r15327 - r15328;
        return r15329;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15330 = a;
        double r15331 = c;
        double r15332 = atan2(r15330, r15331);
        double r15333 = atan2(r15332, r15330);
        double r15334 = log(r15330);
        double r15335 = r15333 - r15334;
        return r15335;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15336 = a;
        float r15337 = c;
        float r15338 = atan2(r15336, r15337);
        float r15339 = atan2(r15338, r15336);
        float r15340 = log(r15336);
        float r15341 = r15339 - r15340;
        return r15341;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15342 = a;
        double r15343 = c;
        double r15344 = atan2(r15342, r15343);
        double r15345 = atan2(r15344, r15342);
        double r15346 = log(r15342);
        double r15347 = r15345 - r15346;
        return r15347;
}

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 r15348, r15349, r15350, r15351, r15352, r15353;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15348);
        mpfr_init(r15349);
        mpfr_init(r15350);
        mpfr_init(r15351);
        mpfr_init(r15352);
        mpfr_init(r15353);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15348, a, MPFR_RNDN);
        mpfr_set_d(r15349, c, MPFR_RNDN);
        mpfr_atan2(r15350, r15348, r15349, MPFR_RNDN);
        mpfr_atan2(r15351, r15350, r15348, MPFR_RNDN);
        mpfr_log(r15352, r15348, MPFR_RNDN);
        mpfr_sub(r15353, r15351, r15352, MPFR_RNDN);
        return mpfr_get_d(r15353, MPFR_RNDN);
}

static mpfr_t r15354, r15355, r15356, r15357, r15358, r15359;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15354);
        mpfr_init(r15355);
        mpfr_init(r15356);
        mpfr_init(r15357);
        mpfr_init(r15358);
        mpfr_init(r15359);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15354, a, MPFR_RNDN);
        mpfr_set_d(r15355, c, MPFR_RNDN);
        mpfr_atan2(r15356, r15354, r15355, MPFR_RNDN);
        mpfr_atan2(r15357, r15356, r15354, MPFR_RNDN);
        mpfr_log(r15358, r15354, MPFR_RNDN);
        mpfr_sub(r15359, r15357, r15358, MPFR_RNDN);
        return mpfr_get_d(r15359, MPFR_RNDN);
}

static mpfr_t r15360, r15361, r15362, r15363, r15364, r15365;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15360);
        mpfr_init(r15361);
        mpfr_init(r15362);
        mpfr_init(r15363);
        mpfr_init(r15364);
        mpfr_init(r15365);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15360, a, MPFR_RNDN);
        mpfr_set_d(r15361, c, MPFR_RNDN);
        mpfr_atan2(r15362, r15360, r15361, MPFR_RNDN);
        mpfr_atan2(r15363, r15362, r15360, MPFR_RNDN);
        mpfr_log(r15364, r15360, MPFR_RNDN);
        mpfr_sub(r15365, r15363, r15364, MPFR_RNDN);
        return mpfr_get_d(r15365, MPFR_RNDN);
}

