#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 r15387 = a;
        float r15388 = atan(r15387);
        float r15389 = sqrt(r15388);
        float r15390 = b;
        float r15391 = hypot(r15389, r15390);
        float r15392 = c;
        float r15393 = r15392 * r15387;
        float r15394 = r15391 - r15393;
        return r15394;
}

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


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15403 = a;
        float r15404 = atan(r15403);
        float r15405 = sqrt(r15404);
        float r15406 = b;
        float r15407 = hypot(r15405, r15406);
        float r15408 = c;
        float r15409 = r15408 * r15403;
        float r15410 = r15407 - r15409;
        return r15410;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15411 = a;
        double r15412 = atan(r15411);
        double r15413 = sqrt(r15412);
        double r15414 = b;
        double r15415 = hypot(r15413, r15414);
        double r15416 = c;
        double r15417 = r15416 * r15411;
        double r15418 = r15415 - r15417;
        return r15418;
}

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 r15419, r15420, r15421, r15422, r15423, r15424, r15425, r15426;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15419);
        mpfr_init(r15420);
        mpfr_init(r15421);
        mpfr_init(r15422);
        mpfr_init(r15423);
        mpfr_init(r15424);
        mpfr_init(r15425);
        mpfr_init(r15426);
}

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

static mpfr_t r15427, r15428, r15429, r15430, r15431, r15432, r15433, r15434;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15427);
        mpfr_init(r15428);
        mpfr_init(r15429);
        mpfr_init(r15430);
        mpfr_init(r15431);
        mpfr_init(r15432);
        mpfr_init(r15433);
        mpfr_init(r15434);
}

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

static mpfr_t r15435, r15436, r15437, r15438, r15439, r15440, r15441, r15442;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15435);
        mpfr_init(r15436);
        mpfr_init(r15437);
        mpfr_init(r15438);
        mpfr_init(r15439);
        mpfr_init(r15440);
        mpfr_init(r15441);
        mpfr_init(r15442);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15435, a, MPFR_RNDN);
        mpfr_atan(r15436, r15435, MPFR_RNDN);
        mpfr_sqrt(r15437, r15436, MPFR_RNDN);
        mpfr_set_d(r15438, b, MPFR_RNDN);
        mpfr_hypot(r15439, r15437, r15438, MPFR_RNDN);
        mpfr_set_d(r15440, c, MPFR_RNDN);
        mpfr_mul(r15441, r15440, r15435, MPFR_RNDN);
        mpfr_sub(r15442, r15439, r15441, MPFR_RNDN);
        return mpfr_get_d(r15442, MPFR_RNDN);
}

