Average Error: 35.1 → 26.9
Time: 17.6s
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{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)} \le 18.897821419563815:\\ \;\;\;\;\sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \left(\sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}}\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{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)} \le 18.897821419563815:\\
\;\;\;\;\sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \left(\sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}}\right)\\

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

\end{array}
double f(double x, double y) {
        double r29044163 = x;
        double r29044164 = y;
        double r29044165 = 2.0;
        double r29044166 = r29044164 * r29044165;
        double r29044167 = r29044163 / r29044166;
        double r29044168 = tan(r29044167);
        double r29044169 = sin(r29044167);
        double r29044170 = r29044168 / r29044169;
        return r29044170;
}

double f(double x, double y) {
        double r29044171 = x;
        double r29044172 = 2.0;
        double r29044173 = y;
        double r29044174 = r29044172 * r29044173;
        double r29044175 = r29044171 / r29044174;
        double r29044176 = tan(r29044175);
        double r29044177 = sin(r29044175);
        double r29044178 = r29044176 / r29044177;
        double r29044179 = 18.897821419563815;
        bool r29044180 = r29044178 <= r29044179;
        double r29044181 = cbrt(r29044178);
        double r29044182 = r29044181 * r29044181;
        double r29044183 = r29044181 * r29044182;
        double r29044184 = 1.0;
        double r29044185 = r29044180 ? r29044183 : r29044184;
        return r29044185;
}

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.1
Target28.2
Herbie26.9
\[\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 (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 18.897821419563815

    1. Initial program 26.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.3

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

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

    1. Initial program 62.2

      \[\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}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification26.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)} \le 18.897821419563815:\\ \;\;\;\;\sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \left(\sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}} \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}}\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)))))