/****************************************************************************/ /* (C) Copyright 1993 Universidade Estadual de Campinas (UNICAMP) */ /* Campinas, SP, Brazil */ /* */ /* This file can be freely distributed, modified, and used for any */ /* non-commercial purpose, provided that this copyright and authorship */ /* notice be included in any copy or derived version of this file. */ /* */ /* DISCLAIMER: This software is offered ``as is'', without any guarantee */ /* as to fitness for any particular purpose. Neither the copyright */ /* holder nor the authors or their employers can be held responsible for */ /* any damages that may result from its use. */ /****************************************************************************/ char *aat_gtag = "giaboom"; char *aat_gname = "h(x) = sqrt(x^2 - x + 1/2)/sqrt(x^2 + 1/2) g(x) = h(h(x))"; Float aat_h_flt (Float x); Interval aat_h_ia (Interval x); AAP aat_h_aa (AAP x); Float aat_h_flt (Float x) { ROUND_NEAR; return (sqrt(x*x - x + 0.50)/sqrt(x*x + 0.50)); } Float aat_g_flt (Float x) { ROUND_NEAR; return aat_h_flt(aat_h_flt(x)); } Interval aat_h_ia (Interval x) { Interval x2 = ia_sqr(x); Interval hlf = {Half, Half}; Interval dif = ia_sub(x2, x); Interval sum1 = ia_add(dif, hlf); Interval sum2 = ia_add(x2, hlf); Interval res = ia_div(ia_sqrt(sum1), ia_sqrt(sum2)); return (res); } Interval aat_g_ia (Interval x) { return (aat_h_ia(aat_h_ia(x))); } AAP aat_h_aa (AAP x) { AAP x2 = aa_sqr(x); AAP hlf = aa_const(Half, Zero); AAP dif = aa_sub(x2, x); AAP sum1 = aa_add(dif, hlf); AAP sum2 = aa_add(x2, hlf); AAP res = aa_div(aa_sqrt(sum1), aa_sqrt(sum2)); return (res); } AAP aat_g_aa (AAP x) { MemP frame = aa_top(); AAP res = aat_h_aa(aat_h_aa(x)); return (aa_return(frame, res)); } Interval aat_gxd = {-Two, Two}; Interval aat_gyd = {-Half*Quarter, Two}; int aat_gn = 16;