Average Error: 35.5 → 27.4
Time: 40.7s
Precision: 64
\[\frac{\tan \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right)}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x}{2.0 \cdot y} \le 4.9406564584125 \cdot 10^{-324}:\\ \;\;\;\;1.0\\ \mathbf{elif}\;\frac{x}{2.0 \cdot y} \le 1.728415504785257 \cdot 10^{+275}:\\ \;\;\;\;\frac{\sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)} \cdot \sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)}}{\sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)} \cdot \sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \frac{\sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)}}{\sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1.0\\ \end{array}\]
\frac{\tan \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right)}
\begin{array}{l}
\mathbf{if}\;\frac{x}{2.0 \cdot y} \le 4.9406564584125 \cdot 10^{-324}:\\
\;\;\;\;1.0\\

\mathbf{elif}\;\frac{x}{2.0 \cdot y} \le 1.728415504785257 \cdot 10^{+275}:\\
\;\;\;\;\frac{\sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)} \cdot \sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)}}{\sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)} \cdot \sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \frac{\sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)}}{\sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)}}\\

\mathbf{else}:\\
\;\;\;\;1.0\\

\end{array}
double f(double x, double y) {
        double r33815740 = x;
        double r33815741 = y;
        double r33815742 = 2.0;
        double r33815743 = r33815741 * r33815742;
        double r33815744 = r33815740 / r33815743;
        double r33815745 = tan(r33815744);
        double r33815746 = sin(r33815744);
        double r33815747 = r33815745 / r33815746;
        return r33815747;
}

double f(double x, double y) {
        double r33815748 = x;
        double r33815749 = 2.0;
        double r33815750 = y;
        double r33815751 = r33815749 * r33815750;
        double r33815752 = r33815748 / r33815751;
        double r33815753 = 4.9406564584125e-324;
        bool r33815754 = r33815752 <= r33815753;
        double r33815755 = 1.0;
        double r33815756 = 1.728415504785257e+275;
        bool r33815757 = r33815752 <= r33815756;
        double r33815758 = tan(r33815752);
        double r33815759 = cbrt(r33815758);
        double r33815760 = r33815759 * r33815759;
        double r33815761 = sin(r33815752);
        double r33815762 = cbrt(r33815761);
        double r33815763 = r33815762 * r33815762;
        double r33815764 = r33815760 / r33815763;
        double r33815765 = r33815759 / r33815762;
        double r33815766 = r33815764 * r33815765;
        double r33815767 = r33815757 ? r33815766 : r33815755;
        double r33815768 = r33815754 ? r33815755 : r33815767;
        return r33815768;
}

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.5
Target28.3
Herbie27.4
\[\begin{array}{l} \mathbf{if}\;y \lt -1.2303690911306994 \cdot 10^{+114}:\\ \;\;\;\;1.0\\ \mathbf{elif}\;y \lt -9.102852406811914 \cdot 10^{-222}:\\ \;\;\;\;\frac{\sin \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right) \cdot \log \left(e^{\cos \left(\frac{x}{y \cdot 2.0}\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;1.0\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ x (* y 2.0)) < 4.9406564584125e-324 or 1.728415504785257e+275 < (/ x (* y 2.0))

    1. Initial program 41.3

      \[\frac{\tan \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right)}\]
    2. Taylor expanded around 0 28.7

      \[\leadsto \color{blue}{1.0}\]

    if 4.9406564584125e-324 < (/ x (* y 2.0)) < 1.728415504785257e+275

    1. Initial program 25.3

      \[\frac{\tan \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right)}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt26.0

      \[\leadsto \frac{\tan \left(\frac{x}{y \cdot 2.0}\right)}{\color{blue}{\left(\sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)} \cdot \sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)}\right) \cdot \sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)}}}\]
    4. Applied add-cube-cbrt25.3

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\tan \left(\frac{x}{y \cdot 2.0}\right)} \cdot \sqrt[3]{\tan \left(\frac{x}{y \cdot 2.0}\right)}\right) \cdot \sqrt[3]{\tan \left(\frac{x}{y \cdot 2.0}\right)}}}{\left(\sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)} \cdot \sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)}\right) \cdot \sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)}}\]
    5. Applied times-frac25.3

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\tan \left(\frac{x}{y \cdot 2.0}\right)} \cdot \sqrt[3]{\tan \left(\frac{x}{y \cdot 2.0}\right)}}{\sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)} \cdot \sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)}} \cdot \frac{\sqrt[3]{\tan \left(\frac{x}{y \cdot 2.0}\right)}}{\sqrt[3]{\sin \left(\frac{x}{y \cdot 2.0}\right)}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification27.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x}{2.0 \cdot y} \le 4.9406564584125 \cdot 10^{-324}:\\ \;\;\;\;1.0\\ \mathbf{elif}\;\frac{x}{2.0 \cdot y} \le 1.728415504785257 \cdot 10^{+275}:\\ \;\;\;\;\frac{\sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)} \cdot \sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)}}{\sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)} \cdot \sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \frac{\sqrt[3]{\tan \left(\frac{x}{2.0 \cdot y}\right)}}{\sqrt[3]{\sin \left(\frac{x}{2.0 \cdot y}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1.0\\ \end{array}\]

Reproduce

herbie shell --seed 2019165 
(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)))))