#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 r15366 = a;
        float r15367 = atan(r15366);
        float r15368 = sqrt(r15367);
        float r15369 = b;
        float r15370 = hypot(r15368, r15369);
        float r15371 = c;
        float r15372 = r15371 * r15366;
        float r15373 = r15370 - r15372;
        return r15373;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15374 = a;
        double r15375 = atan(r15374);
        double r15376 = sqrt(r15375);
        double r15377 = b;
        double r15378 = hypot(r15376, r15377);
        double r15379 = c;
        double r15380 = r15379 * r15374;
        double r15381 = r15378 - r15380;
        return r15381;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15382 = a;
        float r15383 = atan(r15382);
        float r15384 = sqrt(r15383);
        float r15385 = sqrt(r15384);
        float r15386 = r15385 * r15385;
        float r15387 = b;
        float r15388 = hypot(r15386, r15387);
        float r15389 = c;
        float r15390 = r15389 * r15382;
        float r15391 = r15388 - r15390;
        return r15391;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15392 = a;
        double r15393 = atan(r15392);
        double r15394 = sqrt(r15393);
        double r15395 = sqrt(r15394);
        double r15396 = r15395 * r15395;
        double r15397 = b;
        double r15398 = hypot(r15396, r15397);
        double r15399 = c;
        double r15400 = r15399 * r15392;
        double r15401 = r15398 - r15400;
        return r15401;
}

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 r15402, r15403, r15404, r15405, r15406, r15407, r15408, r15409;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15402);
        mpfr_init(r15403);
        mpfr_init(r15404);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15402, a, MPFR_RNDN);
        mpfr_atan(r15403, r15402, MPFR_RNDN);
        mpfr_sqrt(r15404, r15403, MPFR_RNDN);
        mpfr_set_d(r15405, b, MPFR_RNDN);
        mpfr_hypot(r15406, r15404, r15405, MPFR_RNDN);
        mpfr_set_d(r15407, c, MPFR_RNDN);
        mpfr_mul(r15408, r15407, r15402, MPFR_RNDN);
        mpfr_sub(r15409, r15406, r15408, MPFR_RNDN);
        return mpfr_get_d(r15409, MPFR_RNDN);
}

static mpfr_t r15410, r15411, r15412, r15413, r15414, r15415, r15416, r15417, r15418, r15419;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15410);
        mpfr_init(r15411);
        mpfr_init(r15412);
        mpfr_init(r15413);
        mpfr_init(r15414);
        mpfr_init(r15415);
        mpfr_init(r15416);
        mpfr_init(r15417);
        mpfr_init(r15418);
        mpfr_init(r15419);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15410, a, MPFR_RNDN);
        mpfr_atan(r15411, r15410, MPFR_RNDN);
        mpfr_sqrt(r15412, r15411, MPFR_RNDN);
        mpfr_sqrt(r15413, r15412, MPFR_RNDN);
        mpfr_sqr(r15414, r15413, MPFR_RNDN);
        mpfr_set_d(r15415, b, MPFR_RNDN);
        mpfr_hypot(r15416, r15414, r15415, MPFR_RNDN);
        mpfr_set_d(r15417, c, MPFR_RNDN);
        mpfr_mul(r15418, r15417, r15410, MPFR_RNDN);
        mpfr_sub(r15419, r15416, r15418, MPFR_RNDN);
        return mpfr_get_d(r15419, MPFR_RNDN);
}

static mpfr_t r15420, r15421, r15422, r15423, r15424, r15425, r15426, r15427, r15428, r15429;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15420);
        mpfr_init(r15421);
        mpfr_init(r15422);
        mpfr_init(r15423);
        mpfr_init(r15424);
        mpfr_init(r15425);
        mpfr_init(r15426);
        mpfr_init(r15427);
        mpfr_init(r15428);
        mpfr_init(r15429);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15420, a, MPFR_RNDN);
        mpfr_atan(r15421, r15420, MPFR_RNDN);
        mpfr_sqrt(r15422, r15421, MPFR_RNDN);
        mpfr_sqrt(r15423, r15422, MPFR_RNDN);
        mpfr_sqr(r15424, r15423, MPFR_RNDN);
        mpfr_set_d(r15425, b, MPFR_RNDN);
        mpfr_hypot(r15426, r15424, r15425, MPFR_RNDN);
        mpfr_set_d(r15427, c, MPFR_RNDN);
        mpfr_mul(r15428, r15427, r15420, MPFR_RNDN);
        mpfr_sub(r15429, r15426, r15428, MPFR_RNDN);
        return mpfr_get_d(r15429, MPFR_RNDN);
}

