#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "(* (+ (log d) (fabs c)) (tan d))";

double f_if(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15503 = d;
        float r15504 = log(r15503);
        float r15505 = c;
        float r15506 = fabs(r15505);
        float r15507 = r15504 + r15506;
        float r15508 = tan(r15503);
        float r15509 = r15507 * r15508;
        return r15509;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15510 = d;
        double r15511 = log(r15510);
        double r15512 = c;
        double r15513 = fabs(r15512);
        double r15514 = r15511 + r15513;
        double r15515 = tan(r15510);
        double r15516 = r15514 * r15515;
        return r15516;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15517 = d;
        float r15518 = log(r15517);
        float r15519 = c;
        float r15520 = fabs(r15519);
        float r15521 = r15518 + r15520;
        float r15522 = tan(r15517);
        float r15523 = r15521 * r15522;
        return r15523;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15524 = d;
        double r15525 = log(r15524);
        double r15526 = c;
        double r15527 = fabs(r15526);
        double r15528 = r15525 + r15527;
        double r15529 = tan(r15524);
        double r15530 = r15528 * r15529;
        return r15530;
}

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 r15531, r15532, r15533, r15534, r15535, r15536, r15537;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15531);
        mpfr_init(r15532);
        mpfr_init(r15533);
        mpfr_init(r15534);
        mpfr_init(r15535);
        mpfr_init(r15536);
        mpfr_init(r15537);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15531, d, MPFR_RNDN);
        mpfr_log(r15532, r15531, MPFR_RNDN);
        mpfr_set_d(r15533, c, MPFR_RNDN);
        mpfr_abs(r15534, r15533, MPFR_RNDN);
        mpfr_add(r15535, r15532, r15534, MPFR_RNDN);
        mpfr_tan(r15536, r15531, MPFR_RNDN);
        mpfr_mul(r15537, r15535, r15536, MPFR_RNDN);
        return mpfr_get_d(r15537, MPFR_RNDN);
}

static mpfr_t r15538, r15539, r15540, r15541, r15542, r15543, r15544;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15538);
        mpfr_init(r15539);
        mpfr_init(r15540);
        mpfr_init(r15541);
        mpfr_init(r15542);
        mpfr_init(r15543);
        mpfr_init(r15544);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15538, d, MPFR_RNDN);
        mpfr_log(r15539, r15538, MPFR_RNDN);
        mpfr_set_d(r15540, c, MPFR_RNDN);
        mpfr_abs(r15541, r15540, MPFR_RNDN);
        mpfr_add(r15542, r15539, r15541, MPFR_RNDN);
        mpfr_tan(r15543, r15538, MPFR_RNDN);
        mpfr_mul(r15544, r15542, r15543, MPFR_RNDN);
        return mpfr_get_d(r15544, MPFR_RNDN);
}

static mpfr_t r15545, r15546, r15547, r15548, r15549, r15550, r15551;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15545);
        mpfr_init(r15546);
        mpfr_init(r15547);
        mpfr_init(r15548);
        mpfr_init(r15549);
        mpfr_init(r15550);
        mpfr_init(r15551);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15545, d, MPFR_RNDN);
        mpfr_log(r15546, r15545, MPFR_RNDN);
        mpfr_set_d(r15547, c, MPFR_RNDN);
        mpfr_abs(r15548, r15547, MPFR_RNDN);
        mpfr_add(r15549, r15546, r15548, MPFR_RNDN);
        mpfr_tan(r15550, r15545, MPFR_RNDN);
        mpfr_mul(r15551, r15549, r15550, MPFR_RNDN);
        return mpfr_get_d(r15551, MPFR_RNDN);
}

