#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 r15647 = d;
        float r15648 = log(r15647);
        float r15649 = c;
        float r15650 = fabs(r15649);
        float r15651 = r15648 + r15650;
        float r15652 = tan(r15647);
        float r15653 = r15651 * r15652;
        return r15653;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15654 = d;
        double r15655 = log(r15654);
        double r15656 = c;
        double r15657 = fabs(r15656);
        double r15658 = r15655 + r15657;
        double r15659 = tan(r15654);
        double r15660 = r15658 * r15659;
        return r15660;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15661 = d;
        float r15662 = log(r15661);
        float r15663 = c;
        float r15664 = fabs(r15663);
        float r15665 = r15662 + r15664;
        float r15666 = tan(r15661);
        float r15667 = r15665 * r15666;
        return r15667;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15668 = d;
        double r15669 = log(r15668);
        double r15670 = c;
        double r15671 = fabs(r15670);
        double r15672 = r15669 + r15671;
        double r15673 = tan(r15668);
        double r15674 = r15672 * r15673;
        return r15674;
}

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 r15675, r15676, r15677, r15678, r15679, r15680, r15681;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15675);
        mpfr_init(r15676);
        mpfr_init(r15677);
        mpfr_init(r15678);
        mpfr_init(r15679);
        mpfr_init(r15680);
        mpfr_init(r15681);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15675, d, MPFR_RNDN);
        mpfr_log(r15676, r15675, MPFR_RNDN);
        mpfr_set_d(r15677, c, MPFR_RNDN);
        mpfr_abs(r15678, r15677, MPFR_RNDN);
        mpfr_add(r15679, r15676, r15678, MPFR_RNDN);
        mpfr_tan(r15680, r15675, MPFR_RNDN);
        mpfr_mul(r15681, r15679, r15680, MPFR_RNDN);
        return mpfr_get_d(r15681, MPFR_RNDN);
}

static mpfr_t r15682, r15683, r15684, r15685, r15686, r15687, r15688;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15682);
        mpfr_init(r15683);
        mpfr_init(r15684);
        mpfr_init(r15685);
        mpfr_init(r15686);
        mpfr_init(r15687);
        mpfr_init(r15688);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15682, d, MPFR_RNDN);
        mpfr_log(r15683, r15682, MPFR_RNDN);
        mpfr_set_d(r15684, c, MPFR_RNDN);
        mpfr_abs(r15685, r15684, MPFR_RNDN);
        mpfr_add(r15686, r15683, r15685, MPFR_RNDN);
        mpfr_tan(r15687, r15682, MPFR_RNDN);
        mpfr_mul(r15688, r15686, r15687, MPFR_RNDN);
        return mpfr_get_d(r15688, MPFR_RNDN);
}

static mpfr_t r15689, r15690, r15691, r15692, r15693, r15694, r15695;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15689);
        mpfr_init(r15690);
        mpfr_init(r15691);
        mpfr_init(r15692);
        mpfr_init(r15693);
        mpfr_init(r15694);
        mpfr_init(r15695);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15689, d, MPFR_RNDN);
        mpfr_log(r15690, r15689, MPFR_RNDN);
        mpfr_set_d(r15691, c, MPFR_RNDN);
        mpfr_abs(r15692, r15691, MPFR_RNDN);
        mpfr_add(r15693, r15690, r15692, MPFR_RNDN);
        mpfr_tan(r15694, r15689, MPFR_RNDN);
        mpfr_mul(r15695, r15693, r15694, MPFR_RNDN);
        return mpfr_get_d(r15695, MPFR_RNDN);
}

