#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 r15472 = a;
        float r15473 = c;
        float r15474 = atan2(r15472, r15473);
        float r15475 = atan2(r15474, r15472);
        float r15476 = log(r15472);
        float r15477 = r15475 - r15476;
        return r15477;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15478 = a;
        double r15479 = c;
        double r15480 = atan2(r15478, r15479);
        double r15481 = atan2(r15480, r15478);
        double r15482 = log(r15478);
        double r15483 = r15481 - r15482;
        return r15483;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15484 = a;
        float r15485 = c;
        float r15486 = atan2(r15484, r15485);
        float r15487 = atan2(r15486, r15484);
        float r15488 = exp(r15487);
        float r15489 = r15488 / r15484;
        float r15490 = log(r15489);
        return r15490;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15491 = a;
        double r15492 = c;
        double r15493 = atan2(r15491, r15492);
        double r15494 = atan2(r15493, r15491);
        double r15495 = exp(r15494);
        double r15496 = r15495 / r15491;
        double r15497 = log(r15496);
        return r15497;
}

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 r15498, r15499, r15500, r15501, r15502, r15503;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15498);
        mpfr_init(r15499);
        mpfr_init(r15500);
        mpfr_init(r15501);
        mpfr_init(r15502);
        mpfr_init(r15503);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15498, a, MPFR_RNDN);
        mpfr_set_d(r15499, c, MPFR_RNDN);
        mpfr_atan2(r15500, r15498, r15499, MPFR_RNDN);
        mpfr_atan2(r15501, r15500, r15498, MPFR_RNDN);
        mpfr_log(r15502, r15498, MPFR_RNDN);
        mpfr_sub(r15503, r15501, r15502, MPFR_RNDN);
        return mpfr_get_d(r15503, MPFR_RNDN);
}

static mpfr_t r15504, r15505, r15506, r15507, r15508, r15509, r15510;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15504);
        mpfr_init(r15505);
        mpfr_init(r15506);
        mpfr_init(r15507);
        mpfr_init(r15508);
        mpfr_init(r15509);
        mpfr_init(r15510);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15504, a, MPFR_RNDN);
        mpfr_set_d(r15505, c, MPFR_RNDN);
        mpfr_atan2(r15506, r15504, r15505, MPFR_RNDN);
        mpfr_atan2(r15507, r15506, r15504, MPFR_RNDN);
        mpfr_exp(r15508, r15507, MPFR_RNDN);
        mpfr_div(r15509, r15508, r15504, MPFR_RNDN);
        mpfr_log(r15510, r15509, MPFR_RNDN);
        return mpfr_get_d(r15510, MPFR_RNDN);
}

static mpfr_t r15511, r15512, r15513, r15514, r15515, r15516, r15517;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15511);
        mpfr_init(r15512);
        mpfr_init(r15513);
        mpfr_init(r15514);
        mpfr_init(r15515);
        mpfr_init(r15516);
        mpfr_init(r15517);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15511, a, MPFR_RNDN);
        mpfr_set_d(r15512, c, MPFR_RNDN);
        mpfr_atan2(r15513, r15511, r15512, MPFR_RNDN);
        mpfr_atan2(r15514, r15513, r15511, MPFR_RNDN);
        mpfr_exp(r15515, r15514, MPFR_RNDN);
        mpfr_div(r15516, r15515, r15511, MPFR_RNDN);
        mpfr_log(r15517, r15516, MPFR_RNDN);
        return mpfr_get_d(r15517, MPFR_RNDN);
}

