#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 r15799 = d;
        float r15800 = log(r15799);
        float r15801 = c;
        float r15802 = fabs(r15801);
        float r15803 = r15800 + r15802;
        float r15804 = tan(r15799);
        float r15805 = r15803 * r15804;
        return r15805;
}

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


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15813 = d;
        float r15814 = log(r15813);
        float r15815 = c;
        float r15816 = fabs(r15815);
        float r15817 = r15814 + r15816;
        float r15818 = tan(r15813);
        float r15819 = r15817 * r15818;
        return r15819;
}

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

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 r15827, r15828, r15829, r15830, r15831, r15832, r15833;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15827);
        mpfr_init(r15828);
        mpfr_init(r15829);
        mpfr_init(r15830);
        mpfr_init(r15831);
        mpfr_init(r15832);
        mpfr_init(r15833);
}

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

static mpfr_t r15834, r15835, r15836, r15837, r15838, r15839, r15840;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15834);
        mpfr_init(r15835);
        mpfr_init(r15836);
        mpfr_init(r15837);
        mpfr_init(r15838);
        mpfr_init(r15839);
        mpfr_init(r15840);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15834, d, MPFR_RNDN);
        mpfr_log(r15835, r15834, MPFR_RNDN);
        mpfr_set_d(r15836, c, MPFR_RNDN);
        mpfr_abs(r15837, r15836, MPFR_RNDN);
        mpfr_add(r15838, r15835, r15837, MPFR_RNDN);
        mpfr_tan(r15839, r15834, MPFR_RNDN);
        mpfr_mul(r15840, r15838, r15839, MPFR_RNDN);
        return mpfr_get_d(r15840, MPFR_RNDN);
}

static mpfr_t r15841, r15842, r15843, r15844, r15845, r15846, r15847;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15841);
        mpfr_init(r15842);
        mpfr_init(r15843);
        mpfr_init(r15844);
        mpfr_init(r15845);
        mpfr_init(r15846);
        mpfr_init(r15847);
}

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

