#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 r15658 = d;
        float r15659 = log(r15658);
        float r15660 = c;
        float r15661 = fabs(r15660);
        float r15662 = r15659 + r15661;
        float r15663 = tan(r15658);
        float r15664 = r15662 * r15663;
        return r15664;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15665 = d;
        double r15666 = log(r15665);
        double r15667 = c;
        double r15668 = fabs(r15667);
        double r15669 = r15666 + r15668;
        double r15670 = tan(r15665);
        double r15671 = r15669 * r15670;
        return r15671;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15672 = d;
        float r15673 = log(r15672);
        float r15674 = c;
        float r15675 = fabs(r15674);
        float r15676 = r15673 + r15675;
        float r15677 = tan(r15672);
        float r15678 = r15676 * r15677;
        return r15678;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15679 = d;
        double r15680 = log(r15679);
        double r15681 = c;
        double r15682 = fabs(r15681);
        double r15683 = r15680 + r15682;
        double r15684 = tan(r15679);
        double r15685 = r15683 * r15684;
        return r15685;
}

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 r15686, r15687, r15688, r15689, r15690, r15691, r15692;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15686);
        mpfr_init(r15687);
        mpfr_init(r15688);
        mpfr_init(r15689);
        mpfr_init(r15690);
        mpfr_init(r15691);
        mpfr_init(r15692);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15686, d, MPFR_RNDN);
        mpfr_log(r15687, r15686, MPFR_RNDN);
        mpfr_set_d(r15688, c, MPFR_RNDN);
        mpfr_abs(r15689, r15688, MPFR_RNDN);
        mpfr_add(r15690, r15687, r15689, MPFR_RNDN);
        mpfr_tan(r15691, r15686, MPFR_RNDN);
        mpfr_mul(r15692, r15690, r15691, MPFR_RNDN);
        return mpfr_get_d(r15692, MPFR_RNDN);
}

static mpfr_t r15693, r15694, r15695, r15696, r15697, r15698, r15699;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15693);
        mpfr_init(r15694);
        mpfr_init(r15695);
        mpfr_init(r15696);
        mpfr_init(r15697);
        mpfr_init(r15698);
        mpfr_init(r15699);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15693, d, MPFR_RNDN);
        mpfr_log(r15694, r15693, MPFR_RNDN);
        mpfr_set_d(r15695, c, MPFR_RNDN);
        mpfr_abs(r15696, r15695, MPFR_RNDN);
        mpfr_add(r15697, r15694, r15696, MPFR_RNDN);
        mpfr_tan(r15698, r15693, MPFR_RNDN);
        mpfr_mul(r15699, r15697, r15698, MPFR_RNDN);
        return mpfr_get_d(r15699, MPFR_RNDN);
}

static mpfr_t r15700, r15701, r15702, r15703, r15704, r15705, r15706;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15700);
        mpfr_init(r15701);
        mpfr_init(r15702);
        mpfr_init(r15703);
        mpfr_init(r15704);
        mpfr_init(r15705);
        mpfr_init(r15706);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15700, d, MPFR_RNDN);
        mpfr_log(r15701, r15700, MPFR_RNDN);
        mpfr_set_d(r15702, c, MPFR_RNDN);
        mpfr_abs(r15703, r15702, MPFR_RNDN);
        mpfr_add(r15704, r15701, r15703, MPFR_RNDN);
        mpfr_tan(r15705, r15700, MPFR_RNDN);
        mpfr_mul(r15706, r15704, r15705, MPFR_RNDN);
        return mpfr_get_d(r15706, MPFR_RNDN);
}

