Average Error: 22.4 → 22.4
Time: 18.2s
Precision: 64
\[{\left(\sin \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2} + {\left(\cos \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2}\]
\[{\left(\sin \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2} + {\left(\cos \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2}\]
{\left(\sin \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2} + {\left(\cos \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2}
{\left(\sin \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2} + {\left(\cos \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2}
double f(double x) {
        double r1019904 = x;
        double r1019905 = 1.0;
        double r1019906 = r1019904 + r1019905;
        double r1019907 = sqrt(r1019906);
        double r1019908 = sqrt(r1019904);
        double r1019909 = r1019907 - r1019908;
        double r1019910 = sin(r1019909);
        double r1019911 = 2.0;
        double r1019912 = pow(r1019910, r1019911);
        double r1019913 = cos(r1019909);
        double r1019914 = pow(r1019913, r1019911);
        double r1019915 = r1019912 + r1019914;
        return r1019915;
}

double f(double x) {
        double r1019916 = x;
        double r1019917 = 1.0;
        double r1019918 = r1019916 + r1019917;
        double r1019919 = sqrt(r1019918);
        double r1019920 = sqrt(r1019916);
        double r1019921 = r1019919 - r1019920;
        double r1019922 = sin(r1019921);
        double r1019923 = 2.0;
        double r1019924 = pow(r1019922, r1019923);
        double r1019925 = cos(r1019921);
        double r1019926 = pow(r1019925, r1019923);
        double r1019927 = r1019924 + r1019926;
        return r1019927;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 22.4

    \[{\left(\sin \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2} + {\left(\cos \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2}\]
  2. Final simplification22.4

    \[\leadsto {\left(\sin \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2} + {\left(\cos \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}^{2}\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "sin(sqrt(x+1) - sqrt(x))^2 + cos(sqrt(x+1) - sqrt(x))^2"
  :precision binary64
  (+ (pow (sin (- (sqrt (+ x 1)) (sqrt x))) 2) (pow (cos (- (sqrt (+ x 1)) (sqrt x))) 2)))