Average Error: 35.4 → 27.5
Time: 16.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.69286171955532038779779213655274361372:\\ \;\;\;\;\sqrt[3]{\left(\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)} \cdot \frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}\right) \cdot \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.69286171955532038779779213655274361372:\\
\;\;\;\;\sqrt[3]{\left(\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)} \cdot \frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}\right) \cdot \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 r19456569 = x;
        double r19456570 = y;
        double r19456571 = 2.0;
        double r19456572 = r19456570 * r19456571;
        double r19456573 = r19456569 / r19456572;
        double r19456574 = tan(r19456573);
        double r19456575 = sin(r19456573);
        double r19456576 = r19456574 / r19456575;
        return r19456576;
}

double f(double x, double y) {
        double r19456577 = x;
        double r19456578 = 2.0;
        double r19456579 = y;
        double r19456580 = r19456578 * r19456579;
        double r19456581 = r19456577 / r19456580;
        double r19456582 = tan(r19456581);
        double r19456583 = sin(r19456581);
        double r19456584 = r19456582 / r19456583;
        double r19456585 = 2.6928617195553204;
        bool r19456586 = r19456584 <= r19456585;
        double r19456587 = r19456584 * r19456584;
        double r19456588 = r19456587 * r19456584;
        double r19456589 = cbrt(r19456588);
        double r19456590 = 1.0;
        double r19456591 = r19456586 ? r19456589 : r19456590;
        return r19456591;
}

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.4
Target28.9
Herbie27.5
\[\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.6928617195553204

    1. Initial program 24.9

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

      \[\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-cbrt-cube45.0

      \[\leadsto \frac{1}{\frac{\sin \left(\frac{x}{y \cdot 2}\right)}{\color{blue}{\sqrt[3]{\left(\tan \left(\frac{x}{y \cdot 2}\right) \cdot \tan \left(\frac{x}{y \cdot 2}\right)\right) \cdot \tan \left(\frac{x}{y \cdot 2}\right)}}}}\]
    6. Applied add-cbrt-cube45.2

      \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt[3]{\left(\sin \left(\frac{x}{y \cdot 2}\right) \cdot \sin \left(\frac{x}{y \cdot 2}\right)\right) \cdot \sin \left(\frac{x}{y \cdot 2}\right)}}}{\sqrt[3]{\left(\tan \left(\frac{x}{y \cdot 2}\right) \cdot \tan \left(\frac{x}{y \cdot 2}\right)\right) \cdot \tan \left(\frac{x}{y \cdot 2}\right)}}}\]
    7. Applied cbrt-undiv45.2

      \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{\frac{\left(\sin \left(\frac{x}{y \cdot 2}\right) \cdot \sin \left(\frac{x}{y \cdot 2}\right)\right) \cdot \sin \left(\frac{x}{y \cdot 2}\right)}{\left(\tan \left(\frac{x}{y \cdot 2}\right) \cdot \tan \left(\frac{x}{y \cdot 2}\right)\right) \cdot \tan \left(\frac{x}{y \cdot 2}\right)}}}}\]
    8. Applied add-cbrt-cube45.2

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(1 \cdot 1\right) \cdot 1}}}{\sqrt[3]{\frac{\left(\sin \left(\frac{x}{y \cdot 2}\right) \cdot \sin \left(\frac{x}{y \cdot 2}\right)\right) \cdot \sin \left(\frac{x}{y \cdot 2}\right)}{\left(\tan \left(\frac{x}{y \cdot 2}\right) \cdot \tan \left(\frac{x}{y \cdot 2}\right)\right) \cdot \tan \left(\frac{x}{y \cdot 2}\right)}}}\]
    9. Applied cbrt-undiv45.2

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

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

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

    1. Initial program 62.7

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

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

    \[\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.69286171955532038779779213655274361372:\\ \;\;\;\;\sqrt[3]{\left(\frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)} \cdot \frac{\tan \left(\frac{x}{2 \cdot y}\right)}{\sin \left(\frac{x}{2 \cdot y}\right)}\right) \cdot \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 2019179 
(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)))))