#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 r15305 = a;
        float r15306 = atan(r15305);
        float r15307 = sqrt(r15306);
        float r15308 = b;
        float r15309 = hypot(r15307, r15308);
        float r15310 = c;
        float r15311 = r15310 * r15305;
        float r15312 = r15309 - r15311;
        return r15312;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15313 = a;
        double r15314 = atan(r15313);
        double r15315 = sqrt(r15314);
        double r15316 = b;
        double r15317 = hypot(r15315, r15316);
        double r15318 = c;
        double r15319 = r15318 * r15313;
        double r15320 = r15317 - r15319;
        return r15320;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15321 = a;
        float r15322 = atan(r15321);
        float r15323 = sqrt(r15322);
        float r15324 = b;
        float r15325 = hypot(r15323, r15324);
        float r15326 = c;
        float r15327 = r15326 * r15321;
        float r15328 = r15325 - r15327;
        return r15328;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15329 = a;
        double r15330 = atan(r15329);
        double r15331 = sqrt(r15330);
        double r15332 = b;
        double r15333 = hypot(r15331, r15332);
        double r15334 = c;
        double r15335 = r15334 * r15329;
        double r15336 = r15333 - r15335;
        return r15336;
}

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 r15337, r15338, r15339, r15340, r15341, r15342, r15343, r15344;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        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_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15337, a, MPFR_RNDN);
        mpfr_atan(r15338, r15337, MPFR_RNDN);
        mpfr_sqrt(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, r15337, MPFR_RNDN);
        mpfr_sub(r15344, r15341, r15343, MPFR_RNDN);
        return mpfr_get_d(r15344, MPFR_RNDN);
}

static mpfr_t r15345, r15346, r15347, r15348, r15349, r15350, r15351, r15352;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15345);
        mpfr_init(r15346);
        mpfr_init(r15347);
        mpfr_init(r15348);
        mpfr_init(r15349);
        mpfr_init(r15350);
        mpfr_init(r15351);
        mpfr_init(r15352);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15345, a, MPFR_RNDN);
        mpfr_atan(r15346, r15345, MPFR_RNDN);
        mpfr_sqrt(r15347, r15346, MPFR_RNDN);
        mpfr_set_d(r15348, b, MPFR_RNDN);
        mpfr_hypot(r15349, r15347, r15348, MPFR_RNDN);
        mpfr_set_d(r15350, c, MPFR_RNDN);
        mpfr_mul(r15351, r15350, r15345, MPFR_RNDN);
        mpfr_sub(r15352, r15349, r15351, MPFR_RNDN);
        return mpfr_get_d(r15352, MPFR_RNDN);
}

static mpfr_t r15353, r15354, r15355, r15356, r15357, r15358, r15359, r15360;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15353);
        mpfr_init(r15354);
        mpfr_init(r15355);
        mpfr_init(r15356);
        mpfr_init(r15357);
        mpfr_init(r15358);
        mpfr_init(r15359);
        mpfr_init(r15360);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15353, a, MPFR_RNDN);
        mpfr_atan(r15354, r15353, MPFR_RNDN);
        mpfr_sqrt(r15355, r15354, MPFR_RNDN);
        mpfr_set_d(r15356, b, MPFR_RNDN);
        mpfr_hypot(r15357, r15355, r15356, MPFR_RNDN);
        mpfr_set_d(r15358, c, MPFR_RNDN);
        mpfr_mul(r15359, r15358, r15353, MPFR_RNDN);
        mpfr_sub(r15360, r15357, r15359, MPFR_RNDN);
        return mpfr_get_d(r15360, MPFR_RNDN);
}

