#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 r15611 = d;
        float r15612 = log(r15611);
        float r15613 = c;
        float r15614 = fabs(r15613);
        float r15615 = r15612 + r15614;
        float r15616 = tan(r15611);
        float r15617 = r15615 * r15616;
        return r15617;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15618 = d;
        double r15619 = log(r15618);
        double r15620 = c;
        double r15621 = fabs(r15620);
        double r15622 = r15619 + r15621;
        double r15623 = tan(r15618);
        double r15624 = r15622 * r15623;
        return r15624;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15625 = d;
        float r15626 = log(r15625);
        float r15627 = c;
        float r15628 = fabs(r15627);
        float r15629 = r15626 + r15628;
        float r15630 = tan(r15625);
        float r15631 = r15629 * r15630;
        return r15631;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15632 = d;
        double r15633 = log(r15632);
        double r15634 = c;
        double r15635 = fabs(r15634);
        double r15636 = r15633 + r15635;
        double r15637 = tan(r15632);
        double r15638 = r15636 * r15637;
        return r15638;
}

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 r15639, r15640, r15641, r15642, r15643, r15644, r15645;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15639);
        mpfr_init(r15640);
        mpfr_init(r15641);
        mpfr_init(r15642);
        mpfr_init(r15643);
        mpfr_init(r15644);
        mpfr_init(r15645);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15639, d, MPFR_RNDN);
        mpfr_log(r15640, r15639, MPFR_RNDN);
        mpfr_set_d(r15641, c, MPFR_RNDN);
        mpfr_abs(r15642, r15641, MPFR_RNDN);
        mpfr_add(r15643, r15640, r15642, MPFR_RNDN);
        mpfr_tan(r15644, r15639, MPFR_RNDN);
        mpfr_mul(r15645, r15643, r15644, MPFR_RNDN);
        return mpfr_get_d(r15645, MPFR_RNDN);
}

static mpfr_t r15646, r15647, r15648, r15649, r15650, r15651, r15652;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15646);
        mpfr_init(r15647);
        mpfr_init(r15648);
        mpfr_init(r15649);
        mpfr_init(r15650);
        mpfr_init(r15651);
        mpfr_init(r15652);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15646, d, MPFR_RNDN);
        mpfr_log(r15647, r15646, MPFR_RNDN);
        mpfr_set_d(r15648, c, MPFR_RNDN);
        mpfr_abs(r15649, r15648, MPFR_RNDN);
        mpfr_add(r15650, r15647, r15649, MPFR_RNDN);
        mpfr_tan(r15651, r15646, MPFR_RNDN);
        mpfr_mul(r15652, r15650, r15651, MPFR_RNDN);
        return mpfr_get_d(r15652, MPFR_RNDN);
}

static mpfr_t r15653, r15654, r15655, r15656, r15657, r15658, r15659;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15653);
        mpfr_init(r15654);
        mpfr_init(r15655);
        mpfr_init(r15656);
        mpfr_init(r15657);
        mpfr_init(r15658);
        mpfr_init(r15659);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15653, d, MPFR_RNDN);
        mpfr_log(r15654, r15653, MPFR_RNDN);
        mpfr_set_d(r15655, c, MPFR_RNDN);
        mpfr_abs(r15656, r15655, MPFR_RNDN);
        mpfr_add(r15657, r15654, r15656, MPFR_RNDN);
        mpfr_tan(r15658, r15653, MPFR_RNDN);
        mpfr_mul(r15659, r15657, r15658, MPFR_RNDN);
        return mpfr_get_d(r15659, MPFR_RNDN);
}

