Average Error: 0.2 → 0.2
Time: 12.3s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[-\left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
-\left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)
double f(double B, double x) {
        double r13902 = x;
        double r13903 = 1.0;
        double r13904 = B;
        double r13905 = tan(r13904);
        double r13906 = r13903 / r13905;
        double r13907 = r13902 * r13906;
        double r13908 = -r13907;
        double r13909 = sin(r13904);
        double r13910 = r13903 / r13909;
        double r13911 = r13908 + r13910;
        return r13911;
}

double f(double B, double x) {
        double r13912 = x;
        double r13913 = 1.0;
        double r13914 = r13912 * r13913;
        double r13915 = B;
        double r13916 = tan(r13915);
        double r13917 = r13914 / r13916;
        double r13918 = sin(r13915);
        double r13919 = r13913 / r13918;
        double r13920 = r13917 - r13919;
        double r13921 = -r13920;
        return r13921;
}

Error

Bits error versus B

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
  2. Using strategy rm
  3. Applied associate-*r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{1}{\sin B}\]
  4. Using strategy rm
  5. Applied clear-num0.2

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{\sin B}\]
  6. Using strategy rm
  7. Applied neg-sub00.2

    \[\leadsto \color{blue}{\left(0 - \frac{1}{\frac{\tan B}{x \cdot 1}}\right)} + \frac{1}{\sin B}\]
  8. Applied associate-+l-0.2

    \[\leadsto \color{blue}{0 - \left(\frac{1}{\frac{\tan B}{x \cdot 1}} - \frac{1}{\sin B}\right)}\]
  9. Simplified0.2

    \[\leadsto 0 - \color{blue}{\left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)}\]
  10. Final simplification0.2

    \[\leadsto -\left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)\]

Reproduce

herbie shell --seed 2020047 
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  :precision binary64
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))