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

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


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

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

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

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

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

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

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

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

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

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

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

