Average Error: 0.5 → 0.4
Time: 26.3s
Precision: 64
\[\frac{\cos th}{\sqrt{2}} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
\[\left(\cos th \cdot \sqrt[3]{\frac{\frac{1}{2}}{\sqrt{2}}}\right) \cdot \left(a2 \cdot a2\right) + \frac{a1}{\sqrt[3]{\sqrt{2}}} \cdot \left(\cos th \cdot \frac{a1}{\sqrt[3]{\sqrt{2}} \cdot \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)
\left(\cos th \cdot \sqrt[3]{\frac{\frac{1}{2}}{\sqrt{2}}}\right) \cdot \left(a2 \cdot a2\right) + \frac{a1}{\sqrt[3]{\sqrt{2}}} \cdot \left(\cos th \cdot \frac{a1}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}\right)
double f(double a1, double a2, double th) {
        double r1211144 = th;
        double r1211145 = cos(r1211144);
        double r1211146 = 2.0;
        double r1211147 = sqrt(r1211146);
        double r1211148 = r1211145 / r1211147;
        double r1211149 = a1;
        double r1211150 = r1211149 * r1211149;
        double r1211151 = r1211148 * r1211150;
        double r1211152 = a2;
        double r1211153 = r1211152 * r1211152;
        double r1211154 = r1211148 * r1211153;
        double r1211155 = r1211151 + r1211154;
        return r1211155;
}

double f(double a1, double a2, double th) {
        double r1211156 = th;
        double r1211157 = cos(r1211156);
        double r1211158 = 0.5;
        double r1211159 = 2.0;
        double r1211160 = sqrt(r1211159);
        double r1211161 = r1211158 / r1211160;
        double r1211162 = cbrt(r1211161);
        double r1211163 = r1211157 * r1211162;
        double r1211164 = a2;
        double r1211165 = r1211164 * r1211164;
        double r1211166 = r1211163 * r1211165;
        double r1211167 = a1;
        double r1211168 = cbrt(r1211160);
        double r1211169 = r1211167 / r1211168;
        double r1211170 = r1211168 * r1211168;
        double r1211171 = r1211167 / r1211170;
        double r1211172 = r1211157 * r1211171;
        double r1211173 = r1211169 * r1211172;
        double r1211174 = r1211166 + r1211173;
        return r1211174;
}

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 div-inv0.5

    \[\leadsto \color{blue}{\left(\cos th \cdot \frac{1}{\sqrt{2}}\right)} \cdot \left(a1 \cdot a1\right) + \frac{\cos th}{\sqrt{2}} \cdot \left(a2 \cdot a2\right)\]
  4. Applied associate-*l*0.5

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

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

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

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

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

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

    \[\leadsto \left(\cos th \cdot \frac{a1}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}\right) \cdot \frac{a1}{\sqrt[3]{\sqrt{2}}} + \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(a2 \cdot a2\right)\]
  13. Applied cbrt-undiv0.6

    \[\leadsto \left(\cos th \cdot \frac{a1}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}\right) \cdot \frac{a1}{\sqrt[3]{\sqrt{2}}} + \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(a2 \cdot a2\right)\]
  14. Simplified0.5

    \[\leadsto \left(\cos th \cdot \frac{a1}{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}}\right) \cdot \frac{a1}{\sqrt[3]{\sqrt{2}}} + \sqrt[3]{\color{blue}{\frac{\frac{\cos th \cdot \left(\cos th \cdot \cos th\right)}{2}}{\sqrt{2}}}} \cdot \left(a2 \cdot a2\right)\]
  15. Using strategy rm
  16. Applied *-un-lft-identity0.5

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

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

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

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

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

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

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

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

Reproduce

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