#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 r15271 = a;
        float r15272 = atan(r15271);
        float r15273 = sqrt(r15272);
        float r15274 = b;
        float r15275 = hypot(r15273, r15274);
        float r15276 = c;
        float r15277 = r15276 * r15271;
        float r15278 = r15275 - r15277;
        return r15278;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15279 = a;
        double r15280 = atan(r15279);
        double r15281 = sqrt(r15280);
        double r15282 = b;
        double r15283 = hypot(r15281, r15282);
        double r15284 = c;
        double r15285 = r15284 * r15279;
        double r15286 = r15283 - r15285;
        return r15286;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15287 = a;
        float r15288 = atan(r15287);
        float r15289 = sqrt(r15288);
        float r15290 = b;
        float r15291 = hypot(r15289, r15290);
        float r15292 = c;
        float r15293 = r15292 * r15287;
        float r15294 = r15291 - r15293;
        return r15294;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15295 = a;
        double r15296 = atan(r15295);
        double r15297 = sqrt(r15296);
        double r15298 = b;
        double r15299 = hypot(r15297, r15298);
        double r15300 = c;
        double r15301 = r15300 * r15295;
        double r15302 = r15299 - r15301;
        return r15302;
}

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 r15303, r15304, r15305, r15306, r15307, r15308, r15309, r15310;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15303);
        mpfr_init(r15304);
        mpfr_init(r15305);
        mpfr_init(r15306);
        mpfr_init(r15307);
        mpfr_init(r15308);
        mpfr_init(r15309);
        mpfr_init(r15310);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15303, a, MPFR_RNDN);
        mpfr_atan(r15304, r15303, MPFR_RNDN);
        mpfr_sqrt(r15305, r15304, MPFR_RNDN);
        mpfr_set_d(r15306, b, MPFR_RNDN);
        mpfr_hypot(r15307, r15305, r15306, MPFR_RNDN);
        mpfr_set_d(r15308, c, MPFR_RNDN);
        mpfr_mul(r15309, r15308, r15303, MPFR_RNDN);
        mpfr_sub(r15310, r15307, r15309, MPFR_RNDN);
        return mpfr_get_d(r15310, MPFR_RNDN);
}

static mpfr_t r15311, r15312, r15313, r15314, r15315, r15316, r15317, r15318;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15311);
        mpfr_init(r15312);
        mpfr_init(r15313);
        mpfr_init(r15314);
        mpfr_init(r15315);
        mpfr_init(r15316);
        mpfr_init(r15317);
        mpfr_init(r15318);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15311, a, MPFR_RNDN);
        mpfr_atan(r15312, r15311, MPFR_RNDN);
        mpfr_sqrt(r15313, r15312, MPFR_RNDN);
        mpfr_set_d(r15314, b, MPFR_RNDN);
        mpfr_hypot(r15315, r15313, r15314, MPFR_RNDN);
        mpfr_set_d(r15316, c, MPFR_RNDN);
        mpfr_mul(r15317, r15316, r15311, MPFR_RNDN);
        mpfr_sub(r15318, r15315, r15317, MPFR_RNDN);
        return mpfr_get_d(r15318, MPFR_RNDN);
}

static mpfr_t r15319, r15320, r15321, r15322, r15323, r15324, r15325, r15326;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15319);
        mpfr_init(r15320);
        mpfr_init(r15321);
        mpfr_init(r15322);
        mpfr_init(r15323);
        mpfr_init(r15324);
        mpfr_init(r15325);
        mpfr_init(r15326);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15319, a, MPFR_RNDN);
        mpfr_atan(r15320, r15319, MPFR_RNDN);
        mpfr_sqrt(r15321, r15320, MPFR_RNDN);
        mpfr_set_d(r15322, b, MPFR_RNDN);
        mpfr_hypot(r15323, r15321, r15322, MPFR_RNDN);
        mpfr_set_d(r15324, c, MPFR_RNDN);
        mpfr_mul(r15325, r15324, r15319, MPFR_RNDN);
        mpfr_sub(r15326, r15323, r15325, MPFR_RNDN);
        return mpfr_get_d(r15326, MPFR_RNDN);
}

