| 1 | /* specfunc/result.c |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | /* Author: G. Jungman */ |
| 21 | |
| 22 | #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/ |
| 23 | #include "gsl_math.h"cxx . . $ `<file>/external/gsl/gsl_math.h`/ |
| 24 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 25 | #include "gsl_sf_exp.h"cxx . . $ `<file>/external/gsl/gsl_sf_exp.h`/ |
| 26 | #include "gsl_sf_result.h"cxx . . $ `<file>/external/gsl/gsl_sf_result.h`/ |
| 27 | |
| 28 | |
| 29 | int |
| 30 | gsl_sf_result_smash_ecxx . . $ gsl_sf_result_smash_e(5956f84e626a1468).(const gsl_sf_result_e10cxx . . $ gsl_sf_result_e10# * re, gsl_sf_resultcxx . . $ gsl_sf_result# * r) |
| 31 | { |
| 32 | if(re->e10cxx . . $ gsl_sf_result_e10_struct#e10. == 0) { |
| 33 | /* nothing to smash */ |
| 34 | r->valcxx . . $ gsl_sf_result_struct#val. = re->valcxx . . $ gsl_sf_result_e10_struct#val.; |
| 35 | r->errcxx . . $ gsl_sf_result_struct#err. = re->errcxx . . $ gsl_sf_result_e10_struct#err.; |
| 36 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 37 | } |
| 38 | else { |
| 39 | const double av = fabscxx . . $ fabs(447c67c6676f75c3).(re->valcxx . . $ gsl_sf_result_e10_struct#val.); |
| 40 | const double ae = fabscxx . . $ fabs(447c67c6676f75c3).(re->errcxx . . $ gsl_sf_result_e10_struct#err.); |
| 41 | |
| 42 | if( GSL_SQRT_DBL_MINcxx . . $ `external/gsl/gsl_machine.h:26:9`! < av && av < GSL_SQRT_DBL_MAXcxx . . $ `external/gsl/gsl_machine.h:34:9`! |
| 43 | && GSL_SQRT_DBL_MINcxx . . $ `external/gsl/gsl_machine.h:26:9`! < ae && ae < GSL_SQRT_DBL_MAXcxx . . $ `external/gsl/gsl_machine.h:34:9`! |
| 44 | && 0.49*GSL_LOG_DBL_MINcxx . . $ `external/gsl/gsl_machine.h:31:9`! < re->e10cxx . . $ gsl_sf_result_e10_struct#e10. && re->e10cxx . . $ gsl_sf_result_e10_struct#e10. < 0.49*GSL_LOG_DBL_MAXcxx . . $ `external/gsl/gsl_machine.h:39:9`! |
| 45 | ) { |
| 46 | const double scale = expcxx . . $ exp(447c67c6676f75c3).(re->e10cxx . . $ gsl_sf_result_e10_struct#e10. * M_LN10cxx . . $ `<external>/11263917310783833665/math.h:1120:10`!); |
| 47 | r->valcxx . . $ gsl_sf_result_struct#val. = re->valcxx . . $ gsl_sf_result_e10_struct#val. * scale; |
| 48 | r->errcxx . . $ gsl_sf_result_struct#err. = re->errcxx . . $ gsl_sf_result_e10_struct#err. * scale; |
| 49 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 50 | } |
| 51 | else { |
| 52 | return gsl_sf_exp_mult_err_ecxx . . $ gsl_sf_exp_mult_err_e(30e1ceaed94c3433).(re->e10cxx . . $ gsl_sf_result_e10_struct#e10.*M_LN10cxx . . $ `<external>/11263917310783833665/math.h:1120:10`!, 0.0, re->valcxx . . $ gsl_sf_result_e10_struct#val., re->errcxx . . $ gsl_sf_result_e10_struct#err., r); |
| 53 | } |
| 54 | } |
| 55 | /* |
| 56 | int stat_v; |
| 57 | int stat_e; |
| 58 | |
| 59 | if(re->val == 0.0) { |
| 60 | r->val = 0.0; |
| 61 | stat_v = GSL_SUCCESS; |
| 62 | } |
| 63 | else { |
| 64 | gsl_sf_result r_val; |
| 65 | const double s = GSL_SIGN(re->val); |
| 66 | const double x_v = re->e10*M_LN10 + log(fabs(re->val)); |
| 67 | stat_v = gsl_sf_exp_e(x_v, &r_val); |
| 68 | r->val = s * r_val.val; |
| 69 | } |
| 70 | |
| 71 | if(re->err == 0.0) { |
| 72 | r->err = 0.0; |
| 73 | stat_e = GSL_SUCCESS; |
| 74 | } |
| 75 | else if(re->val != 0.0) { |
| 76 | r->err = fabs(r->val * re->err/re->val); |
| 77 | stat_e = GSL_SUCCESS; |
| 78 | } |
| 79 | else { |
| 80 | gsl_sf_result r_err; |
| 81 | const double x_e = re->e10*M_LN10 + log(fabs(re->err)); |
| 82 | stat_e = gsl_sf_exp_e(x_e, &r_err); |
| 83 | r->err = r_err.val; |
| 84 | } |
| 85 | |
| 86 | return GSL_ERROR_SELECT_2(stat_v, stat_e); |
| 87 | */ |
| 88 | } |
| 89 |