#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 r15281 = a;
        float r15282 = atan(r15281);
        float r15283 = sqrt(r15282);
        float r15284 = b;
        float r15285 = hypot(r15283, r15284);
        float r15286 = c;
        float r15287 = r15286 * r15281;
        float r15288 = r15285 - r15287;
        return r15288;
}

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


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15297 = a;
        float r15298 = atan(r15297);
        float r15299 = sqrt(r15298);
        float r15300 = sqrt(r15299);
        float r15301 = r15300 * r15300;
        float r15302 = b;
        float r15303 = hypot(r15301, r15302);
        float r15304 = c;
        float r15305 = r15304 * r15297;
        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 = sqrt(r15309);
        double r15311 = r15310 * r15310;
        double r15312 = b;
        double r15313 = hypot(r15311, r15312);
        double r15314 = c;
        double r15315 = r15314 * r15307;
        double r15316 = r15313 - r15315;
        return r15316;
}

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

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

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

static mpfr_t r15325, r15326, r15327, r15328, r15329, r15330, r15331, r15332, r15333, r15334;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15325);
        mpfr_init(r15326);
        mpfr_init(r15327);
        mpfr_init(r15328);
        mpfr_init(r15329);
        mpfr_init(r15330);
        mpfr_init(r15331);
        mpfr_init(r15332);
        mpfr_init(r15333);
        mpfr_init(r15334);
}

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

static mpfr_t r15335, r15336, r15337, r15338, r15339, r15340, r15341, r15342, r15343, r15344;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15335);
        mpfr_init(r15336);
        mpfr_init(r15337);
        mpfr_init(r15338);
        mpfr_init(r15339);
        mpfr_init(r15340);
        mpfr_init(r15341);
        mpfr_init(r15342);
        mpfr_init(r15343);
        mpfr_init(r15344);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15335, a, MPFR_RNDN);
        mpfr_atan(r15336, r15335, MPFR_RNDN);
        mpfr_sqrt(r15337, r15336, MPFR_RNDN);
        mpfr_sqrt(r15338, r15337, MPFR_RNDN);
        mpfr_sqr(r15339, r15338, MPFR_RNDN);
        mpfr_set_d(r15340, b, MPFR_RNDN);
        mpfr_hypot(r15341, r15339, r15340, MPFR_RNDN);
        mpfr_set_d(r15342, c, MPFR_RNDN);
        mpfr_mul(r15343, r15342, r15335, MPFR_RNDN);
        mpfr_sub(r15344, r15341, r15343, MPFR_RNDN);
        return mpfr_get_d(r15344, MPFR_RNDN);
}

