#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 r15331 = a;
        float r15332 = atan(r15331);
        float r15333 = sqrt(r15332);
        float r15334 = b;
        float r15335 = hypot(r15333, r15334);
        float r15336 = c;
        float r15337 = r15336 * r15331;
        float r15338 = r15335 - r15337;
        return r15338;
}

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


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15347 = a;
        float r15348 = atan(r15347);
        float r15349 = sqrt(r15348);
        float r15350 = b;
        float r15351 = hypot(r15349, r15350);
        float r15352 = c;
        float r15353 = r15352 * r15347;
        float r15354 = r15351 - r15353;
        return r15354;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15355 = a;
        double r15356 = atan(r15355);
        double r15357 = sqrt(r15356);
        double r15358 = b;
        double r15359 = hypot(r15357, r15358);
        double r15360 = c;
        double r15361 = r15360 * r15355;
        double r15362 = r15359 - r15361;
        return r15362;
}

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 r15363, r15364, r15365, r15366, r15367, r15368, r15369, r15370;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15363);
        mpfr_init(r15364);
        mpfr_init(r15365);
        mpfr_init(r15366);
        mpfr_init(r15367);
        mpfr_init(r15368);
        mpfr_init(r15369);
        mpfr_init(r15370);
}

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

static mpfr_t r15371, r15372, r15373, r15374, r15375, r15376, r15377, r15378;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15371);
        mpfr_init(r15372);
        mpfr_init(r15373);
        mpfr_init(r15374);
        mpfr_init(r15375);
        mpfr_init(r15376);
        mpfr_init(r15377);
        mpfr_init(r15378);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15371, a, MPFR_RNDN);
        mpfr_atan(r15372, r15371, MPFR_RNDN);
        mpfr_sqrt(r15373, r15372, MPFR_RNDN);
        mpfr_set_d(r15374, b, MPFR_RNDN);
        mpfr_hypot(r15375, r15373, r15374, MPFR_RNDN);
        mpfr_set_d(r15376, c, MPFR_RNDN);
        mpfr_mul(r15377, r15376, r15371, MPFR_RNDN);
        mpfr_sub(r15378, r15375, r15377, MPFR_RNDN);
        return mpfr_get_d(r15378, MPFR_RNDN);
}

static mpfr_t r15379, r15380, r15381, r15382, r15383, r15384, r15385, r15386;

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

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

