#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "(- (hypot (sqrt (atan a)) b) (* c a))";

double f_if(float a, float b, float c, float __attribute__((unused)) d) {
        float r15283 = a;
        float r15284 = atan(r15283);
        float r15285 = sqrt(r15284);
        float r15286 = b;
        float r15287 = hypot(r15285, r15286);
        float r15288 = c;
        float r15289 = r15288 * r15283;
        float r15290 = r15287 - r15289;
        return r15290;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15291 = a;
        double r15292 = atan(r15291);
        double r15293 = sqrt(r15292);
        double r15294 = b;
        double r15295 = hypot(r15293, r15294);
        double r15296 = c;
        double r15297 = r15296 * r15291;
        double r15298 = r15295 - r15297;
        return r15298;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15299 = a;
        float r15300 = atan(r15299);
        float r15301 = sqrt(r15300);
        float r15302 = b;
        float r15303 = hypot(r15301, r15302);
        float r15304 = c;
        float r15305 = r15304 * r15299;
        float r15306 = r15303 - r15305;
        return r15306;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15307 = a;
        double r15308 = atan(r15307);
        double r15309 = sqrt(r15308);
        double r15310 = b;
        double r15311 = hypot(r15309, r15310);
        double r15312 = c;
        double r15313 = r15312 * r15307;
        double r15314 = r15311 - r15313;
        return r15314;
}

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 r15315, r15316, r15317, r15318, r15319, r15320, r15321, r15322;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15315);
        mpfr_init(r15316);
        mpfr_init(r15317);
        mpfr_init(r15318);
        mpfr_init(r15319);
        mpfr_init(r15320);
        mpfr_init(r15321);
        mpfr_init(r15322);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15315, a, MPFR_RNDN);
        mpfr_atan(r15316, r15315, MPFR_RNDN);
        mpfr_sqrt(r15317, r15316, MPFR_RNDN);
        mpfr_set_d(r15318, b, MPFR_RNDN);
        mpfr_hypot(r15319, r15317, r15318, MPFR_RNDN);
        mpfr_set_d(r15320, c, MPFR_RNDN);
        mpfr_mul(r15321, r15320, r15315, MPFR_RNDN);
        mpfr_sub(r15322, r15319, r15321, MPFR_RNDN);
        return mpfr_get_d(r15322, MPFR_RNDN);
}

static mpfr_t r15323, r15324, r15325, r15326, r15327, r15328, r15329, r15330;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15323);
        mpfr_init(r15324);
        mpfr_init(r15325);
        mpfr_init(r15326);
        mpfr_init(r15327);
        mpfr_init(r15328);
        mpfr_init(r15329);
        mpfr_init(r15330);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15323, a, MPFR_RNDN);
        mpfr_atan(r15324, r15323, MPFR_RNDN);
        mpfr_sqrt(r15325, r15324, MPFR_RNDN);
        mpfr_set_d(r15326, b, MPFR_RNDN);
        mpfr_hypot(r15327, r15325, r15326, MPFR_RNDN);
        mpfr_set_d(r15328, c, MPFR_RNDN);
        mpfr_mul(r15329, r15328, r15323, MPFR_RNDN);
        mpfr_sub(r15330, r15327, r15329, MPFR_RNDN);
        return mpfr_get_d(r15330, MPFR_RNDN);
}

static mpfr_t r15331, r15332, r15333, r15334, r15335, r15336, r15337, r15338;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15331);
        mpfr_init(r15332);
        mpfr_init(r15333);
        mpfr_init(r15334);
        mpfr_init(r15335);
        mpfr_init(r15336);
        mpfr_init(r15337);
        mpfr_init(r15338);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15331, a, MPFR_RNDN);
        mpfr_atan(r15332, r15331, MPFR_RNDN);
        mpfr_sqrt(r15333, r15332, MPFR_RNDN);
        mpfr_set_d(r15334, b, MPFR_RNDN);
        mpfr_hypot(r15335, r15333, r15334, MPFR_RNDN);
        mpfr_set_d(r15336, c, MPFR_RNDN);
        mpfr_mul(r15337, r15336, r15331, MPFR_RNDN);
        mpfr_sub(r15338, r15335, r15337, MPFR_RNDN);
        return mpfr_get_d(r15338, MPFR_RNDN);
}

