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

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


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

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

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 r15306, r15307, r15308, r15309, r15310, r15311, r15312, r15313;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15306);
        mpfr_init(r15307);
        mpfr_init(r15308);
        mpfr_init(r15309);
        mpfr_init(r15310);
        mpfr_init(r15311);
        mpfr_init(r15312);
        mpfr_init(r15313);
}

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

static mpfr_t r15314, r15315, r15316, r15317, r15318, r15319, r15320, r15321;

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

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

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

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

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

