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

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


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

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15332 = a;
        double r15333 = atan(r15332);
        double r15334 = sqrt(r15333);
        double r15335 = sqrt(r15334);
        double r15336 = r15335 * r15335;
        double r15337 = b;
        double r15338 = hypot(r15336, r15337);
        double r15339 = c;
        double r15340 = r15339 * r15332;
        double r15341 = r15338 - r15340;
        return r15341;
}

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 r15342, r15343, r15344, r15345, r15346, r15347, r15348, r15349;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15342);
        mpfr_init(r15343);
        mpfr_init(r15344);
        mpfr_init(r15345);
        mpfr_init(r15346);
        mpfr_init(r15347);
        mpfr_init(r15348);
        mpfr_init(r15349);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15342, a, MPFR_RNDN);
        mpfr_atan(r15343, r15342, MPFR_RNDN);
        mpfr_sqrt(r15344, r15343, MPFR_RNDN);
        mpfr_set_d(r15345, b, MPFR_RNDN);
        mpfr_hypot(r15346, r15344, r15345, MPFR_RNDN);
        mpfr_set_d(r15347, c, MPFR_RNDN);
        mpfr_mul(r15348, r15347, r15342, MPFR_RNDN);
        mpfr_sub(r15349, r15346, r15348, MPFR_RNDN);
        return mpfr_get_d(r15349, MPFR_RNDN);
}

static mpfr_t r15350, r15351, r15352, r15353, r15354, r15355, r15356, r15357, r15358, r15359;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15350);
        mpfr_init(r15351);
        mpfr_init(r15352);
        mpfr_init(r15353);
        mpfr_init(r15354);
        mpfr_init(r15355);
        mpfr_init(r15356);
        mpfr_init(r15357);
        mpfr_init(r15358);
        mpfr_init(r15359);
}

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

static mpfr_t r15360, r15361, r15362, r15363, r15364, r15365, r15366, r15367, r15368, r15369;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15360);
        mpfr_init(r15361);
        mpfr_init(r15362);
        mpfr_init(r15363);
        mpfr_init(r15364);
        mpfr_init(r15365);
        mpfr_init(r15366);
        mpfr_init(r15367);
        mpfr_init(r15368);
        mpfr_init(r15369);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15360, a, MPFR_RNDN);
        mpfr_atan(r15361, r15360, MPFR_RNDN);
        mpfr_sqrt(r15362, r15361, MPFR_RNDN);
        mpfr_sqrt(r15363, r15362, MPFR_RNDN);
        mpfr_sqr(r15364, r15363, MPFR_RNDN);
        mpfr_set_d(r15365, b, MPFR_RNDN);
        mpfr_hypot(r15366, r15364, r15365, MPFR_RNDN);
        mpfr_set_d(r15367, c, MPFR_RNDN);
        mpfr_mul(r15368, r15367, r15360, MPFR_RNDN);
        mpfr_sub(r15369, r15366, r15368, MPFR_RNDN);
        return mpfr_get_d(r15369, MPFR_RNDN);
}

