Average Error: 0.5 → 0.5
Time: 36.9s
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 r1640119 = th;
        double r1640120 = cos(r1640119);
        double r1640121 = 2.0;
        double r1640122 = sqrt(r1640121);
        double r1640123 = r1640120 / r1640122;
        double r1640124 = a1;
        double r1640125 = r1640124 * r1640124;
        double r1640126 = r1640123 * r1640125;
        double r1640127 = a2;
        double r1640128 = r1640127 * r1640127;
        double r1640129 = r1640123 * r1640128;
        double r1640130 = r1640126 + r1640129;
        return r1640130;
}

double f(double a1, double a2, double th) {
        double r1640131 = th;
        double r1640132 = cos(r1640131);
        double r1640133 = r1640132 * r1640132;
        double r1640134 = r1640133 * r1640132;
        double r1640135 = 2.0;
        double r1640136 = sqrt(r1640135);
        double r1640137 = r1640135 * r1640136;
        double r1640138 = r1640134 / r1640137;
        double r1640139 = cbrt(r1640138);
        double r1640140 = a1;
        double r1640141 = r1640140 * r1640140;
        double r1640142 = r1640139 * r1640141;
        double r1640143 = a2;
        double r1640144 = r1640143 * r1640143;
        double r1640145 = cbrt(r1640136);
        double r1640146 = fabs(r1640145);
        double r1640147 = r1640132 / r1640146;
        double r1640148 = 1.0;
        double r1640149 = sqrt(r1640136);
        double r1640150 = r1640148 / r1640149;
        double r1640151 = sqrt(r1640145);
        double r1640152 = r1640150 / r1640151;
        double r1640153 = r1640147 * r1640152;
        double r1640154 = r1640144 * r1640153;
        double r1640155 = r1640142 + r1640154;
        return r1640155;
}

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 +o rules:numerics
(FPCore (a1 a2 th)
  :name "Migdal et al, Equation (64)"
  (+ (* (/ (cos th) (sqrt 2)) (* a1 a1)) (* (/ (cos th) (sqrt 2)) (* a2 a2))))