Average Error: 0.5 → 0.5
Time: 35.0s
Precision: 64
\[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
\[\sqrt[3]{\frac{\left(\cos th \cdot \cos th\right) \cdot \cos th}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \left(a2 \cdot a2\right) \cdot \left(\frac{\cos th}{\left|\sqrt[3]{\sqrt{2}}\right|} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}\right)\]
\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)
\sqrt[3]{\frac{\left(\cos th \cdot \cos th\right) \cdot \cos th}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \left(a2 \cdot a2\right) \cdot \left(\frac{\cos th}{\left|\sqrt[3]{\sqrt{2}}\right|} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}\right)
double f(double a1, double a2, double th) {
        double r1902030 = th;
        double r1902031 = cos(r1902030);
        double r1902032 = 2.0;
        double r1902033 = sqrt(r1902032);
        double r1902034 = r1902031 / r1902033;
        double r1902035 = a1;
        double r1902036 = r1902035 * r1902035;
        double r1902037 = r1902034 * r1902036;
        double r1902038 = a2;
        double r1902039 = r1902038 * r1902038;
        double r1902040 = r1902034 * r1902039;
        double r1902041 = r1902037 + r1902040;
        return r1902041;
}

double f(double a1, double a2, double th) {
        double r1902042 = th;
        double r1902043 = cos(r1902042);
        double r1902044 = r1902043 * r1902043;
        double r1902045 = r1902044 * r1902043;
        double r1902046 = 2.0;
        double r1902047 = sqrt(r1902046);
        double r1902048 = r1902046 * r1902047;
        double r1902049 = r1902045 / r1902048;
        double r1902050 = cbrt(r1902049);
        double r1902051 = a1;
        double r1902052 = r1902051 * r1902051;
        double r1902053 = r1902050 * r1902052;
        double r1902054 = a2;
        double r1902055 = r1902054 * r1902054;
        double r1902056 = cbrt(r1902047);
        double r1902057 = fabs(r1902056);
        double r1902058 = r1902043 / r1902057;
        double r1902059 = 1.0;
        double r1902060 = sqrt(r1902047);
        double r1902061 = r1902059 / r1902060;
        double r1902062 = sqrt(r1902056);
        double r1902063 = r1902061 / r1902062;
        double r1902064 = r1902058 * r1902063;
        double r1902065 = r1902055 * r1902064;
        double r1902066 = r1902053 + r1902065;
        return r1902066;
}

Error

Bits error versus a1

Bits error versus a2

Bits error versus th

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.5

    \[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  2. Using strategy rm
  3. Applied add-cbrt-cube0.8

    \[\leadsto \frac{\cos th}{\color{blue}{\sqrt[3]{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \sqrt{2}}}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  4. Applied add-cbrt-cube0.9

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\cos th \cdot \cos th\right) \cdot \cos th}}}{\sqrt[3]{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  5. Applied cbrt-undiv0.6

    \[\leadsto \color{blue}{\sqrt[3]{\frac{\left(\cos th \cdot \cos th\right) \cdot \cos th}{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \sqrt{2}}}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  6. Simplified0.5

    \[\leadsto \sqrt[3]{\color{blue}{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2 \cdot \sqrt{2}}}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt0.5

    \[\leadsto \sqrt[3]{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\color{blue}{\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}}} \cdot \left(a2 \cdot a2\right)\]
  9. Applied associate-/r*0.5

    \[\leadsto \sqrt[3]{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \color{blue}{\frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt{2}}}} \cdot \left(a2 \cdot a2\right)\]
  10. Using strategy rm
  11. Applied add-cube-cbrt0.5

    \[\leadsto \sqrt[3]{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\sqrt{\color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \sqrt[3]{\sqrt{2}}}}} \cdot \left(a2 \cdot a2\right)\]
  12. Applied sqrt-prod0.6

    \[\leadsto \sqrt[3]{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \frac{\frac{\cos th}{\sqrt{\sqrt{2}}}}{\color{blue}{\sqrt{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}} \cdot \sqrt{\sqrt[3]{\sqrt{2}}}}} \cdot \left(a2 \cdot a2\right)\]
  13. Applied div-inv0.6

    \[\leadsto \sqrt[3]{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \frac{\color{blue}{\cos th \cdot \frac{1}{\sqrt{\sqrt{2}}}}}{\sqrt{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}} \cdot \sqrt{\sqrt[3]{\sqrt{2}}}} \cdot \left(a2 \cdot a2\right)\]
  14. Applied times-frac0.5

    \[\leadsto \sqrt[3]{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \color{blue}{\left(\frac{\cos th}{\sqrt{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}\right)} \cdot \left(a2 \cdot a2\right)\]
  15. Simplified0.5

    \[\leadsto \sqrt[3]{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \left(\color{blue}{\frac{\cos th}{\left|\sqrt[3]{\sqrt{2}}\right|}} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}\right) \cdot \left(a2 \cdot a2\right)\]
  16. Final simplification0.5

    \[\leadsto \sqrt[3]{\frac{\left(\cos th \cdot \cos th\right) \cdot \cos th}{2 \cdot \sqrt{2}}} \cdot \left(a1 \cdot a1\right) + \left(a2 \cdot a2\right) \cdot \left(\frac{\cos th}{\left|\sqrt[3]{\sqrt{2}}\right|} \cdot \frac{\frac{1}{\sqrt{\sqrt{2}}}}{\sqrt{\sqrt[3]{\sqrt{2}}}}\right)\]

Reproduce

herbie shell --seed 2019134 
(FPCore (a1 a2 th)
  :name "Migdal et al, Equation (64)"
  (+ (* (/ (cos th) (sqrt 2)) (* a1 a1)) (* (/ (cos th) (sqrt 2)) (* a2 a2))))