Average Error: 35.8 → 28.1
Time: 5.5s
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{x}{y \cdot 2} \le -0.0:\\ \;\;\;\;1\\ \mathbf{elif}\;\frac{x}{y \cdot 2} \le 3.574105964014763247443245319465651526452 \cdot 10^{175}:\\ \;\;\;\;\left(\sqrt[3]{\frac{1}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\tan \left(\frac{x}{y \cdot 2}\right)}}} \cdot \sqrt[3]{\frac{1}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\tan \left(\frac{x}{y \cdot 2}\right)}}}\right) \cdot \sqrt[3]{\frac{1}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\tan \left(\frac{x}{y \cdot 2}\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{x}{y \cdot 2} \le -0.0:\\
\;\;\;\;1\\

\mathbf{elif}\;\frac{x}{y \cdot 2} \le 3.574105964014763247443245319465651526452 \cdot 10^{175}:\\
\;\;\;\;\left(\sqrt[3]{\frac{1}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\tan \left(\frac{x}{y \cdot 2}\right)}}} \cdot \sqrt[3]{\frac{1}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\tan \left(\frac{x}{y \cdot 2}\right)}}}\right) \cdot \sqrt[3]{\frac{1}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\tan \left(\frac{x}{y \cdot 2}\right)}}}\\

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

\end{array}
double f(double x, double y) {
        double r794686 = x;
        double r794687 = y;
        double r794688 = 2.0;
        double r794689 = r794687 * r794688;
        double r794690 = r794686 / r794689;
        double r794691 = tan(r794690);
        double r794692 = sin(r794690);
        double r794693 = r794691 / r794692;
        return r794693;
}

double f(double x, double y) {
        double r794694 = x;
        double r794695 = y;
        double r794696 = 2.0;
        double r794697 = r794695 * r794696;
        double r794698 = r794694 / r794697;
        double r794699 = -0.0;
        bool r794700 = r794698 <= r794699;
        double r794701 = 1.0;
        double r794702 = 3.574105964014763e+175;
        bool r794703 = r794698 <= r794702;
        double r794704 = 1.0;
        double r794705 = sin(r794698);
        double r794706 = tan(r794698);
        double r794707 = r794705 / r794706;
        double r794708 = r794704 / r794707;
        double r794709 = cbrt(r794708);
        double r794710 = r794709 * r794709;
        double r794711 = r794710 * r794709;
        double r794712 = r794703 ? r794711 : r794701;
        double r794713 = r794700 ? r794701 : r794712;
        return r794713;
}

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.8
Target29.0
Herbie28.1
\[\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 (/ x (* y 2.0)) < -0.0 or 3.574105964014763e+175 < (/ x (* y 2.0))

    1. Initial program 41.0

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

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

    if -0.0 < (/ x (* y 2.0)) < 3.574105964014763e+175

    1. Initial program 27.4

      \[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\]
    2. Using strategy rm
    3. Applied clear-num27.4

      \[\leadsto \color{blue}{\frac{1}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\tan \left(\frac{x}{y \cdot 2}\right)}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt27.4

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

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

Reproduce

herbie shell --seed 2019362 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"
  :precision binary64

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

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