#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 r15787 = d;
        float r15788 = log(r15787);
        float r15789 = c;
        float r15790 = fabs(r15789);
        float r15791 = r15788 + r15790;
        float r15792 = tan(r15787);
        float r15793 = r15791 * r15792;
        return r15793;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15794 = d;
        double r15795 = log(r15794);
        double r15796 = c;
        double r15797 = fabs(r15796);
        double r15798 = r15795 + r15797;
        double r15799 = tan(r15794);
        double r15800 = r15798 * r15799;
        return r15800;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15801 = d;
        float r15802 = log(r15801);
        float r15803 = c;
        float r15804 = fabs(r15803);
        float r15805 = r15802 + r15804;
        float r15806 = tan(r15801);
        float r15807 = r15805 * r15806;
        return r15807;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15808 = d;
        double r15809 = log(r15808);
        double r15810 = c;
        double r15811 = fabs(r15810);
        double r15812 = r15809 + r15811;
        double r15813 = tan(r15808);
        double r15814 = r15812 * r15813;
        return r15814;
}

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 r15815, r15816, r15817, r15818, r15819, r15820, r15821;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15815);
        mpfr_init(r15816);
        mpfr_init(r15817);
        mpfr_init(r15818);
        mpfr_init(r15819);
        mpfr_init(r15820);
        mpfr_init(r15821);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15815, d, MPFR_RNDN);
        mpfr_log(r15816, r15815, MPFR_RNDN);
        mpfr_set_d(r15817, c, MPFR_RNDN);
        mpfr_abs(r15818, r15817, MPFR_RNDN);
        mpfr_add(r15819, r15816, r15818, MPFR_RNDN);
        mpfr_tan(r15820, r15815, MPFR_RNDN);
        mpfr_mul(r15821, r15819, r15820, MPFR_RNDN);
        return mpfr_get_d(r15821, MPFR_RNDN);
}

static mpfr_t r15822, r15823, r15824, r15825, r15826, r15827, r15828;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15822);
        mpfr_init(r15823);
        mpfr_init(r15824);
        mpfr_init(r15825);
        mpfr_init(r15826);
        mpfr_init(r15827);
        mpfr_init(r15828);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15822, d, MPFR_RNDN);
        mpfr_log(r15823, r15822, MPFR_RNDN);
        mpfr_set_d(r15824, c, MPFR_RNDN);
        mpfr_abs(r15825, r15824, MPFR_RNDN);
        mpfr_add(r15826, r15823, r15825, MPFR_RNDN);
        mpfr_tan(r15827, r15822, MPFR_RNDN);
        mpfr_mul(r15828, r15826, r15827, MPFR_RNDN);
        return mpfr_get_d(r15828, MPFR_RNDN);
}

static mpfr_t r15829, r15830, r15831, r15832, r15833, r15834, r15835;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15829);
        mpfr_init(r15830);
        mpfr_init(r15831);
        mpfr_init(r15832);
        mpfr_init(r15833);
        mpfr_init(r15834);
        mpfr_init(r15835);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15829, d, MPFR_RNDN);
        mpfr_log(r15830, r15829, MPFR_RNDN);
        mpfr_set_d(r15831, c, MPFR_RNDN);
        mpfr_abs(r15832, r15831, MPFR_RNDN);
        mpfr_add(r15833, r15830, r15832, MPFR_RNDN);
        mpfr_tan(r15834, r15829, MPFR_RNDN);
        mpfr_mul(r15835, r15833, r15834, MPFR_RNDN);
        return mpfr_get_d(r15835, MPFR_RNDN);
}

