Average Error: 35.2 → 28.2
Time: 19.3s
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(\sqrt[3]{\frac{1}{\cos \left(\frac{x}{2 \cdot y}\right)} \cdot \left(\frac{1}{\cos \left(\frac{x}{2 \cdot y}\right)} \cdot \frac{1}{\cos \left(\frac{x}{2 \cdot y}\right)}\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(\sqrt[3]{\frac{1}{\cos \left(\frac{x}{2 \cdot y}\right)} \cdot \left(\frac{1}{\cos \left(\frac{x}{2 \cdot y}\right)} \cdot \frac{1}{\cos \left(\frac{x}{2 \cdot y}\right)}\right)}\right)\right)
double f(double x, double y) {
        double r23371703 = x;
        double r23371704 = y;
        double r23371705 = 2.0;
        double r23371706 = r23371704 * r23371705;
        double r23371707 = r23371703 / r23371706;
        double r23371708 = tan(r23371707);
        double r23371709 = sin(r23371707);
        double r23371710 = r23371708 / r23371709;
        return r23371710;
}

double f(double x, double y) {
        double r23371711 = 1.0;
        double r23371712 = x;
        double r23371713 = 2.0;
        double r23371714 = y;
        double r23371715 = r23371713 * r23371714;
        double r23371716 = r23371712 / r23371715;
        double r23371717 = cos(r23371716);
        double r23371718 = r23371711 / r23371717;
        double r23371719 = r23371718 * r23371718;
        double r23371720 = r23371718 * r23371719;
        double r23371721 = cbrt(r23371720);
        double r23371722 = expm1(r23371721);
        double r23371723 = log1p(r23371722);
        return r23371723;
}

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.2
Target28.5
Herbie28.2
\[\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.2

    \[\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.2

    \[\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. Using strategy rm
  5. Applied log1p-expm1-u35.3

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

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

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

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

Reproduce

herbie shell --seed 2019172 +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)))))