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

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


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

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

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 r15309, r15310, r15311, r15312, r15313, r15314, r15315, r15316;

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

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

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

void setup_mpfr_f_fm() {
        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);
        mpfr_init(r15325);
        mpfr_init(r15326);
}

double f_fm(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_sqrt(r15320, r15319, MPFR_RNDN);
        mpfr_sqr(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, r15317, MPFR_RNDN);
        mpfr_sub(r15326, r15323, r15325, MPFR_RNDN);
        return mpfr_get_d(r15326, MPFR_RNDN);
}

static mpfr_t r15327, r15328, r15329, r15330, r15331, r15332, r15333, r15334, r15335, r15336;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15327);
        mpfr_init(r15328);
        mpfr_init(r15329);
        mpfr_init(r15330);
        mpfr_init(r15331);
        mpfr_init(r15332);
        mpfr_init(r15333);
        mpfr_init(r15334);
        mpfr_init(r15335);
        mpfr_init(r15336);
}

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

