#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 r15651 = d;
        float r15652 = log(r15651);
        float r15653 = c;
        float r15654 = fabs(r15653);
        float r15655 = r15652 + r15654;
        float r15656 = tan(r15651);
        float r15657 = r15655 * r15656;
        return r15657;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15658 = d;
        double r15659 = log(r15658);
        double r15660 = c;
        double r15661 = fabs(r15660);
        double r15662 = r15659 + r15661;
        double r15663 = tan(r15658);
        double r15664 = r15662 * r15663;
        return r15664;
}


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

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

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 r15679, r15680, r15681, r15682, r15683, r15684, r15685;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15679);
        mpfr_init(r15680);
        mpfr_init(r15681);
        mpfr_init(r15682);
        mpfr_init(r15683);
        mpfr_init(r15684);
        mpfr_init(r15685);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15679, d, MPFR_RNDN);
        mpfr_log(r15680, r15679, MPFR_RNDN);
        mpfr_set_d(r15681, c, MPFR_RNDN);
        mpfr_abs(r15682, r15681, MPFR_RNDN);
        mpfr_add(r15683, r15680, r15682, MPFR_RNDN);
        mpfr_tan(r15684, r15679, MPFR_RNDN);
        mpfr_mul(r15685, r15683, r15684, MPFR_RNDN);
        return mpfr_get_d(r15685, MPFR_RNDN);
}

static mpfr_t r15686, r15687, r15688, r15689, r15690, r15691, r15692;

void setup_mpfr_f_fm() {
        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_fm(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_dm() {
        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_dm(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);
}

