Skip to content
Snippets Groups Projects
Select Git revision
  • 5d6d7d35dba09bea6135119a1398bf1af8c96cf8
  • master default
  • bing_issues#190_tf2
  • bing_tf2_convert
  • bing_issue#189_train_modular
  • simon_#172_integrate_weatherbench
  • develop
  • bing_issue#188_restructure_ambs
  • yan_issue#100_extract_prcp_data
  • bing_issue#170_data_preprocess_training_tf1
  • Gong2022_temperature_forecasts
  • bing_issue#186_clean_GMD1_tag
  • yan_issue#179_integrate_GZAWS_data_onfly
  • bing_issue#178_runscript_bug_postprocess
  • michael_issue#187_bugfix_setup_runscript_template
  • bing_issue#180_bugs_postprpocess_meta_postprocess
  • yan_issue#177_repo_for_CLGAN_gmd
  • bing_issue#176_integrate_weather_bench
  • michael_issue#181_eval_era5_forecasts
  • michael_issue#182_eval_subdomain
  • michael_issue#119_warmup_Horovod
  • bing_issue#160_test_zam347
  • ambs_v1
  • ambs_gmd_nowcasting_v1.0
  • GMD1
  • modular_booster_20210203
  • new_structure_20201004_v1.0
  • old_structure_20200930
28 results

main_visualize_postprocess.py

Blame
  • mysqrt.cc 782 B
    #include <iostream>
    #include <cmath>
    
    auto mysqrt(double x) -> double
    {
        const auto eps = 1.0e-12;
        const auto eps2 = eps * eps;
        auto r0 = 0.5 * (1. + x);
        auto r1 = x / r0;
        while ((r0 - r1) * (r0 - r1) > eps2) {
            r0 = 0.5 * (r0 + r1);
            r1 = x / r0;
        }
        return r1;
    }
    
    auto main() -> int
    {
        double x{};
        std::cout << "Enter a positive real number: ";
        std::cin >> x;
        if (x > 0.) {
            auto rm = mysqrt(x);
            auto rs = std::sqrt(x);
            std::cout << "Square root with own function = " << rm << "\n";
            std::cout << "Square root with standard function = " << rs << "\n";
            std::cout << "Difference = " << rm - rs << "\n";
        } else {
            std::cout << "The input number needs to be positive.\n";
        }
    }