#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 r15815 = d;
        float r15816 = log(r15815);
        float r15817 = c;
        float r15818 = fabs(r15817);
        float r15819 = r15816 + r15818;
        float r15820 = tan(r15815);
        float r15821 = r15819 * r15820;
        return r15821;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15822 = d;
        double r15823 = log(r15822);
        double r15824 = c;
        double r15825 = fabs(r15824);
        double r15826 = r15823 + r15825;
        double r15827 = tan(r15822);
        double r15828 = r15826 * r15827;
        return r15828;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15829 = d;
        float r15830 = log(r15829);
        float r15831 = c;
        float r15832 = fabs(r15831);
        float r15833 = r15830 + r15832;
        float r15834 = tan(r15829);
        float r15835 = r15833 * r15834;
        return r15835;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15836 = d;
        double r15837 = log(r15836);
        double r15838 = c;
        double r15839 = fabs(r15838);
        double r15840 = r15837 + r15839;
        double r15841 = tan(r15836);
        double r15842 = r15840 * r15841;
        return r15842;
}

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 r15843, r15844, r15845, r15846, r15847, r15848, r15849;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15843);
        mpfr_init(r15844);
        mpfr_init(r15845);
        mpfr_init(r15846);
        mpfr_init(r15847);
        mpfr_init(r15848);
        mpfr_init(r15849);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15843, d, MPFR_RNDN);
        mpfr_log(r15844, r15843, MPFR_RNDN);
        mpfr_set_d(r15845, c, MPFR_RNDN);
        mpfr_abs(r15846, r15845, MPFR_RNDN);
        mpfr_add(r15847, r15844, r15846, MPFR_RNDN);
        mpfr_tan(r15848, r15843, MPFR_RNDN);
        mpfr_mul(r15849, r15847, r15848, MPFR_RNDN);
        return mpfr_get_d(r15849, MPFR_RNDN);
}

static mpfr_t r15850, r15851, r15852, r15853, r15854, r15855, r15856;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15850);
        mpfr_init(r15851);
        mpfr_init(r15852);
        mpfr_init(r15853);
        mpfr_init(r15854);
        mpfr_init(r15855);
        mpfr_init(r15856);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15850, d, MPFR_RNDN);
        mpfr_log(r15851, r15850, MPFR_RNDN);
        mpfr_set_d(r15852, c, MPFR_RNDN);
        mpfr_abs(r15853, r15852, MPFR_RNDN);
        mpfr_add(r15854, r15851, r15853, MPFR_RNDN);
        mpfr_tan(r15855, r15850, MPFR_RNDN);
        mpfr_mul(r15856, r15854, r15855, MPFR_RNDN);
        return mpfr_get_d(r15856, MPFR_RNDN);
}

static mpfr_t r15857, r15858, r15859, r15860, r15861, r15862, r15863;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15857);
        mpfr_init(r15858);
        mpfr_init(r15859);
        mpfr_init(r15860);
        mpfr_init(r15861);
        mpfr_init(r15862);
        mpfr_init(r15863);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15857, d, MPFR_RNDN);
        mpfr_log(r15858, r15857, MPFR_RNDN);
        mpfr_set_d(r15859, c, MPFR_RNDN);
        mpfr_abs(r15860, r15859, MPFR_RNDN);
        mpfr_add(r15861, r15858, r15860, MPFR_RNDN);
        mpfr_tan(r15862, r15857, MPFR_RNDN);
        mpfr_mul(r15863, r15861, r15862, MPFR_RNDN);
        return mpfr_get_d(r15863, MPFR_RNDN);
}

