Average Error: 35.7 → 28.4
Time: 20.9s
Precision: 64
\[\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\sqrt[3]{\left(\cos \left(\frac{x}{y \cdot 2}\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)}}\right)\right)\]
\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\sqrt[3]{\left(\cos \left(\frac{x}{y \cdot 2}\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)}}\right)\right)
double f(double x, double y) {
        double r25874872 = x;
        double r25874873 = y;
        double r25874874 = 2.0;
        double r25874875 = r25874873 * r25874874;
        double r25874876 = r25874872 / r25874875;
        double r25874877 = tan(r25874876);
        double r25874878 = sin(r25874876);
        double r25874879 = r25874877 / r25874878;
        return r25874879;
}

double f(double x, double y) {
        double r25874880 = 1.0;
        double r25874881 = x;
        double r25874882 = y;
        double r25874883 = 2.0;
        double r25874884 = r25874882 * r25874883;
        double r25874885 = r25874881 / r25874884;
        double r25874886 = cos(r25874885);
        double r25874887 = r25874886 * r25874886;
        double r25874888 = r25874887 * r25874886;
        double r25874889 = cbrt(r25874888);
        double r25874890 = r25874880 / r25874889;
        double r25874891 = expm1(r25874890);
        double r25874892 = log1p(r25874891);
        return r25874892;
}

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.7
Target28.8
Herbie28.4
\[\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. Initial program 35.7

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

    \[\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/35.7

    \[\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 log1p-expm1-u35.8

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\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)}\right)\right)}\]
  7. Simplified28.4

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\frac{1}{\cos \left(\frac{x}{y \cdot 2}\right)}\right)}\right)\]
  8. Using strategy rm
  9. Applied add-cbrt-cube28.4

    \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\color{blue}{\sqrt[3]{\left(\cos \left(\frac{x}{y \cdot 2}\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)}}}\right)\right)\]
  10. Final simplification28.4

    \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\sqrt[3]{\left(\cos \left(\frac{x}{y \cdot 2}\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)\right) \cdot \cos \left(\frac{x}{y \cdot 2}\right)}}\right)\right)\]

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(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)))))