Average Error: 35.6 → 28.0
Time: 53.9s
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.070947091712344256819733345764689147472:\\ \;\;\;\;\left(\sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}} \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}}\right) \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}}\\ \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.070947091712344256819733345764689147472:\\
\;\;\;\;\left(\sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}} \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}}\right) \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}}\\

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

\end{array}
double f(double x, double y) {
        double r33531953 = x;
        double r33531954 = y;
        double r33531955 = 2.0;
        double r33531956 = r33531954 * r33531955;
        double r33531957 = r33531953 / r33531956;
        double r33531958 = tan(r33531957);
        double r33531959 = sin(r33531957);
        double r33531960 = r33531958 / r33531959;
        return r33531960;
}

double f(double x, double y) {
        double r33531961 = x;
        double r33531962 = 2.0;
        double r33531963 = y;
        double r33531964 = r33531962 * r33531963;
        double r33531965 = r33531961 / r33531964;
        double r33531966 = tan(r33531965);
        double r33531967 = sin(r33531965);
        double r33531968 = r33531966 / r33531967;
        double r33531969 = 2.0709470917123443;
        bool r33531970 = r33531968 <= r33531969;
        double r33531971 = cbrt(r33531968);
        double r33531972 = r33531971 * r33531971;
        double r33531973 = r33531972 * r33531971;
        double r33531974 = 1.0;
        double r33531975 = r33531970 ? r33531973 : r33531974;
        return r33531975;
}

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.6
Target29.2
Herbie28.0
\[\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.0709470917123443

    1. Initial program 24.7

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

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

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

    1. Initial program 62.2

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

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

    \[\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.070947091712344256819733345764689147472:\\ \;\;\;\;\left(\sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}} \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}}\right) \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]

Reproduce

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