Average Error: 0.2 → 0.3
Time: 18.5s
Precision: 64
$\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {x}^{2}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}$
$\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + \sqrt{28 \cdot {x}^{2}} \cdot \sqrt{\left(28 \cdot \sqrt{{x}^{2}}\right) \cdot \sqrt{{x}^{2}}}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}$
\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {x}^{2}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}
\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + \sqrt{28 \cdot {x}^{2}} \cdot \sqrt{\left(28 \cdot \sqrt{{x}^{2}}\right) \cdot \sqrt{{x}^{2}}}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}
double f(double x) {
double r186894 = x;
double r186895 = r186894 * r186894;
double r186896 = 7.0;
double r186897 = r186896 * r186894;
double r186898 = r186895 - r186897;
double r186899 = r186898 * r186894;
double r186900 = 28.0;
double r186901 = 2.0;
double r186902 = pow(r186894, r186901);
double r186903 = r186900 * r186902;
double r186904 = r186899 + r186903;
double r186905 = r186904 * r186894;
double r186906 = 56.0;
double r186907 = 3.0;
double r186908 = pow(r186894, r186907);
double r186909 = r186906 * r186908;
double r186910 = r186905 - r186909;
double r186911 = r186910 * r186894;
double r186912 = 4.0;
double r186913 = pow(r186894, r186912);
double r186914 = r186911 + r186913;
return r186914;
}


double f(double x) {
double r186915 = x;
double r186916 = r186915 * r186915;
double r186917 = 7.0;
double r186918 = r186917 * r186915;
double r186919 = r186916 - r186918;
double r186920 = r186919 * r186915;
double r186921 = 28.0;
double r186922 = 2.0;
double r186923 = pow(r186915, r186922);
double r186924 = r186921 * r186923;
double r186925 = sqrt(r186924);
double r186926 = sqrt(r186923);
double r186927 = r186921 * r186926;
double r186928 = r186927 * r186926;
double r186929 = sqrt(r186928);
double r186930 = r186925 * r186929;
double r186931 = r186920 + r186930;
double r186932 = r186931 * r186915;
double r186933 = 56.0;
double r186934 = 3.0;
double r186935 = pow(r186915, r186934);
double r186936 = r186933 * r186935;
double r186937 = r186932 - r186936;
double r186938 = r186937 * r186915;
double r186939 = 4.0;
double r186940 = pow(r186915, r186939);
double r186941 = r186938 + r186940;
return r186941;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.2

$\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {x}^{2}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}$
2. Using strategy rm

$\leadsto \left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + \color{blue}{\sqrt{28 \cdot {x}^{2}} \cdot \sqrt{28 \cdot {x}^{2}}}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}$
4. Using strategy rm

$\leadsto \left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + \sqrt{28 \cdot {x}^{2}} \cdot \sqrt{28 \cdot \color{blue}{\left(\sqrt{{x}^{2}} \cdot \sqrt{{x}^{2}}\right)}}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}$
6. Applied associate-*r*0.3

$\leadsto \left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + \sqrt{28 \cdot {x}^{2}} \cdot \sqrt{\color{blue}{\left(28 \cdot \sqrt{{x}^{2}}\right) \cdot \sqrt{{x}^{2}}}}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}$
7. Final simplification0.3

$\leadsto \left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + \sqrt{28 \cdot {x}^{2}} \cdot \sqrt{\left(28 \cdot \sqrt{{x}^{2}}\right) \cdot \sqrt{{x}^{2}}}\right) \cdot x - 56 \cdot {x}^{3}\right) \cdot x + {x}^{4}$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "(((x*x-7*x)*x+28*pow(x,2))*x - 56*pow(x,3))*x + pow(x,4)"
:precision binary64
(+ (* (- (* (+ (* (- (* x x) (* 7 x)) x) (* 28 (pow x 2))) x) (* 56 (pow x 3))) x) (pow x 4)))
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}