#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 r15370 = a;
        float r15371 = atan(r15370);
        float r15372 = sqrt(r15371);
        float r15373 = b;
        float r15374 = hypot(r15372, r15373);
        float r15375 = c;
        float r15376 = r15375 * r15370;
        float r15377 = r15374 - r15376;
        return r15377;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15378 = a;
        double r15379 = atan(r15378);
        double r15380 = sqrt(r15379);
        double r15381 = b;
        double r15382 = hypot(r15380, r15381);
        double r15383 = c;
        double r15384 = r15383 * r15378;
        double r15385 = r15382 - r15384;
        return r15385;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15386 = a;
        float r15387 = atan(r15386);
        float r15388 = sqrt(r15387);
        float r15389 = sqrt(r15388);
        float r15390 = r15389 * r15389;
        float r15391 = b;
        float r15392 = hypot(r15390, r15391);
        float r15393 = c;
        float r15394 = r15393 * r15386;
        float r15395 = r15392 - r15394;
        return r15395;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15396 = a;
        double r15397 = atan(r15396);
        double r15398 = sqrt(r15397);
        double r15399 = sqrt(r15398);
        double r15400 = r15399 * r15399;
        double r15401 = b;
        double r15402 = hypot(r15400, r15401);
        double r15403 = c;
        double r15404 = r15403 * r15396;
        double r15405 = r15402 - r15404;
        return r15405;
}

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 r15406, r15407, r15408, r15409, r15410, r15411, r15412, r15413;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
        mpfr_init(r15410);
        mpfr_init(r15411);
        mpfr_init(r15412);
        mpfr_init(r15413);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15406, a, MPFR_RNDN);
        mpfr_atan(r15407, r15406, MPFR_RNDN);
        mpfr_sqrt(r15408, r15407, MPFR_RNDN);
        mpfr_set_d(r15409, b, MPFR_RNDN);
        mpfr_hypot(r15410, r15408, r15409, MPFR_RNDN);
        mpfr_set_d(r15411, c, MPFR_RNDN);
        mpfr_mul(r15412, r15411, r15406, MPFR_RNDN);
        mpfr_sub(r15413, r15410, r15412, MPFR_RNDN);
        return mpfr_get_d(r15413, MPFR_RNDN);
}

static mpfr_t r15414, r15415, r15416, r15417, r15418, r15419, r15420, r15421, r15422, r15423;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15414);
        mpfr_init(r15415);
        mpfr_init(r15416);
        mpfr_init(r15417);
        mpfr_init(r15418);
        mpfr_init(r15419);
        mpfr_init(r15420);
        mpfr_init(r15421);
        mpfr_init(r15422);
        mpfr_init(r15423);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15414, a, MPFR_RNDN);
        mpfr_atan(r15415, r15414, MPFR_RNDN);
        mpfr_sqrt(r15416, r15415, MPFR_RNDN);
        mpfr_sqrt(r15417, r15416, MPFR_RNDN);
        mpfr_sqr(r15418, r15417, MPFR_RNDN);
        mpfr_set_d(r15419, b, MPFR_RNDN);
        mpfr_hypot(r15420, r15418, r15419, MPFR_RNDN);
        mpfr_set_d(r15421, c, MPFR_RNDN);
        mpfr_mul(r15422, r15421, r15414, MPFR_RNDN);
        mpfr_sub(r15423, r15420, r15422, MPFR_RNDN);
        return mpfr_get_d(r15423, MPFR_RNDN);
}

static mpfr_t r15424, r15425, r15426, r15427, r15428, r15429, r15430, r15431, r15432, r15433;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15424);
        mpfr_init(r15425);
        mpfr_init(r15426);
        mpfr_init(r15427);
        mpfr_init(r15428);
        mpfr_init(r15429);
        mpfr_init(r15430);
        mpfr_init(r15431);
        mpfr_init(r15432);
        mpfr_init(r15433);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15424, a, MPFR_RNDN);
        mpfr_atan(r15425, r15424, MPFR_RNDN);
        mpfr_sqrt(r15426, r15425, MPFR_RNDN);
        mpfr_sqrt(r15427, r15426, MPFR_RNDN);
        mpfr_sqr(r15428, r15427, MPFR_RNDN);
        mpfr_set_d(r15429, b, MPFR_RNDN);
        mpfr_hypot(r15430, r15428, r15429, MPFR_RNDN);
        mpfr_set_d(r15431, c, MPFR_RNDN);
        mpfr_mul(r15432, r15431, r15424, MPFR_RNDN);
        mpfr_sub(r15433, r15430, r15432, MPFR_RNDN);
        return mpfr_get_d(r15433, MPFR_RNDN);
}

