distil 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +28 -0
- data/VERSION +1 -0
- data/bin/distil +45 -0
- data/distil.gemspec +586 -0
- data/lib/bootstrap-template.js +56 -0
- data/lib/configurable.rb +125 -0
- data/lib/file-set.rb +42 -0
- data/lib/file-types/css-file.rb +75 -0
- data/lib/file-types/html-file.rb +11 -0
- data/lib/file-types/javascript-file.rb +98 -0
- data/lib/file-types/json-file.rb +14 -0
- data/lib/file-types/nib-file.rb +9 -0
- data/lib/jsdoc.conf +18 -0
- data/lib/jsl.conf +121 -0
- data/lib/project.rb +96 -0
- data/lib/source-file.rb +181 -0
- data/lib/target.rb +96 -0
- data/lib/task.rb +239 -0
- data/lib/tasks/copy-task.rb +21 -0
- data/lib/tasks/css-task.rb +18 -0
- data/lib/tasks/javascript-task.rb +125 -0
- data/lib/tasks/multiple-output-task.rb +134 -0
- data/lib/tasks/nib-task.rb +83 -0
- data/lib/tasks/output-task.rb +73 -0
- data/lib/tasks/single-output-task.rb +83 -0
- data/lib/tasks/test-task.rb +280 -0
- data/lib/test/HtmlTestReporter.js +127 -0
- data/lib/test/Test.js +248 -0
- data/lib/test/TestReporter.js +79 -0
- data/lib/test/TestRunner.js +132 -0
- data/lib/test/browser.rb +97 -0
- data/lib/test/scriptwrapper.html +10 -0
- data/lib/test/unittest.html +127 -0
- data/vendor/Makefile +35 -0
- data/vendor/extconf.rb +3 -0
- data/vendor/jsdoc-extras/plugins/distil-plugin.js +142 -0
- data/vendor/jsdoc-extras/plugins/interface-plugin.js +36 -0
- data/vendor/jsdoc-extras/templates/coherent/allclasses.tmpl +17 -0
- data/vendor/jsdoc-extras/templates/coherent/allfiles.tmpl +53 -0
- data/vendor/jsdoc-extras/templates/coherent/class.tmpl +803 -0
- data/vendor/jsdoc-extras/templates/coherent/index.tmpl +37 -0
- data/vendor/jsdoc-extras/templates/coherent/publish.js +242 -0
- data/vendor/jsdoc-extras/templates/coherent/showdown.js +421 -0
- data/vendor/jsdoc-extras/templates/coherent/static/code-footer.html +3 -0
- data/vendor/jsdoc-extras/templates/coherent/static/code-header.html +7 -0
- data/vendor/jsdoc-extras/templates/coherent/static/default.css +297 -0
- data/vendor/jsdoc-extras/templates/coherent/static/header.html +2 -0
- data/vendor/jsdoc-extras/templates/coherent/static/index.html +19 -0
- data/vendor/jsdoc-extras/templates/coherent/symbol.tmpl +35 -0
- data/vendor/jsdoc-toolkit/README.txt +183 -0
- data/vendor/jsdoc-toolkit/app/frame/Chain.js +102 -0
- data/vendor/jsdoc-toolkit/app/frame/Dumper.js +144 -0
- data/vendor/jsdoc-toolkit/app/frame/Hash.js +84 -0
- data/vendor/jsdoc-toolkit/app/frame/Link.js +171 -0
- data/vendor/jsdoc-toolkit/app/frame/Namespace.js +10 -0
- data/vendor/jsdoc-toolkit/app/frame/Opt.js +134 -0
- data/vendor/jsdoc-toolkit/app/frame/Reflection.js +26 -0
- data/vendor/jsdoc-toolkit/app/frame/String.js +93 -0
- data/vendor/jsdoc-toolkit/app/frame/Testrun.js +129 -0
- data/vendor/jsdoc-toolkit/app/frame.js +33 -0
- data/vendor/jsdoc-toolkit/app/handlers/FOODOC.js +26 -0
- data/vendor/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +159 -0
- data/vendor/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +16 -0
- data/vendor/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +292 -0
- data/vendor/jsdoc-toolkit/app/handlers/XMLDOC.js +26 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +204 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +300 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +126 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +109 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Lang.js +144 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Parser.js +144 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +33 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +644 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +241 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +41 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Token.js +18 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +332 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +133 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Util.js +32 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Walker.js +499 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC.js +106 -0
- data/vendor/jsdoc-toolkit/app/main.js +129 -0
- data/vendor/jsdoc-toolkit/app/plugins/commentSrcJson.js +20 -0
- data/vendor/jsdoc-toolkit/app/plugins/frameworkPrototype.js +16 -0
- data/vendor/jsdoc-toolkit/app/plugins/functionCall.js +10 -0
- data/vendor/jsdoc-toolkit/app/plugins/publishSrcHilite.js +54 -0
- data/vendor/jsdoc-toolkit/app/plugins/symbolLink.js +10 -0
- data/vendor/jsdoc-toolkit/app/plugins/tagParamConfig.js +31 -0
- data/vendor/jsdoc-toolkit/app/plugins/tagSynonyms.js +43 -0
- data/vendor/jsdoc-toolkit/app/run.js +348 -0
- data/vendor/jsdoc-toolkit/app/t/TestDoc.js +144 -0
- data/vendor/jsdoc-toolkit/app/t/runner.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/addon.js +24 -0
- data/vendor/jsdoc-toolkit/app/test/anon_inner.js +14 -0
- data/vendor/jsdoc-toolkit/app/test/augments.js +31 -0
- data/vendor/jsdoc-toolkit/app/test/augments2.js +26 -0
- data/vendor/jsdoc-toolkit/app/test/borrows.js +46 -0
- data/vendor/jsdoc-toolkit/app/test/borrows2.js +23 -0
- data/vendor/jsdoc-toolkit/app/test/config.js +22 -0
- data/vendor/jsdoc-toolkit/app/test/constructs.js +18 -0
- data/vendor/jsdoc-toolkit/app/test/encoding.js +10 -0
- data/vendor/jsdoc-toolkit/app/test/encoding_other.js +12 -0
- data/vendor/jsdoc-toolkit/app/test/event.js +54 -0
- data/vendor/jsdoc-toolkit/app/test/exports.js +14 -0
- data/vendor/jsdoc-toolkit/app/test/functions_anon.js +39 -0
- data/vendor/jsdoc-toolkit/app/test/functions_nested.js +33 -0
- data/vendor/jsdoc-toolkit/app/test/global.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/globals.js +25 -0
- data/vendor/jsdoc-toolkit/app/test/ignore.js +10 -0
- data/vendor/jsdoc-toolkit/app/test/inner.js +16 -0
- data/vendor/jsdoc-toolkit/app/test/jsdoc_test.js +477 -0
- data/vendor/jsdoc-toolkit/app/test/lend.js +33 -0
- data/vendor/jsdoc-toolkit/app/test/memberof.js +19 -0
- data/vendor/jsdoc-toolkit/app/test/memberof2.js +38 -0
- data/vendor/jsdoc-toolkit/app/test/memberof3.js +33 -0
- data/vendor/jsdoc-toolkit/app/test/memberof_constructor.js +17 -0
- data/vendor/jsdoc-toolkit/app/test/module.js +17 -0
- data/vendor/jsdoc-toolkit/app/test/name.js +19 -0
- data/vendor/jsdoc-toolkit/app/test/namespace_nested.js +23 -0
- data/vendor/jsdoc-toolkit/app/test/nocode.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/oblit_anon.js +20 -0
- data/vendor/jsdoc-toolkit/app/test/overview.js +20 -0
- data/vendor/jsdoc-toolkit/app/test/param_inline.js +37 -0
- data/vendor/jsdoc-toolkit/app/test/params_optional.js +8 -0
- data/vendor/jsdoc-toolkit/app/test/prototype.js +17 -0
- data/vendor/jsdoc-toolkit/app/test/prototype_nested.js +9 -0
- data/vendor/jsdoc-toolkit/app/test/prototype_oblit.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +24 -0
- data/vendor/jsdoc-toolkit/app/test/public.js +10 -0
- data/vendor/jsdoc-toolkit/app/test/scripts/code.js +5 -0
- data/vendor/jsdoc-toolkit/app/test/scripts/notcode.txt +5 -0
- data/vendor/jsdoc-toolkit/app/test/shared.js +42 -0
- data/vendor/jsdoc-toolkit/app/test/shared2.js +2 -0
- data/vendor/jsdoc-toolkit/app/test/shortcuts.js +22 -0
- data/vendor/jsdoc-toolkit/app/test/static_this.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/synonyms.js +31 -0
- data/vendor/jsdoc-toolkit/app/test/tosource.js +23 -0
- data/vendor/jsdoc-toolkit/app/test/variable_redefine.js +14 -0
- data/vendor/jsdoc-toolkit/app/test.js +342 -0
- data/vendor/jsdoc-toolkit/changes.txt +116 -0
- data/vendor/jsdoc-toolkit/conf/sample.conf +31 -0
- data/vendor/jsdoc-toolkit/java/build.xml +36 -0
- data/vendor/jsdoc-toolkit/java/build_1.4.xml +36 -0
- data/vendor/jsdoc-toolkit/java/classes/js.jar +0 -0
- data/vendor/jsdoc-toolkit/java/src/JsDebugRun.java +21 -0
- data/vendor/jsdoc-toolkit/java/src/JsRun.java +21 -0
- data/vendor/jsdoc-toolkit/jsdebug.jar +0 -0
- data/vendor/jsdoc-toolkit/jsrun.jar +0 -0
- data/vendor/jsdoc-toolkit/jsrun.sh +53 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +17 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +56 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/class.tmpl +649 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/index.tmpl +39 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/publish.js +201 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/code-footer.html +3 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/code-header.html +14 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/default.css +162 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/header.html +2 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/index.html +19 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +35 -0
- data/vendor/jsl-0.3.0/src/JavaScriptLintAPI.cpp +333 -0
- data/vendor/jsl-0.3.0/src/JavaScriptLintAPI.h +86 -0
- data/vendor/jsl-0.3.0/src/Makefile.in +375 -0
- data/vendor/jsl-0.3.0/src/Makefile.ref +372 -0
- data/vendor/jsl-0.3.0/src/README.html +826 -0
- data/vendor/jsl-0.3.0/src/SpiderMonkey.rsp +12 -0
- data/vendor/jsl-0.3.0/src/_jsl_online.php +223 -0
- data/vendor/jsl-0.3.0/src/config/AIX4.1.mk +65 -0
- data/vendor/jsl-0.3.0/src/config/AIX4.2.mk +64 -0
- data/vendor/jsl-0.3.0/src/config/AIX4.3.mk +65 -0
- data/vendor/jsl-0.3.0/src/config/Darwin.mk +81 -0
- data/vendor/jsl-0.3.0/src/config/Darwin1.3.mk +81 -0
- data/vendor/jsl-0.3.0/src/config/Darwin1.4.mk +41 -0
- data/vendor/jsl-0.3.0/src/config/Darwin5.2.mk +81 -0
- data/vendor/jsl-0.3.0/src/config/Darwin5.3.mk +81 -0
- data/vendor/jsl-0.3.0/src/config/HP-UXB.10.10.mk +77 -0
- data/vendor/jsl-0.3.0/src/config/HP-UXB.10.20.mk +77 -0
- data/vendor/jsl-0.3.0/src/config/HP-UXB.11.00.mk +80 -0
- data/vendor/jsl-0.3.0/src/config/IRIX.mk +87 -0
- data/vendor/jsl-0.3.0/src/config/IRIX5.3.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/IRIX6.1.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/IRIX6.2.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/IRIX6.3.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/IRIX6.5.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/Linux_All.mk +103 -0
- data/vendor/jsl-0.3.0/src/config/Mac_OS10.0.mk +82 -0
- data/vendor/jsl-0.3.0/src/config/OSF1V4.0.mk +72 -0
- data/vendor/jsl-0.3.0/src/config/OSF1V5.0.mk +69 -0
- data/vendor/jsl-0.3.0/src/config/SunOS4.1.4.mk +101 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.3.mk +91 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.4.mk +92 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.5.1.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.5.mk +87 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.6.mk +89 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.7.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.8.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.9.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/WINNT4.0.mk +112 -0
- data/vendor/jsl-0.3.0/src/config/WINNT5.0.mk +112 -0
- data/vendor/jsl-0.3.0/src/config/WINNT5.1.mk +112 -0
- data/vendor/jsl-0.3.0/src/config/WINNT5.2.mk +112 -0
- data/vendor/jsl-0.3.0/src/config/dgux.mk +64 -0
- data/vendor/jsl-0.3.0/src/config.mk +166 -0
- data/vendor/jsl-0.3.0/src/editline/Makefile.ref +144 -0
- data/vendor/jsl-0.3.0/src/editline/README +83 -0
- data/vendor/jsl-0.3.0/src/editline/editline.3 +175 -0
- data/vendor/jsl-0.3.0/src/editline/editline.c +1369 -0
- data/vendor/jsl-0.3.0/src/editline/editline.h +135 -0
- data/vendor/jsl-0.3.0/src/editline/sysunix.c +182 -0
- data/vendor/jsl-0.3.0/src/editline/unix.h +82 -0
- data/vendor/jsl-0.3.0/src/fdlibm/Makefile.in +127 -0
- data/vendor/jsl-0.3.0/src/fdlibm/Makefile.ref +192 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_acos.c +147 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_acosh.c +105 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_asin.c +156 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_atan2.c +165 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_atanh.c +110 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_cosh.c +133 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_exp.c +202 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_fmod.c +184 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_gamma.c +71 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_gamma_r.c +70 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_hypot.c +173 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_j0.c +524 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_j1.c +523 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_jn.c +315 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_lgamma.c +71 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_lgamma_r.c +347 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_log.c +184 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_log10.c +134 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_pow.c +386 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_rem_pio2.c +221 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_remainder.c +120 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_scalb.c +89 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_sinh.c +122 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_sqrt.c +497 -0
- data/vendor/jsl-0.3.0/src/fdlibm/fdlibm.dsp +160 -0
- data/vendor/jsl-0.3.0/src/fdlibm/fdlibm.h +273 -0
- data/vendor/jsl-0.3.0/src/fdlibm/fdlibm.mak +1453 -0
- data/vendor/jsl-0.3.0/src/fdlibm/fdlibm.mdp +0 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_cos.c +134 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_rem_pio2.c +354 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_sin.c +114 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_standard.c +785 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_tan.c +170 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_asinh.c +101 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_atan.c +175 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_cbrt.c +133 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_ceil.c +120 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_copysign.c +72 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_cos.c +118 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_erf.c +356 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_expm1.c +267 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_fabs.c +70 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_finite.c +71 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_floor.c +121 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_frexp.c +99 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_ilogb.c +85 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_isnan.c +74 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_ldexp.c +66 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_lib_version.c +73 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_log1p.c +211 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_logb.c +79 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_matherr.c +64 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_modf.c +132 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_nextafter.c +124 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_rint.c +131 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_scalbn.c +107 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_signgam.c +40 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_significand.c +68 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_sin.c +118 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_tan.c +112 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_tanh.c +122 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_acos.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_acosh.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_asin.c +80 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_atan2.c +79 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_atanh.c +81 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_cosh.c +77 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_exp.c +88 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_fmod.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_gamma.c +85 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_gamma_r.c +81 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_hypot.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_j0.c +105 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_j1.c +106 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_jn.c +128 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_lgamma.c +85 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_lgamma_r.c +81 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_log.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_log10.c +81 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_pow.c +99 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_remainder.c +77 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_scalb.c +95 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_sinh.c +77 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_sqrt.c +77 -0
- data/vendor/jsl-0.3.0/src/js.c +2447 -0
- data/vendor/jsl-0.3.0/src/js.dsp +420 -0
- data/vendor/jsl-0.3.0/src/js.mak +4025 -0
- data/vendor/jsl-0.3.0/src/js.mdp +0 -0
- data/vendor/jsl-0.3.0/src/js.msg +291 -0
- data/vendor/jsl-0.3.0/src/js.pkg +2 -0
- data/vendor/jsl-0.3.0/src/js3240.rc +79 -0
- data/vendor/jsl-0.3.0/src/jsOS240.def +654 -0
- data/vendor/jsl-0.3.0/src/jsapi.c +4405 -0
- data/vendor/jsl-0.3.0/src/jsapi.h +1856 -0
- data/vendor/jsl-0.3.0/src/jsarena.c +567 -0
- data/vendor/jsl-0.3.0/src/jsarena.h +302 -0
- data/vendor/jsl-0.3.0/src/jsarray.c +1428 -0
- data/vendor/jsl-0.3.0/src/jsarray.h +77 -0
- data/vendor/jsl-0.3.0/src/jsatom.c +927 -0
- data/vendor/jsl-0.3.0/src/jsatom.h +426 -0
- data/vendor/jsl-0.3.0/src/jsbit.h +113 -0
- data/vendor/jsl-0.3.0/src/jsbool.c +220 -0
- data/vendor/jsl-0.3.0/src/jsbool.h +62 -0
- data/vendor/jsl-0.3.0/src/jsclist.h +139 -0
- data/vendor/jsl-0.3.0/src/jscntxt.c +1036 -0
- data/vendor/jsl-0.3.0/src/jscntxt.h +608 -0
- data/vendor/jsl-0.3.0/src/jscompat.h +57 -0
- data/vendor/jsl-0.3.0/src/jsconfig.h +489 -0
- data/vendor/jsl-0.3.0/src/jsconfig.mk +181 -0
- data/vendor/jsl-0.3.0/src/jscpucfg.c +377 -0
- data/vendor/jsl-0.3.0/src/jscpucfg.h +204 -0
- data/vendor/jsl-0.3.0/src/jsdate.c +2238 -0
- data/vendor/jsl-0.3.0/src/jsdate.h +118 -0
- data/vendor/jsl-0.3.0/src/jsdbgapi.c +1260 -0
- data/vendor/jsl-0.3.0/src/jsdbgapi.h +345 -0
- data/vendor/jsl-0.3.0/src/jsdhash.c +763 -0
- data/vendor/jsl-0.3.0/src/jsdhash.h +579 -0
- data/vendor/jsl-0.3.0/src/jsdtoa.c +3135 -0
- data/vendor/jsl-0.3.0/src/jsdtoa.h +130 -0
- data/vendor/jsl-0.3.0/src/jsemit.c +4851 -0
- data/vendor/jsl-0.3.0/src/jsemit.h +576 -0
- data/vendor/jsl-0.3.0/src/jsexn.c +1084 -0
- data/vendor/jsl-0.3.0/src/jsexn.h +102 -0
- data/vendor/jsl-0.3.0/src/jsfile.c +2610 -0
- data/vendor/jsl-0.3.0/src/jsfile.h +50 -0
- data/vendor/jsl-0.3.0/src/jsfile.msg +89 -0
- data/vendor/jsl-0.3.0/src/jsfun.c +2015 -0
- data/vendor/jsl-0.3.0/src/jsfun.h +158 -0
- data/vendor/jsl-0.3.0/src/jsgc.c +1441 -0
- data/vendor/jsl-0.3.0/src/jsgc.h +230 -0
- data/vendor/jsl-0.3.0/src/jshash.c +471 -0
- data/vendor/jsl-0.3.0/src/jshash.h +152 -0
- data/vendor/jsl-0.3.0/src/jsify.pl +485 -0
- data/vendor/jsl-0.3.0/src/jsinterp.c +4797 -0
- data/vendor/jsl-0.3.0/src/jsinterp.h +302 -0
- data/vendor/jsl-0.3.0/src/jsl-test.js +28 -0
- data/vendor/jsl-0.3.0/src/jsl.c +2371 -0
- data/vendor/jsl-0.3.0/src/jsl.conf +127 -0
- data/vendor/jsl-0.3.0/src/jsl.conf.old +124 -0
- data/vendor/jsl-0.3.0/src/jsl.dsp +242 -0
- data/vendor/jsl-0.3.0/src/jsl.dsw +59 -0
- data/vendor/jsl-0.3.0/src/jslibmath.h +290 -0
- data/vendor/jsl-0.3.0/src/jslock.c +1261 -0
- data/vendor/jsl-0.3.0/src/jslock.h +289 -0
- data/vendor/jsl-0.3.0/src/jslocko.asm +59 -0
- data/vendor/jsl-0.3.0/src/jslog2.c +83 -0
- data/vendor/jsl-0.3.0/src/jslong.c +281 -0
- data/vendor/jsl-0.3.0/src/jslong.h +437 -0
- data/vendor/jsl-0.3.0/src/jsmath.c +477 -0
- data/vendor/jsl-0.3.0/src/jsmath.h +55 -0
- data/vendor/jsl-0.3.0/src/jsnum.c +1148 -0
- data/vendor/jsl-0.3.0/src/jsnum.h +257 -0
- data/vendor/jsl-0.3.0/src/jsobj.c +4066 -0
- data/vendor/jsl-0.3.0/src/jsobj.h +475 -0
- data/vendor/jsl-0.3.0/src/jsopcode.c +2730 -0
- data/vendor/jsl-0.3.0/src/jsopcode.h +275 -0
- data/vendor/jsl-0.3.0/src/jsopcode.tbl +344 -0
- data/vendor/jsl-0.3.0/src/jsosdep.h +127 -0
- data/vendor/jsl-0.3.0/src/jsotypes.h +211 -0
- data/vendor/jsl-0.3.0/src/jsparse.c +4438 -0
- data/vendor/jsl-0.3.0/src/jsparse.h +345 -0
- data/vendor/jsl-0.3.0/src/jsprf.c +1212 -0
- data/vendor/jsl-0.3.0/src/jsprf.h +148 -0
- data/vendor/jsl-0.3.0/src/jsprvtd.h +174 -0
- data/vendor/jsl-0.3.0/src/jspubtd.h +586 -0
- data/vendor/jsl-0.3.0/src/jsregexp.c +3831 -0
- data/vendor/jsl-0.3.0/src/jsregexp.h +180 -0
- data/vendor/jsl-0.3.0/src/jsscan.c +1814 -0
- data/vendor/jsl-0.3.0/src/jsscan.h +267 -0
- data/vendor/jsl-0.3.0/src/jsscope.c +1639 -0
- data/vendor/jsl-0.3.0/src/jsscope.h +389 -0
- data/vendor/jsl-0.3.0/src/jsscript.c +1284 -0
- data/vendor/jsl-0.3.0/src/jsscript.h +179 -0
- data/vendor/jsl-0.3.0/src/jsshell.msg +50 -0
- data/vendor/jsl-0.3.0/src/jsstddef.h +83 -0
- data/vendor/jsl-0.3.0/src/jsstr.c +4502 -0
- data/vendor/jsl-0.3.0/src/jsstr.h +448 -0
- data/vendor/jsl-0.3.0/src/jstypes.h +391 -0
- data/vendor/jsl-0.3.0/src/jsutil.c +157 -0
- data/vendor/jsl-0.3.0/src/jsutil.h +75 -0
- data/vendor/jsl-0.3.0/src/jsxdrapi.c +686 -0
- data/vendor/jsl-0.3.0/src/jsxdrapi.h +193 -0
- data/vendor/jsl-0.3.0/src/liveconnect/LiveConnect.dsp +157 -0
- data/vendor/jsl-0.3.0/src/liveconnect/LiveConnectShell.dsp +120 -0
- data/vendor/jsl-0.3.0/src/liveconnect/LiveConnectShell.dsw +44 -0
- data/vendor/jsl-0.3.0/src/liveconnect/Makefile.in +106 -0
- data/vendor/jsl-0.3.0/src/liveconnect/Makefile.ref +169 -0
- data/vendor/jsl-0.3.0/src/liveconnect/README.html +719 -0
- data/vendor/jsl-0.3.0/src/liveconnect/_jni/netscape_javascript_JSException.h +14 -0
- data/vendor/jsl-0.3.0/src/liveconnect/_jni/netscape_javascript_JSObject.h +155 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/Makefile.in +89 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/Makefile.ref +57 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/Makefile.ref +47 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSException.java +140 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSObject.java +183 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSProxy.java +58 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSRunnable.java +70 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSUtil.java +59 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/Makefile.ref +53 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/AIX4.1.mk +45 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/AIX4.2.mk +45 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/AIX4.3.mk +50 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/HP-UXB.10.10.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/HP-UXB.10.20.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/HP-UXB.11.00.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/IRIX6.2.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/IRIX6.3.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/IRIX6.5.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/Linux_All.mk +73 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/OSF1V4.0.mk +65 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/OSF1V5.0.mk +62 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/SunOS5.5.1.mk +55 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/SunOS5.6.mk +39 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/SunOS5.7.mk +39 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/SunOS5.8.mk +39 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/WINNT4.0.mk +53 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj.c +884 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj.msg +98 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JSObject.c +1379 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaArray.c +481 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaClass.c +749 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaMember.c +186 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaObject.c +1099 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaPackage.c +548 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_array.c +207 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_class.c +765 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_convert.c +954 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_field.c +421 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_hash.c +504 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_hash.h +161 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_method.c +1823 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_nodl.c +1 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_private.h +689 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_simpleapi.c +219 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_utils.c +513 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsjava.h +313 -0
- data/vendor/jsl-0.3.0/src/liveconnect/liveconnect.pkg +3 -0
- data/vendor/jsl-0.3.0/src/liveconnect/netscape_javascript_JSObject.h +155 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsCLiveconnect.cpp +785 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsCLiveconnect.h +197 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsCLiveconnectFactory.cpp +163 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsCLiveconnectFactory.h +76 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsILiveconnect.h +195 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsISecureLiveconnect.h +84 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsISecurityContext.h +135 -0
- data/vendor/jsl-0.3.0/src/liveconnect/win32.order +6 -0
- data/vendor/jsl-0.3.0/src/lock_SunOS.s +114 -0
- data/vendor/jsl-0.3.0/src/perfect.js +39 -0
- data/vendor/jsl-0.3.0/src/perlconnect/JS.def +6 -0
- data/vendor/jsl-0.3.0/src/perlconnect/JS.dsp +107 -0
- data/vendor/jsl-0.3.0/src/perlconnect/JS.pm +318 -0
- data/vendor/jsl-0.3.0/src/perlconnect/JS.xs +1050 -0
- data/vendor/jsl-0.3.0/src/perlconnect/Makefile.PL +67 -0
- data/vendor/jsl-0.3.0/src/perlconnect/Makefile.ref +152 -0
- data/vendor/jsl-0.3.0/src/perlconnect/PerlConnect.dsp +103 -0
- data/vendor/jsl-0.3.0/src/perlconnect/PerlConnect.dsw +59 -0
- data/vendor/jsl-0.3.0/src/perlconnect/PerlConnect.pm +126 -0
- data/vendor/jsl-0.3.0/src/perlconnect/PerlConnectShell.dsp +89 -0
- data/vendor/jsl-0.3.0/src/perlconnect/README.html +345 -0
- data/vendor/jsl-0.3.0/src/perlconnect/bg.jpg +0 -0
- data/vendor/jsl-0.3.0/src/perlconnect/jsperl.c +1100 -0
- data/vendor/jsl-0.3.0/src/perlconnect/jsperl.h +52 -0
- data/vendor/jsl-0.3.0/src/perlconnect/jsperlbuild.pl +81 -0
- data/vendor/jsl-0.3.0/src/perlconnect/jsperlpvt.h +57 -0
- data/vendor/jsl-0.3.0/src/perlconnect/test.js +73 -0
- data/vendor/jsl-0.3.0/src/perlconnect/test.pl +244 -0
- data/vendor/jsl-0.3.0/src/perlconnect/typemap +121 -0
- data/vendor/jsl-0.3.0/src/plify_jsdhash.sed +31 -0
- data/vendor/jsl-0.3.0/src/prmjtime.c +646 -0
- data/vendor/jsl-0.3.0/src/prmjtime.h +95 -0
- data/vendor/jsl-0.3.0/src/resource.h +15 -0
- data/vendor/jsl-0.3.0/src/rules.mk +193 -0
- data/vendor/jsl-0.3.0/src/win32.order +391 -0
- data/vendor/jsl-0.3.0/tests/conf/always_use_option_explicit.js +4 -0
- data/vendor/jsl-0.3.0/tests/conf/define.js +8 -0
- data/vendor/jsl-0.3.0/tests/conf/jscript_function_extensions-1.js +7 -0
- data/vendor/jsl-0.3.0/tests/conf/jscript_function_extensions-2.js +8 -0
- data/vendor/jsl-0.3.0/tests/conf/jscript_function_extensions-3.js +27 -0
- data/vendor/jsl-0.3.0/tests/conf/jscript_function_extensions-4.js +4 -0
- data/vendor/jsl-0.3.0/tests/conf/lambda_assign_requires_semicolon.js +24 -0
- data/vendor/jsl-0.3.0/tests/conf/legacy_control_comments.js +8 -0
- data/vendor/jsl-0.3.0/tests/control_comments/control_comments.js +33 -0
- data/vendor/jsl-0.3.0/tests/control_comments/declare.js +26 -0
- data/vendor/jsl-0.3.0/tests/control_comments/import-overflow.js +9 -0
- data/vendor/jsl-0.3.0/tests/control_comments/import.js +5 -0
- data/vendor/jsl-0.3.0/tests/control_comments/import2.js +2 -0
- data/vendor/jsl-0.3.0/tests/control_comments/invalid_fallthru.js +13 -0
- data/vendor/jsl-0.3.0/tests/control_comments/option_explicit-with.js +12 -0
- data/vendor/jsl-0.3.0/tests/control_comments/option_explicit.js +64 -0
- data/vendor/jsl-0.3.0/tests/errors/unterminated_comment.js +8 -0
- data/vendor/jsl-0.3.0/tests/html/script_tag_in_js_literal.html +14 -0
- data/vendor/jsl-0.3.0/tests/run_tests.pl +71 -0
- data/vendor/jsl-0.3.0/tests/warnings/ambiguous_else_stmt.js +21 -0
- data/vendor/jsl-0.3.0/tests/warnings/ambiguous_nested_stmt.js +66 -0
- data/vendor/jsl-0.3.0/tests/warnings/ambiguous_newline.js +261 -0
- data/vendor/jsl-0.3.0/tests/warnings/anon_no_return_value.js +26 -0
- data/vendor/jsl-0.3.0/tests/warnings/assign_to_function_call.js +16 -0
- data/vendor/jsl-0.3.0/tests/warnings/block_without_braces.js +13 -0
- data/vendor/jsl-0.3.0/tests/warnings/comma_separated_stmts.js +17 -0
- data/vendor/jsl-0.3.0/tests/warnings/comparison_type_conv.js +44 -0
- data/vendor/jsl-0.3.0/tests/warnings/default_not_at_end.js +15 -0
- data/vendor/jsl-0.3.0/tests/warnings/dup_option_explicit.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/duplicate_case_in_switch.js +62 -0
- data/vendor/jsl-0.3.0/tests/warnings/duplicate_formal.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/empty_statement.js +29 -0
- data/vendor/jsl-0.3.0/tests/warnings/equal_as_assign.js +7 -0
- data/vendor/jsl-0.3.0/tests/warnings/inc_dec_within_stmt-ignore.js +21 -0
- data/vendor/jsl-0.3.0/tests/warnings/inc_dec_within_stmt.js +63 -0
- data/vendor/jsl-0.3.0/tests/warnings/jsl_cc_not_understood.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/leading_decimal_point.js +7 -0
- data/vendor/jsl-0.3.0/tests/warnings/legacy_cc_not_understood.js +9 -0
- data/vendor/jsl-0.3.0/tests/warnings/meaningless_block.js +12 -0
- data/vendor/jsl-0.3.0/tests/warnings/misplaced_regex.js +20 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_break.js +87 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_break_for_last_case.js +19 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_default_case.js +51 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_option_explicit.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_semicolon.js +19 -0
- data/vendor/jsl-0.3.0/tests/warnings/multiple_plus_minus.js +10 -0
- data/vendor/jsl-0.3.0/tests/warnings/nested_comment.js +6 -0
- data/vendor/jsl-0.3.0/tests/warnings/no_return_value.js +25 -0
- data/vendor/jsl-0.3.0/tests/warnings/octal_number.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/parseint_missing_radix.js +15 -0
- data/vendor/jsl-0.3.0/tests/warnings/partial_option_explicit.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/redeclared_var.js +10 -0
- data/vendor/jsl-0.3.0/tests/warnings/spidermonkey/bad_backref.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/spidermonkey/deprecated_usage.js +11 -0
- data/vendor/jsl-0.3.0/tests/warnings/spidermonkey/invalid_backref.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/spidermonkey/trailing_comma.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/trailing_comma_in_array.js +8 -0
- data/vendor/jsl-0.3.0/tests/warnings/trailing_decimal_point.js +7 -0
- data/vendor/jsl-0.3.0/tests/warnings/unreachable_code.js +29 -0
- data/vendor/jsl-0.3.0/tests/warnings/use_of_label.js +19 -0
- data/vendor/jsl-0.3.0/tests/warnings/useless_assign.js +20 -0
- data/vendor/jsl-0.3.0/tests/warnings/useless_comparison.js +55 -0
- data/vendor/jsl-0.3.0/tests/warnings/useless_void.js +6 -0
- data/vendor/jsl-0.3.0/tests/warnings/var_hides_arg.js +4 -0
- data/vendor/jsl-0.3.0/tests/warnings/with_statement.js +7 -0
- data/vendor/yuicompressor-2.4.2.jar +0 -0
- metadata +605 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
2
|
+
*
|
|
3
|
+
* ***** BEGIN LICENSE BLOCK *****
|
|
4
|
+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
5
|
+
*
|
|
6
|
+
* The contents of this file are subject to the Mozilla Public License Version
|
|
7
|
+
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
* http://www.mozilla.org/MPL/
|
|
10
|
+
*
|
|
11
|
+
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
12
|
+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
13
|
+
* for the specific language governing rights and limitations under the
|
|
14
|
+
* License.
|
|
15
|
+
*
|
|
16
|
+
* The Original Code is Mozilla Communicator client code, released
|
|
17
|
+
* March 31, 1998.
|
|
18
|
+
*
|
|
19
|
+
* The Initial Developer of the Original Code is
|
|
20
|
+
* Sun Microsystems, Inc.
|
|
21
|
+
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
22
|
+
* the Initial Developer. All Rights Reserved.
|
|
23
|
+
*
|
|
24
|
+
* Contributor(s):
|
|
25
|
+
*
|
|
26
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
27
|
+
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
28
|
+
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
29
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
30
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
31
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
32
|
+
* use your version of this file under the terms of the MPL, indicate your
|
|
33
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
34
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
35
|
+
* the provisions above, a recipient may use your version of this file under
|
|
36
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
37
|
+
*
|
|
38
|
+
* ***** END LICENSE BLOCK ***** */
|
|
39
|
+
|
|
40
|
+
/* @(#)e_lgamma_r.c 1.3 95/01/18 */
|
|
41
|
+
/*
|
|
42
|
+
* ====================================================
|
|
43
|
+
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
44
|
+
*
|
|
45
|
+
* Developed at SunSoft, a Sun Microsystems, Inc. business.
|
|
46
|
+
* Permission to use, copy, modify, and distribute this
|
|
47
|
+
* software is freely granted, provided that this notice
|
|
48
|
+
* is preserved.
|
|
49
|
+
* ====================================================
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
/* __ieee754_lgamma_r(x, signgamp)
|
|
54
|
+
* Reentrant version of the logarithm of the Gamma function
|
|
55
|
+
* with user provide pointer for the sign of Gamma(x).
|
|
56
|
+
*
|
|
57
|
+
* Method:
|
|
58
|
+
* 1. Argument Reduction for 0 < x <= 8
|
|
59
|
+
* Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
|
|
60
|
+
* reduce x to a number in [1.5,2.5] by
|
|
61
|
+
* lgamma(1+s) = log(s) + lgamma(s)
|
|
62
|
+
* for example,
|
|
63
|
+
* lgamma(7.3) = log(6.3) + lgamma(6.3)
|
|
64
|
+
* = log(6.3*5.3) + lgamma(5.3)
|
|
65
|
+
* = log(6.3*5.3*4.3*3.3*2.3) + lgamma(2.3)
|
|
66
|
+
* 2. Polynomial approximation of lgamma around its
|
|
67
|
+
* minimun ymin=1.461632144968362245 to maintain monotonicity.
|
|
68
|
+
* On [ymin-0.23, ymin+0.27] (i.e., [1.23164,1.73163]), use
|
|
69
|
+
* Let z = x-ymin;
|
|
70
|
+
* lgamma(x) = -1.214862905358496078218 + z^2*poly(z)
|
|
71
|
+
* where
|
|
72
|
+
* poly(z) is a 14 degree polynomial.
|
|
73
|
+
* 2. Rational approximation in the primary interval [2,3]
|
|
74
|
+
* We use the following approximation:
|
|
75
|
+
* s = x-2.0;
|
|
76
|
+
* lgamma(x) = 0.5*s + s*P(s)/Q(s)
|
|
77
|
+
* with accuracy
|
|
78
|
+
* |P/Q - (lgamma(x)-0.5s)| < 2**-61.71
|
|
79
|
+
* Our algorithms are based on the following observation
|
|
80
|
+
*
|
|
81
|
+
* zeta(2)-1 2 zeta(3)-1 3
|
|
82
|
+
* lgamma(2+s) = s*(1-Euler) + --------- * s - --------- * s + ...
|
|
83
|
+
* 2 3
|
|
84
|
+
*
|
|
85
|
+
* where Euler = 0.5771... is the Euler constant, which is very
|
|
86
|
+
* close to 0.5.
|
|
87
|
+
*
|
|
88
|
+
* 3. For x>=8, we have
|
|
89
|
+
* lgamma(x)~(x-0.5)log(x)-x+0.5*log(2pi)+1/(12x)-1/(360x**3)+....
|
|
90
|
+
* (better formula:
|
|
91
|
+
* lgamma(x)~(x-0.5)*(log(x)-1)-.5*(log(2pi)-1) + ...)
|
|
92
|
+
* Let z = 1/x, then we approximation
|
|
93
|
+
* f(z) = lgamma(x) - (x-0.5)(log(x)-1)
|
|
94
|
+
* by
|
|
95
|
+
* 3 5 11
|
|
96
|
+
* w = w0 + w1*z + w2*z + w3*z + ... + w6*z
|
|
97
|
+
* where
|
|
98
|
+
* |w - f(z)| < 2**-58.74
|
|
99
|
+
*
|
|
100
|
+
* 4. For negative x, since (G is gamma function)
|
|
101
|
+
* -x*G(-x)*G(x) = pi/sin(pi*x),
|
|
102
|
+
* we have
|
|
103
|
+
* G(x) = pi/(sin(pi*x)*(-x)*G(-x))
|
|
104
|
+
* since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0
|
|
105
|
+
* Hence, for x<0, signgam = sign(sin(pi*x)) and
|
|
106
|
+
* lgamma(x) = log(|Gamma(x)|)
|
|
107
|
+
* = log(pi/(|x*sin(pi*x)|)) - lgamma(-x);
|
|
108
|
+
* Note: one should avoid compute pi*(-x) directly in the
|
|
109
|
+
* computation of sin(pi*(-x)).
|
|
110
|
+
*
|
|
111
|
+
* 5. Special Cases
|
|
112
|
+
* lgamma(2+s) ~ s*(1-Euler) for tiny s
|
|
113
|
+
* lgamma(1)=lgamma(2)=0
|
|
114
|
+
* lgamma(x) ~ -log(x) for tiny x
|
|
115
|
+
* lgamma(0) = lgamma(inf) = inf
|
|
116
|
+
* lgamma(-integer) = +-inf
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
#include "fdlibm.h"
|
|
121
|
+
|
|
122
|
+
#ifdef __STDC__
|
|
123
|
+
static const double
|
|
124
|
+
#else
|
|
125
|
+
static double
|
|
126
|
+
#endif
|
|
127
|
+
two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
|
|
128
|
+
half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
|
|
129
|
+
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
|
|
130
|
+
pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
|
|
131
|
+
a0 = 7.72156649015328655494e-02, /* 0x3FB3C467, 0xE37DB0C8 */
|
|
132
|
+
a1 = 3.22467033424113591611e-01, /* 0x3FD4A34C, 0xC4A60FAD */
|
|
133
|
+
a2 = 6.73523010531292681824e-02, /* 0x3FB13E00, 0x1A5562A7 */
|
|
134
|
+
a3 = 2.05808084325167332806e-02, /* 0x3F951322, 0xAC92547B */
|
|
135
|
+
a4 = 7.38555086081402883957e-03, /* 0x3F7E404F, 0xB68FEFE8 */
|
|
136
|
+
a5 = 2.89051383673415629091e-03, /* 0x3F67ADD8, 0xCCB7926B */
|
|
137
|
+
a6 = 1.19270763183362067845e-03, /* 0x3F538A94, 0x116F3F5D */
|
|
138
|
+
a7 = 5.10069792153511336608e-04, /* 0x3F40B6C6, 0x89B99C00 */
|
|
139
|
+
a8 = 2.20862790713908385557e-04, /* 0x3F2CF2EC, 0xED10E54D */
|
|
140
|
+
a9 = 1.08011567247583939954e-04, /* 0x3F1C5088, 0x987DFB07 */
|
|
141
|
+
a10 = 2.52144565451257326939e-05, /* 0x3EFA7074, 0x428CFA52 */
|
|
142
|
+
a11 = 4.48640949618915160150e-05, /* 0x3F07858E, 0x90A45837 */
|
|
143
|
+
tc = 1.46163214496836224576e+00, /* 0x3FF762D8, 0x6356BE3F */
|
|
144
|
+
tf = -1.21486290535849611461e-01, /* 0xBFBF19B9, 0xBCC38A42 */
|
|
145
|
+
/* tt = -(tail of tf) */
|
|
146
|
+
tt = -3.63867699703950536541e-18, /* 0xBC50C7CA, 0xA48A971F */
|
|
147
|
+
t0 = 4.83836122723810047042e-01, /* 0x3FDEF72B, 0xC8EE38A2 */
|
|
148
|
+
t1 = -1.47587722994593911752e-01, /* 0xBFC2E427, 0x8DC6C509 */
|
|
149
|
+
t2 = 6.46249402391333854778e-02, /* 0x3FB08B42, 0x94D5419B */
|
|
150
|
+
t3 = -3.27885410759859649565e-02, /* 0xBFA0C9A8, 0xDF35B713 */
|
|
151
|
+
t4 = 1.79706750811820387126e-02, /* 0x3F9266E7, 0x970AF9EC */
|
|
152
|
+
t5 = -1.03142241298341437450e-02, /* 0xBF851F9F, 0xBA91EC6A */
|
|
153
|
+
t6 = 6.10053870246291332635e-03, /* 0x3F78FCE0, 0xE370E344 */
|
|
154
|
+
t7 = -3.68452016781138256760e-03, /* 0xBF6E2EFF, 0xB3E914D7 */
|
|
155
|
+
t8 = 2.25964780900612472250e-03, /* 0x3F6282D3, 0x2E15C915 */
|
|
156
|
+
t9 = -1.40346469989232843813e-03, /* 0xBF56FE8E, 0xBF2D1AF1 */
|
|
157
|
+
t10 = 8.81081882437654011382e-04, /* 0x3F4CDF0C, 0xEF61A8E9 */
|
|
158
|
+
t11 = -5.38595305356740546715e-04, /* 0xBF41A610, 0x9C73E0EC */
|
|
159
|
+
t12 = 3.15632070903625950361e-04, /* 0x3F34AF6D, 0x6C0EBBF7 */
|
|
160
|
+
t13 = -3.12754168375120860518e-04, /* 0xBF347F24, 0xECC38C38 */
|
|
161
|
+
t14 = 3.35529192635519073543e-04, /* 0x3F35FD3E, 0xE8C2D3F4 */
|
|
162
|
+
u0 = -7.72156649015328655494e-02, /* 0xBFB3C467, 0xE37DB0C8 */
|
|
163
|
+
u1 = 6.32827064025093366517e-01, /* 0x3FE4401E, 0x8B005DFF */
|
|
164
|
+
u2 = 1.45492250137234768737e+00, /* 0x3FF7475C, 0xD119BD6F */
|
|
165
|
+
u3 = 9.77717527963372745603e-01, /* 0x3FEF4976, 0x44EA8450 */
|
|
166
|
+
u4 = 2.28963728064692451092e-01, /* 0x3FCD4EAE, 0xF6010924 */
|
|
167
|
+
u5 = 1.33810918536787660377e-02, /* 0x3F8B678B, 0xBF2BAB09 */
|
|
168
|
+
v1 = 2.45597793713041134822e+00, /* 0x4003A5D7, 0xC2BD619C */
|
|
169
|
+
v2 = 2.12848976379893395361e+00, /* 0x40010725, 0xA42B18F5 */
|
|
170
|
+
v3 = 7.69285150456672783825e-01, /* 0x3FE89DFB, 0xE45050AF */
|
|
171
|
+
v4 = 1.04222645593369134254e-01, /* 0x3FBAAE55, 0xD6537C88 */
|
|
172
|
+
v5 = 3.21709242282423911810e-03, /* 0x3F6A5ABB, 0x57D0CF61 */
|
|
173
|
+
s0 = -7.72156649015328655494e-02, /* 0xBFB3C467, 0xE37DB0C8 */
|
|
174
|
+
s1 = 2.14982415960608852501e-01, /* 0x3FCB848B, 0x36E20878 */
|
|
175
|
+
s2 = 3.25778796408930981787e-01, /* 0x3FD4D98F, 0x4F139F59 */
|
|
176
|
+
s3 = 1.46350472652464452805e-01, /* 0x3FC2BB9C, 0xBEE5F2F7 */
|
|
177
|
+
s4 = 2.66422703033638609560e-02, /* 0x3F9B481C, 0x7E939961 */
|
|
178
|
+
s5 = 1.84028451407337715652e-03, /* 0x3F5E26B6, 0x7368F239 */
|
|
179
|
+
s6 = 3.19475326584100867617e-05, /* 0x3F00BFEC, 0xDD17E945 */
|
|
180
|
+
r1 = 1.39200533467621045958e+00, /* 0x3FF645A7, 0x62C4AB74 */
|
|
181
|
+
r2 = 7.21935547567138069525e-01, /* 0x3FE71A18, 0x93D3DCDC */
|
|
182
|
+
r3 = 1.71933865632803078993e-01, /* 0x3FC601ED, 0xCCFBDF27 */
|
|
183
|
+
r4 = 1.86459191715652901344e-02, /* 0x3F9317EA, 0x742ED475 */
|
|
184
|
+
r5 = 7.77942496381893596434e-04, /* 0x3F497DDA, 0xCA41A95B */
|
|
185
|
+
r6 = 7.32668430744625636189e-06, /* 0x3EDEBAF7, 0xA5B38140 */
|
|
186
|
+
w0 = 4.18938533204672725052e-01, /* 0x3FDACFE3, 0x90C97D69 */
|
|
187
|
+
w1 = 8.33333333333329678849e-02, /* 0x3FB55555, 0x5555553B */
|
|
188
|
+
w2 = -2.77777777728775536470e-03, /* 0xBF66C16C, 0x16B02E5C */
|
|
189
|
+
w3 = 7.93650558643019558500e-04, /* 0x3F4A019F, 0x98CF38B6 */
|
|
190
|
+
w4 = -5.95187557450339963135e-04, /* 0xBF4380CB, 0x8C0FE741 */
|
|
191
|
+
w5 = 8.36339918996282139126e-04, /* 0x3F4B67BA, 0x4CDAD5D1 */
|
|
192
|
+
w6 = -1.63092934096575273989e-03; /* 0xBF5AB89D, 0x0B9E43E4 */
|
|
193
|
+
|
|
194
|
+
static double zero= 0.00000000000000000000e+00;
|
|
195
|
+
|
|
196
|
+
#ifdef __STDC__
|
|
197
|
+
static double sin_pi(double x)
|
|
198
|
+
#else
|
|
199
|
+
static double sin_pi(x)
|
|
200
|
+
double x;
|
|
201
|
+
#endif
|
|
202
|
+
{
|
|
203
|
+
fd_twoints u;
|
|
204
|
+
double y,z;
|
|
205
|
+
int n,ix;
|
|
206
|
+
|
|
207
|
+
u.d = x;
|
|
208
|
+
ix = 0x7fffffff&__HI(u);
|
|
209
|
+
|
|
210
|
+
if(ix<0x3fd00000) return __kernel_sin(pi*x,zero,0);
|
|
211
|
+
y = -x; /* x is assume negative */
|
|
212
|
+
|
|
213
|
+
/*
|
|
214
|
+
* argument reduction, make sure inexact flag not raised if input
|
|
215
|
+
* is an integer
|
|
216
|
+
*/
|
|
217
|
+
z = fd_floor(y);
|
|
218
|
+
if(z!=y) { /* inexact anyway */
|
|
219
|
+
y *= 0.5;
|
|
220
|
+
y = 2.0*(y - fd_floor(y)); /* y = |x| mod 2.0 */
|
|
221
|
+
n = (int) (y*4.0);
|
|
222
|
+
} else {
|
|
223
|
+
if(ix>=0x43400000) {
|
|
224
|
+
y = zero; n = 0; /* y must be even */
|
|
225
|
+
} else {
|
|
226
|
+
if(ix<0x43300000) z = y+two52; /* exact */
|
|
227
|
+
u.d = z;
|
|
228
|
+
n = __LO(u)&1; /* lower word of z */
|
|
229
|
+
y = n;
|
|
230
|
+
n<<= 2;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
switch (n) {
|
|
234
|
+
case 0: y = __kernel_sin(pi*y,zero,0); break;
|
|
235
|
+
case 1:
|
|
236
|
+
case 2: y = __kernel_cos(pi*(0.5-y),zero); break;
|
|
237
|
+
case 3:
|
|
238
|
+
case 4: y = __kernel_sin(pi*(one-y),zero,0); break;
|
|
239
|
+
case 5:
|
|
240
|
+
case 6: y = -__kernel_cos(pi*(y-1.5),zero); break;
|
|
241
|
+
default: y = __kernel_sin(pi*(y-2.0),zero,0); break;
|
|
242
|
+
}
|
|
243
|
+
return -y;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
#ifdef __STDC__
|
|
248
|
+
double __ieee754_lgamma_r(double x, int *signgamp)
|
|
249
|
+
#else
|
|
250
|
+
double __ieee754_lgamma_r(x,signgamp)
|
|
251
|
+
double x; int *signgamp;
|
|
252
|
+
#endif
|
|
253
|
+
{
|
|
254
|
+
fd_twoints u;
|
|
255
|
+
double t,y,z,nadj,p,p1,p2,p3,q,r,w;
|
|
256
|
+
int i,hx,lx,ix;
|
|
257
|
+
|
|
258
|
+
u.d = x;
|
|
259
|
+
hx = __HI(u);
|
|
260
|
+
lx = __LO(u);
|
|
261
|
+
|
|
262
|
+
/* purge off +-inf, NaN, +-0, and negative arguments */
|
|
263
|
+
*signgamp = 1;
|
|
264
|
+
ix = hx&0x7fffffff;
|
|
265
|
+
if(ix>=0x7ff00000) return x*x;
|
|
266
|
+
if((ix|lx)==0) return one/zero;
|
|
267
|
+
if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */
|
|
268
|
+
if(hx<0) {
|
|
269
|
+
*signgamp = -1;
|
|
270
|
+
return -__ieee754_log(-x);
|
|
271
|
+
} else return -__ieee754_log(x);
|
|
272
|
+
}
|
|
273
|
+
if(hx<0) {
|
|
274
|
+
if(ix>=0x43300000) /* |x|>=2**52, must be -integer */
|
|
275
|
+
return one/zero;
|
|
276
|
+
t = sin_pi(x);
|
|
277
|
+
if(t==zero) return one/zero; /* -integer */
|
|
278
|
+
nadj = __ieee754_log(pi/fd_fabs(t*x));
|
|
279
|
+
if(t<zero) *signgamp = -1;
|
|
280
|
+
x = -x;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* purge off 1 and 2 */
|
|
284
|
+
if((((ix-0x3ff00000)|lx)==0)||(((ix-0x40000000)|lx)==0)) r = 0;
|
|
285
|
+
/* for x < 2.0 */
|
|
286
|
+
else if(ix<0x40000000) {
|
|
287
|
+
if(ix<=0x3feccccc) { /* lgamma(x) = lgamma(x+1)-log(x) */
|
|
288
|
+
r = -__ieee754_log(x);
|
|
289
|
+
if(ix>=0x3FE76944) {y = one-x; i= 0;}
|
|
290
|
+
else if(ix>=0x3FCDA661) {y= x-(tc-one); i=1;}
|
|
291
|
+
else {y = x; i=2;}
|
|
292
|
+
} else {
|
|
293
|
+
r = zero;
|
|
294
|
+
if(ix>=0x3FFBB4C3) {y=2.0-x;i=0;} /* [1.7316,2] */
|
|
295
|
+
else if(ix>=0x3FF3B4C4) {y=x-tc;i=1;} /* [1.23,1.73] */
|
|
296
|
+
else {y=x-one;i=2;}
|
|
297
|
+
}
|
|
298
|
+
switch(i) {
|
|
299
|
+
case 0:
|
|
300
|
+
z = y*y;
|
|
301
|
+
p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*a10))));
|
|
302
|
+
p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*a11)))));
|
|
303
|
+
p = y*p1+p2;
|
|
304
|
+
r += (p-0.5*y); break;
|
|
305
|
+
case 1:
|
|
306
|
+
z = y*y;
|
|
307
|
+
w = z*y;
|
|
308
|
+
p1 = t0+w*(t3+w*(t6+w*(t9 +w*t12))); /* parallel comp */
|
|
309
|
+
p2 = t1+w*(t4+w*(t7+w*(t10+w*t13)));
|
|
310
|
+
p3 = t2+w*(t5+w*(t8+w*(t11+w*t14)));
|
|
311
|
+
p = z*p1-(tt-w*(p2+y*p3));
|
|
312
|
+
r += (tf + p); break;
|
|
313
|
+
case 2:
|
|
314
|
+
p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5)))));
|
|
315
|
+
p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5))));
|
|
316
|
+
r += (-0.5*y + p1/p2);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
else if(ix<0x40200000) { /* x < 8.0 */
|
|
320
|
+
i = (int)x;
|
|
321
|
+
t = zero;
|
|
322
|
+
y = x-(double)i;
|
|
323
|
+
p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*s6))))));
|
|
324
|
+
q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*r6)))));
|
|
325
|
+
r = half*y+p/q;
|
|
326
|
+
z = one; /* lgamma(1+s) = log(s) + lgamma(s) */
|
|
327
|
+
switch(i) {
|
|
328
|
+
case 7: z *= (y+6.0); /* FALLTHRU */
|
|
329
|
+
case 6: z *= (y+5.0); /* FALLTHRU */
|
|
330
|
+
case 5: z *= (y+4.0); /* FALLTHRU */
|
|
331
|
+
case 4: z *= (y+3.0); /* FALLTHRU */
|
|
332
|
+
case 3: z *= (y+2.0); /* FALLTHRU */
|
|
333
|
+
r += __ieee754_log(z); break;
|
|
334
|
+
}
|
|
335
|
+
/* 8.0 <= x < 2**58 */
|
|
336
|
+
} else if (ix < 0x43900000) {
|
|
337
|
+
t = __ieee754_log(x);
|
|
338
|
+
z = one/x;
|
|
339
|
+
y = z*z;
|
|
340
|
+
w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6)))));
|
|
341
|
+
r = (x-half)*(t-one)+w;
|
|
342
|
+
} else
|
|
343
|
+
/* 2**58 <= x <= inf */
|
|
344
|
+
r = x*(__ieee754_log(x)-one);
|
|
345
|
+
if(hx<0) r = nadj - r;
|
|
346
|
+
return r;
|
|
347
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
2
|
+
*
|
|
3
|
+
* ***** BEGIN LICENSE BLOCK *****
|
|
4
|
+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
5
|
+
*
|
|
6
|
+
* The contents of this file are subject to the Mozilla Public License Version
|
|
7
|
+
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
* http://www.mozilla.org/MPL/
|
|
10
|
+
*
|
|
11
|
+
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
12
|
+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
13
|
+
* for the specific language governing rights and limitations under the
|
|
14
|
+
* License.
|
|
15
|
+
*
|
|
16
|
+
* The Original Code is Mozilla Communicator client code, released
|
|
17
|
+
* March 31, 1998.
|
|
18
|
+
*
|
|
19
|
+
* The Initial Developer of the Original Code is
|
|
20
|
+
* Sun Microsystems, Inc.
|
|
21
|
+
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
22
|
+
* the Initial Developer. All Rights Reserved.
|
|
23
|
+
*
|
|
24
|
+
* Contributor(s):
|
|
25
|
+
*
|
|
26
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
27
|
+
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
28
|
+
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
29
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
30
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
31
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
32
|
+
* use your version of this file under the terms of the MPL, indicate your
|
|
33
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
34
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
35
|
+
* the provisions above, a recipient may use your version of this file under
|
|
36
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
37
|
+
*
|
|
38
|
+
* ***** END LICENSE BLOCK ***** */
|
|
39
|
+
|
|
40
|
+
/* @(#)e_log.c 1.3 95/01/18 */
|
|
41
|
+
/*
|
|
42
|
+
* ====================================================
|
|
43
|
+
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
44
|
+
*
|
|
45
|
+
* Developed at SunSoft, a Sun Microsystems, Inc. business.
|
|
46
|
+
* Permission to use, copy, modify, and distribute this
|
|
47
|
+
* software is freely granted, provided that this notice
|
|
48
|
+
* is preserved.
|
|
49
|
+
* ====================================================
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/* __ieee754_log(x)
|
|
53
|
+
* Return the logrithm of x
|
|
54
|
+
*
|
|
55
|
+
* Method :
|
|
56
|
+
* 1. Argument Reduction: find k and f such that
|
|
57
|
+
* x = 2^k * (1+f),
|
|
58
|
+
* where sqrt(2)/2 < 1+f < sqrt(2) .
|
|
59
|
+
*
|
|
60
|
+
* 2. Approximation of log(1+f).
|
|
61
|
+
* Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
|
|
62
|
+
* = 2s + 2/3 s**3 + 2/5 s**5 + .....,
|
|
63
|
+
* = 2s + s*R
|
|
64
|
+
* We use a special Reme algorithm on [0,0.1716] to generate
|
|
65
|
+
* a polynomial of degree 14 to approximate R The maximum error
|
|
66
|
+
* of this polynomial approximation is bounded by 2**-58.45. In
|
|
67
|
+
* other words,
|
|
68
|
+
* 2 4 6 8 10 12 14
|
|
69
|
+
* R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
|
|
70
|
+
* (the values of Lg1 to Lg7 are listed in the program)
|
|
71
|
+
* and
|
|
72
|
+
* | 2 14 | -58.45
|
|
73
|
+
* | Lg1*s +...+Lg7*s - R(z) | <= 2
|
|
74
|
+
* | |
|
|
75
|
+
* Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
|
|
76
|
+
* In order to guarantee error in log below 1ulp, we compute log
|
|
77
|
+
* by
|
|
78
|
+
* log(1+f) = f - s*(f - R) (if f is not too large)
|
|
79
|
+
* log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
|
|
80
|
+
*
|
|
81
|
+
* 3. Finally, log(x) = k*ln2 + log(1+f).
|
|
82
|
+
* = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
|
|
83
|
+
* Here ln2 is split into two floating point number:
|
|
84
|
+
* ln2_hi + ln2_lo,
|
|
85
|
+
* where n*ln2_hi is always exact for |n| < 2000.
|
|
86
|
+
*
|
|
87
|
+
* Special cases:
|
|
88
|
+
* log(x) is NaN with signal if x < 0 (including -INF) ;
|
|
89
|
+
* log(+INF) is +INF; log(0) is -INF with signal;
|
|
90
|
+
* log(NaN) is that NaN with no signal.
|
|
91
|
+
*
|
|
92
|
+
* Accuracy:
|
|
93
|
+
* according to an error analysis, the error is always less than
|
|
94
|
+
* 1 ulp (unit in the last place).
|
|
95
|
+
*
|
|
96
|
+
* Constants:
|
|
97
|
+
* The hexadecimal values are the intended ones for the following
|
|
98
|
+
* constants. The decimal values may be used, provided that the
|
|
99
|
+
* compiler will convert from decimal to binary accurately enough
|
|
100
|
+
* to produce the hexadecimal values shown.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
#include "fdlibm.h"
|
|
104
|
+
|
|
105
|
+
#ifdef __STDC__
|
|
106
|
+
static const double
|
|
107
|
+
#else
|
|
108
|
+
static double
|
|
109
|
+
#endif
|
|
110
|
+
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
|
|
111
|
+
ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */
|
|
112
|
+
two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
|
|
113
|
+
Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */
|
|
114
|
+
Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */
|
|
115
|
+
Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */
|
|
116
|
+
Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */
|
|
117
|
+
Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */
|
|
118
|
+
Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */
|
|
119
|
+
Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
|
|
120
|
+
|
|
121
|
+
static double zero = 0.0;
|
|
122
|
+
|
|
123
|
+
#ifdef __STDC__
|
|
124
|
+
double __ieee754_log(double x)
|
|
125
|
+
#else
|
|
126
|
+
double __ieee754_log(x)
|
|
127
|
+
double x;
|
|
128
|
+
#endif
|
|
129
|
+
{
|
|
130
|
+
fd_twoints u;
|
|
131
|
+
double hfsq,f,s,z,R,w,t1,t2,dk;
|
|
132
|
+
int k,hx,i,j;
|
|
133
|
+
unsigned lx;
|
|
134
|
+
|
|
135
|
+
u.d = x;
|
|
136
|
+
hx = __HI(u); /* high word of x */
|
|
137
|
+
lx = __LO(u); /* low word of x */
|
|
138
|
+
|
|
139
|
+
k=0;
|
|
140
|
+
if (hx < 0x00100000) { /* x < 2**-1022 */
|
|
141
|
+
if (((hx&0x7fffffff)|lx)==0)
|
|
142
|
+
return -two54/zero; /* log(+-0)=-inf */
|
|
143
|
+
if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
|
|
144
|
+
k -= 54; x *= two54; /* subnormal number, scale up x */
|
|
145
|
+
u.d = x;
|
|
146
|
+
hx = __HI(u); /* high word of x */
|
|
147
|
+
}
|
|
148
|
+
if (hx >= 0x7ff00000) return x+x;
|
|
149
|
+
k += (hx>>20)-1023;
|
|
150
|
+
hx &= 0x000fffff;
|
|
151
|
+
i = (hx+0x95f64)&0x100000;
|
|
152
|
+
u.d = x;
|
|
153
|
+
__HI(u) = hx|(i^0x3ff00000); /* normalize x or x/2 */
|
|
154
|
+
x = u.d;
|
|
155
|
+
k += (i>>20);
|
|
156
|
+
f = x-1.0;
|
|
157
|
+
if((0x000fffff&(2+hx))<3) { /* |f| < 2**-20 */
|
|
158
|
+
if(f==zero) {
|
|
159
|
+
if(k==0) return zero; else {dk=(double)k;
|
|
160
|
+
return dk*ln2_hi+dk*ln2_lo;}
|
|
161
|
+
}
|
|
162
|
+
R = f*f*(0.5-0.33333333333333333*f);
|
|
163
|
+
if(k==0) return f-R; else {dk=(double)k;
|
|
164
|
+
return dk*ln2_hi-((R-dk*ln2_lo)-f);}
|
|
165
|
+
}
|
|
166
|
+
s = f/(2.0+f);
|
|
167
|
+
dk = (double)k;
|
|
168
|
+
z = s*s;
|
|
169
|
+
i = hx-0x6147a;
|
|
170
|
+
w = z*z;
|
|
171
|
+
j = 0x6b851-hx;
|
|
172
|
+
t1= w*(Lg2+w*(Lg4+w*Lg6));
|
|
173
|
+
t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
|
|
174
|
+
i |= j;
|
|
175
|
+
R = t2+t1;
|
|
176
|
+
if(i>0) {
|
|
177
|
+
hfsq=0.5*f*f;
|
|
178
|
+
if(k==0) return f-(hfsq-s*(hfsq+R)); else
|
|
179
|
+
return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
|
|
180
|
+
} else {
|
|
181
|
+
if(k==0) return f-s*(f-R); else
|
|
182
|
+
return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
2
|
+
*
|
|
3
|
+
* ***** BEGIN LICENSE BLOCK *****
|
|
4
|
+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
5
|
+
*
|
|
6
|
+
* The contents of this file are subject to the Mozilla Public License Version
|
|
7
|
+
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
* http://www.mozilla.org/MPL/
|
|
10
|
+
*
|
|
11
|
+
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
12
|
+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
13
|
+
* for the specific language governing rights and limitations under the
|
|
14
|
+
* License.
|
|
15
|
+
*
|
|
16
|
+
* The Original Code is Mozilla Communicator client code, released
|
|
17
|
+
* March 31, 1998.
|
|
18
|
+
*
|
|
19
|
+
* The Initial Developer of the Original Code is
|
|
20
|
+
* Sun Microsystems, Inc.
|
|
21
|
+
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
22
|
+
* the Initial Developer. All Rights Reserved.
|
|
23
|
+
*
|
|
24
|
+
* Contributor(s):
|
|
25
|
+
*
|
|
26
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
27
|
+
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
28
|
+
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
29
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
30
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
31
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
32
|
+
* use your version of this file under the terms of the MPL, indicate your
|
|
33
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
34
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
35
|
+
* the provisions above, a recipient may use your version of this file under
|
|
36
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
37
|
+
*
|
|
38
|
+
* ***** END LICENSE BLOCK ***** */
|
|
39
|
+
|
|
40
|
+
/* @(#)e_log10.c 1.3 95/01/18 */
|
|
41
|
+
/*
|
|
42
|
+
* ====================================================
|
|
43
|
+
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
44
|
+
*
|
|
45
|
+
* Developed at SunSoft, a Sun Microsystems, Inc. business.
|
|
46
|
+
* Permission to use, copy, modify, and distribute this
|
|
47
|
+
* software is freely granted, provided that this notice
|
|
48
|
+
* is preserved.
|
|
49
|
+
* ====================================================
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/* __ieee754_log10(x)
|
|
53
|
+
* Return the base 10 logarithm of x
|
|
54
|
+
*
|
|
55
|
+
* Method :
|
|
56
|
+
* Let log10_2hi = leading 40 bits of log10(2) and
|
|
57
|
+
* log10_2lo = log10(2) - log10_2hi,
|
|
58
|
+
* ivln10 = 1/log(10) rounded.
|
|
59
|
+
* Then
|
|
60
|
+
* n = ilogb(x),
|
|
61
|
+
* if(n<0) n = n+1;
|
|
62
|
+
* x = scalbn(x,-n);
|
|
63
|
+
* log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x))
|
|
64
|
+
*
|
|
65
|
+
* Note 1:
|
|
66
|
+
* To guarantee log10(10**n)=n, where 10**n is normal, the rounding
|
|
67
|
+
* mode must set to Round-to-Nearest.
|
|
68
|
+
* Note 2:
|
|
69
|
+
* [1/log(10)] rounded to 53 bits has error .198 ulps;
|
|
70
|
+
* log10 is monotonic at all binary break points.
|
|
71
|
+
*
|
|
72
|
+
* Special cases:
|
|
73
|
+
* log10(x) is NaN with signal if x < 0;
|
|
74
|
+
* log10(+INF) is +INF with no signal; log10(0) is -INF with signal;
|
|
75
|
+
* log10(NaN) is that NaN with no signal;
|
|
76
|
+
* log10(10**N) = N for N=0,1,...,22.
|
|
77
|
+
*
|
|
78
|
+
* Constants:
|
|
79
|
+
* The hexadecimal values are the intended ones for the following constants.
|
|
80
|
+
* The decimal values may be used, provided that the compiler will convert
|
|
81
|
+
* from decimal to binary accurately enough to produce the hexadecimal values
|
|
82
|
+
* shown.
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
#include "fdlibm.h"
|
|
86
|
+
|
|
87
|
+
#ifdef __STDC__
|
|
88
|
+
static const double
|
|
89
|
+
#else
|
|
90
|
+
static double
|
|
91
|
+
#endif
|
|
92
|
+
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
|
|
93
|
+
ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */
|
|
94
|
+
log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */
|
|
95
|
+
log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */
|
|
96
|
+
|
|
97
|
+
static double zero = 0.0;
|
|
98
|
+
|
|
99
|
+
#ifdef __STDC__
|
|
100
|
+
double __ieee754_log10(double x)
|
|
101
|
+
#else
|
|
102
|
+
double __ieee754_log10(x)
|
|
103
|
+
double x;
|
|
104
|
+
#endif
|
|
105
|
+
{
|
|
106
|
+
fd_twoints u;
|
|
107
|
+
double y,z;
|
|
108
|
+
int i,k,hx;
|
|
109
|
+
unsigned lx;
|
|
110
|
+
|
|
111
|
+
u.d = x;
|
|
112
|
+
hx = __HI(u); /* high word of x */
|
|
113
|
+
lx = __LO(u); /* low word of x */
|
|
114
|
+
|
|
115
|
+
k=0;
|
|
116
|
+
if (hx < 0x00100000) { /* x < 2**-1022 */
|
|
117
|
+
if (((hx&0x7fffffff)|lx)==0)
|
|
118
|
+
return -two54/zero; /* log(+-0)=-inf */
|
|
119
|
+
if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
|
|
120
|
+
k -= 54; x *= two54; /* subnormal number, scale up x */
|
|
121
|
+
u.d = x;
|
|
122
|
+
hx = __HI(u); /* high word of x */
|
|
123
|
+
}
|
|
124
|
+
if (hx >= 0x7ff00000) return x+x;
|
|
125
|
+
k += (hx>>20)-1023;
|
|
126
|
+
i = ((unsigned)k&0x80000000)>>31;
|
|
127
|
+
hx = (hx&0x000fffff)|((0x3ff-i)<<20);
|
|
128
|
+
y = (double)(k+i);
|
|
129
|
+
u.d = x;
|
|
130
|
+
__HI(u) = hx;
|
|
131
|
+
x = u.d;
|
|
132
|
+
z = y*log10_2lo + ivln10*__ieee754_log(x);
|
|
133
|
+
return z+y*log10_2hi;
|
|
134
|
+
}
|