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

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


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

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

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 r15642, r15643, r15644, r15645, r15646, r15647, r15648;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15642);
        mpfr_init(r15643);
        mpfr_init(r15644);
        mpfr_init(r15645);
        mpfr_init(r15646);
        mpfr_init(r15647);
        mpfr_init(r15648);
}

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

static mpfr_t r15649, r15650, r15651, r15652, r15653, r15654, r15655;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15649);
        mpfr_init(r15650);
        mpfr_init(r15651);
        mpfr_init(r15652);
        mpfr_init(r15653);
        mpfr_init(r15654);
        mpfr_init(r15655);
}

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

static mpfr_t r15656, r15657, r15658, r15659, r15660, r15661, r15662;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15656);
        mpfr_init(r15657);
        mpfr_init(r15658);
        mpfr_init(r15659);
        mpfr_init(r15660);
        mpfr_init(r15661);
        mpfr_init(r15662);
}

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

