Average Error: 36.1 → 28.0
Time: 12.2s
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}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \le \frac{8727737956453137}{4503599627370496}:\\ \;\;\;\;\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right) \cdot \log \left(e^{\left(\sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)} \cdot \sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)}\right) \cdot \sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)}}\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}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \le \frac{8727737956453137}{4503599627370496}:\\
\;\;\;\;\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right) \cdot \log \left(e^{\left(\sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)} \cdot \sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)}\right) \cdot \sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)}}\right)}\\

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

\end{array}
double f(double x, double y) {
        double r423501 = x;
        double r423502 = y;
        double r423503 = 2.0;
        double r423504 = r423502 * r423503;
        double r423505 = r423501 / r423504;
        double r423506 = tan(r423505);
        double r423507 = sin(r423505);
        double r423508 = r423506 / r423507;
        return r423508;
}

double f(double x, double y) {
        double r423509 = x;
        double r423510 = y;
        double r423511 = 2.0;
        double r423512 = r423510 * r423511;
        double r423513 = r423509 / r423512;
        double r423514 = tan(r423513);
        double r423515 = sin(r423513);
        double r423516 = r423514 / r423515;
        double r423517 = 8727737956453137.0;
        double r423518 = 4503599627370496.0;
        double r423519 = r423517 / r423518;
        bool r423520 = r423516 <= r423519;
        double r423521 = cos(r423513);
        double r423522 = cbrt(r423521);
        double r423523 = r423522 * r423522;
        double r423524 = r423523 * r423522;
        double r423525 = exp(r423524);
        double r423526 = log(r423525);
        double r423527 = r423515 * r423526;
        double r423528 = r423515 / r423527;
        double r423529 = 1.0;
        double r423530 = r423520 ? r423528 : r423529;
        return r423530;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original36.1
Target29.3
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)))) < 1.937947126429837

    1. Initial program 25.1

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

      \[\leadsto \frac{\color{blue}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\cos \left(\frac{x}{y \cdot 2}\right)}}}{\sin \left(\frac{x}{y \cdot 2}\right)}\]
    4. Applied associate-/l/25.1

      \[\leadsto \color{blue}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)}}\]
    5. Using strategy rm
    6. Applied add-log-exp25.1

      \[\leadsto \frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right) \cdot \color{blue}{\log \left(e^{\cos \left(\frac{x}{y \cdot 2}\right)}\right)}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt25.1

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

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

    1. Initial program 61.9

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

      \[\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}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \le \frac{8727737956453137}{4503599627370496}:\\ \;\;\;\;\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right) \cdot \log \left(e^{\left(\sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)} \cdot \sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)}\right) \cdot \sqrt[3]{\cos \left(\frac{x}{y \cdot 2}\right)}}\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< y -1.23036909113069936e114) 1 (if (< y -9.1028524068119138e-222) (/ (sin (/ x (* y 2))) (* (sin (/ x (* y 2))) (log (exp (cos (/ x (* y 2))))))) 1))

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