#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 r15679 = d;
        float r15680 = log(r15679);
        float r15681 = c;
        float r15682 = fabs(r15681);
        float r15683 = r15680 + r15682;
        float r15684 = tan(r15679);
        float r15685 = r15683 * r15684;
        return r15685;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15686 = d;
        double r15687 = log(r15686);
        double r15688 = c;
        double r15689 = fabs(r15688);
        double r15690 = r15687 + r15689;
        double r15691 = tan(r15686);
        double r15692 = r15690 * r15691;
        return r15692;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15693 = d;
        float r15694 = log(r15693);
        float r15695 = c;
        float r15696 = fabs(r15695);
        float r15697 = r15694 + r15696;
        float r15698 = tan(r15693);
        float r15699 = r15697 * r15698;
        return r15699;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15700 = d;
        double r15701 = log(r15700);
        double r15702 = c;
        double r15703 = fabs(r15702);
        double r15704 = r15701 + r15703;
        double r15705 = tan(r15700);
        double r15706 = r15704 * r15705;
        return r15706;
}

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 r15707, r15708, r15709, r15710, r15711, r15712, r15713;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15707);
        mpfr_init(r15708);
        mpfr_init(r15709);
        mpfr_init(r15710);
        mpfr_init(r15711);
        mpfr_init(r15712);
        mpfr_init(r15713);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15707, d, MPFR_RNDN);
        mpfr_log(r15708, r15707, MPFR_RNDN);
        mpfr_set_d(r15709, c, MPFR_RNDN);
        mpfr_abs(r15710, r15709, MPFR_RNDN);
        mpfr_add(r15711, r15708, r15710, MPFR_RNDN);
        mpfr_tan(r15712, r15707, MPFR_RNDN);
        mpfr_mul(r15713, r15711, r15712, MPFR_RNDN);
        return mpfr_get_d(r15713, MPFR_RNDN);
}

static mpfr_t r15714, r15715, r15716, r15717, r15718, r15719, r15720;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15714);
        mpfr_init(r15715);
        mpfr_init(r15716);
        mpfr_init(r15717);
        mpfr_init(r15718);
        mpfr_init(r15719);
        mpfr_init(r15720);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15714, d, MPFR_RNDN);
        mpfr_log(r15715, r15714, MPFR_RNDN);
        mpfr_set_d(r15716, c, MPFR_RNDN);
        mpfr_abs(r15717, r15716, MPFR_RNDN);
        mpfr_add(r15718, r15715, r15717, MPFR_RNDN);
        mpfr_tan(r15719, r15714, MPFR_RNDN);
        mpfr_mul(r15720, r15718, r15719, MPFR_RNDN);
        return mpfr_get_d(r15720, MPFR_RNDN);
}

static mpfr_t r15721, r15722, r15723, r15724, r15725, r15726, r15727;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15721);
        mpfr_init(r15722);
        mpfr_init(r15723);
        mpfr_init(r15724);
        mpfr_init(r15725);
        mpfr_init(r15726);
        mpfr_init(r15727);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15721, d, MPFR_RNDN);
        mpfr_log(r15722, r15721, MPFR_RNDN);
        mpfr_set_d(r15723, c, MPFR_RNDN);
        mpfr_abs(r15724, r15723, MPFR_RNDN);
        mpfr_add(r15725, r15722, r15724, MPFR_RNDN);
        mpfr_tan(r15726, r15721, MPFR_RNDN);
        mpfr_mul(r15727, r15725, r15726, MPFR_RNDN);
        return mpfr_get_d(r15727, MPFR_RNDN);
}

