#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 r15322 = a;
        float r15323 = atan(r15322);
        float r15324 = sqrt(r15323);
        float r15325 = b;
        float r15326 = hypot(r15324, r15325);
        float r15327 = c;
        float r15328 = r15327 * r15322;
        float r15329 = r15326 - r15328;
        return r15329;
}

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


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15338 = a;
        float r15339 = atan(r15338);
        float r15340 = sqrt(r15339);
        float r15341 = sqrt(r15340);
        float r15342 = r15341 * r15341;
        float r15343 = b;
        float r15344 = hypot(r15342, r15343);
        float r15345 = c;
        float r15346 = r15345 * r15338;
        float r15347 = r15344 - r15346;
        return r15347;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15348 = a;
        double r15349 = atan(r15348);
        double r15350 = sqrt(r15349);
        double r15351 = sqrt(r15350);
        double r15352 = r15351 * r15351;
        double r15353 = b;
        double r15354 = hypot(r15352, r15353);
        double r15355 = c;
        double r15356 = r15355 * r15348;
        double r15357 = r15354 - r15356;
        return r15357;
}

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 r15358, r15359, r15360, r15361, r15362, r15363, r15364, r15365;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15358);
        mpfr_init(r15359);
        mpfr_init(r15360);
        mpfr_init(r15361);
        mpfr_init(r15362);
        mpfr_init(r15363);
        mpfr_init(r15364);
        mpfr_init(r15365);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15358, a, MPFR_RNDN);
        mpfr_atan(r15359, r15358, MPFR_RNDN);
        mpfr_sqrt(r15360, r15359, MPFR_RNDN);
        mpfr_set_d(r15361, b, MPFR_RNDN);
        mpfr_hypot(r15362, r15360, r15361, MPFR_RNDN);
        mpfr_set_d(r15363, c, MPFR_RNDN);
        mpfr_mul(r15364, r15363, r15358, MPFR_RNDN);
        mpfr_sub(r15365, r15362, r15364, MPFR_RNDN);
        return mpfr_get_d(r15365, MPFR_RNDN);
}

static mpfr_t r15366, r15367, r15368, r15369, r15370, r15371, r15372, r15373, r15374, r15375;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15366);
        mpfr_init(r15367);
        mpfr_init(r15368);
        mpfr_init(r15369);
        mpfr_init(r15370);
        mpfr_init(r15371);
        mpfr_init(r15372);
        mpfr_init(r15373);
        mpfr_init(r15374);
        mpfr_init(r15375);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15366, a, MPFR_RNDN);
        mpfr_atan(r15367, r15366, MPFR_RNDN);
        mpfr_sqrt(r15368, r15367, MPFR_RNDN);
        mpfr_sqrt(r15369, r15368, MPFR_RNDN);
        mpfr_sqr(r15370, r15369, MPFR_RNDN);
        mpfr_set_d(r15371, b, MPFR_RNDN);
        mpfr_hypot(r15372, r15370, r15371, MPFR_RNDN);
        mpfr_set_d(r15373, c, MPFR_RNDN);
        mpfr_mul(r15374, r15373, r15366, MPFR_RNDN);
        mpfr_sub(r15375, r15372, r15374, MPFR_RNDN);
        return mpfr_get_d(r15375, MPFR_RNDN);
}

static mpfr_t r15376, r15377, r15378, r15379, r15380, r15381, r15382, r15383, r15384, r15385;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15376);
        mpfr_init(r15377);
        mpfr_init(r15378);
        mpfr_init(r15379);
        mpfr_init(r15380);
        mpfr_init(r15381);
        mpfr_init(r15382);
        mpfr_init(r15383);
        mpfr_init(r15384);
        mpfr_init(r15385);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15376, a, MPFR_RNDN);
        mpfr_atan(r15377, r15376, MPFR_RNDN);
        mpfr_sqrt(r15378, r15377, MPFR_RNDN);
        mpfr_sqrt(r15379, r15378, MPFR_RNDN);
        mpfr_sqr(r15380, r15379, MPFR_RNDN);
        mpfr_set_d(r15381, b, MPFR_RNDN);
        mpfr_hypot(r15382, r15380, r15381, MPFR_RNDN);
        mpfr_set_d(r15383, c, MPFR_RNDN);
        mpfr_mul(r15384, r15383, r15376, MPFR_RNDN);
        mpfr_sub(r15385, r15382, r15384, MPFR_RNDN);
        return mpfr_get_d(r15385, MPFR_RNDN);
}

