Average Error: 35.4 → 27.5
Time: 15.0s
Precision: 64
\[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)} \le 2.69286171955532038779779213655274361372:\\ \;\;\;\;\sqrt[3]{\sqrt[3]{{\left({\left(\sqrt[3]{{\left(\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}\right)}^{3}}\right)}^{3}\right)}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}
\begin{array}{l}
\mathbf{if}\;\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)} \le 2.69286171955532038779779213655274361372:\\
\;\;\;\;\sqrt[3]{\sqrt[3]{{\left({\left(\sqrt[3]{{\left(\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}\right)}^{3}}\right)}^{3}\right)}^{3}}}\\

\mathbf{else}:\\
\;\;\;\;1\\

\end{array}
double f(double x, double y) {
        double r1166100 = x;
        double r1166101 = y;
        double r1166102 = 2.0;
        double r1166103 = r1166101 * r1166102;
        double r1166104 = r1166100 / r1166103;
        double r1166105 = tan(r1166104);
        double r1166106 = sin(r1166104);
        double r1166107 = r1166105 / r1166106;
        return r1166107;
}

double f(double x, double y) {
        double r1166108 = x;
        double r1166109 = 2.0;
        double r1166110 = y;
        double r1166111 = r1166109 * r1166110;
        double r1166112 = r1166108 / r1166111;
        double r1166113 = tan(r1166112);
        double r1166114 = sin(r1166112);
        double r1166115 = r1166113 / r1166114;
        double r1166116 = 2.6928617195553204;
        bool r1166117 = r1166115 <= r1166116;
        double r1166118 = 3.0;
        double r1166119 = pow(r1166115, r1166118);
        double r1166120 = cbrt(r1166119);
        double r1166121 = pow(r1166120, r1166118);
        double r1166122 = pow(r1166121, r1166118);
        double r1166123 = cbrt(r1166122);
        double r1166124 = cbrt(r1166123);
        double r1166125 = 1.0;
        double r1166126 = r1166117 ? r1166124 : r1166125;
        return r1166126;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original35.4
Target28.9
Herbie27.5
\[\begin{array}{l} \mathbf{if}\;y \lt -1.230369091130699363447511617672816900781 \cdot 10^{114}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \lt -9.102852406811913849731222630299032206502 \cdot 10^{-222}:\\ \;\;\;\;\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right) \cdot \log \left(e^{\cos \left(\frac{x}{y \cdot 2}\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 2.6928617195553204

    1. Initial program 24.9

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\]
    2. Simplified24.9

      \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}}\]
    3. Using strategy rm
    4. Applied add-cbrt-cube45.6

      \[\leadsto \frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\color{blue}{\sqrt[3]{\left(\sin \left(\frac{x}{2 \cdot y}\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)}}}\]
    5. Applied add-cbrt-cube45.2

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\tan \left(\frac{x}{2 \cdot y}\right) \cdot \tan \left(\frac{x}{2 \cdot y}\right)\right) \cdot \tan \left(\frac{x}{2 \cdot y}\right)}}}{\sqrt[3]{\left(\sin \left(\frac{x}{2 \cdot y}\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)}}\]
    6. Applied cbrt-undiv45.2

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\left(\tan \left(\frac{x}{2 \cdot y}\right) \cdot \tan \left(\frac{x}{2 \cdot y}\right)\right) \cdot \tan \left(\frac{x}{2 \cdot y}\right)}{\left(\sin \left(\frac{x}{2 \cdot y}\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)}}}\]
    7. Simplified24.9

      \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)}^{3}}}\]
    8. Using strategy rm
    9. Applied add-cbrt-cube24.9

      \[\leadsto \sqrt[3]{\color{blue}{\sqrt[3]{\left({\left(\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)}^{3} \cdot {\left(\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)}^{3}\right) \cdot {\left(\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)}^{3}}}}\]
    10. Simplified24.9

      \[\leadsto \sqrt[3]{\sqrt[3]{\color{blue}{{\left({\left(\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}\right)}^{3}\right)}^{3}}}}\]
    11. Using strategy rm
    12. Applied add-cbrt-cube45.5

      \[\leadsto \sqrt[3]{\sqrt[3]{{\left({\left(\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\color{blue}{\sqrt[3]{\left(\sin \left(\frac{x}{2 \cdot y}\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)}}}\right)}^{3}\right)}^{3}}}\]
    13. Applied add-cbrt-cube45.2

      \[\leadsto \sqrt[3]{\sqrt[3]{{\left({\left(\frac{\color{blue}{\sqrt[3]{\left(\tan \left(\frac{x}{2 \cdot y}\right) \cdot \tan \left(\frac{x}{2 \cdot y}\right)\right) \cdot \tan \left(\frac{x}{2 \cdot y}\right)}}}{\sqrt[3]{\left(\sin \left(\frac{x}{2 \cdot y}\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)}}\right)}^{3}\right)}^{3}}}\]
    14. Applied cbrt-undiv45.2

      \[\leadsto \sqrt[3]{\sqrt[3]{{\left({\color{blue}{\left(\sqrt[3]{\frac{\left(\tan \left(\frac{x}{2 \cdot y}\right) \cdot \tan \left(\frac{x}{2 \cdot y}\right)\right) \cdot \tan \left(\frac{x}{2 \cdot y}\right)}{\left(\sin \left(\frac{x}{2 \cdot y}\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)\right) \cdot \sin \left(\frac{x}{2 \cdot y}\right)}}\right)}}^{3}\right)}^{3}}}\]
    15. Simplified24.9

      \[\leadsto \sqrt[3]{\sqrt[3]{{\left({\left(\sqrt[3]{\color{blue}{{\left(\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)}^{3}}}\right)}^{3}\right)}^{3}}}\]

    if 2.6928617195553204 < (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0))))

    1. Initial program 62.7

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\]
    2. Simplified62.7

      \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}}\]
    3. Taylor expanded around 0 34.1

      \[\leadsto \color{blue}{1}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification27.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)} \le 2.69286171955532038779779213655274361372:\\ \;\;\;\;\sqrt[3]{\sqrt[3]{{\left({\left(\sqrt[3]{{\left(\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}\right)}^{3}}\right)}^{3}\right)}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]

Reproduce

herbie shell --seed 2019179 
(FPCore (x y)
  :name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"

  :herbie-target
  (if (< y -1.2303690911306994e+114) 1.0 (if (< y -9.102852406811914e-222) (/ (sin (/ x (* y 2.0))) (* (sin (/ x (* y 2.0))) (log (exp (cos (/ x (* y 2.0))))))) 1.0))

  (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))))