Average Error: 0.2 → 0.2
Time: 25.7s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}
double f(double B, double x) {
        double r911897 = x;
        double r911898 = 1.0;
        double r911899 = B;
        double r911900 = tan(r911899);
        double r911901 = r911898 / r911900;
        double r911902 = r911897 * r911901;
        double r911903 = -r911902;
        double r911904 = sin(r911899);
        double r911905 = r911898 / r911904;
        double r911906 = r911903 + r911905;
        return r911906;
}

double f(double B, double x) {
        double r911907 = 1.0;
        double r911908 = B;
        double r911909 = sin(r911908);
        double r911910 = r911907 / r911909;
        double r911911 = 1.0;
        double r911912 = tan(r911908);
        double r911913 = x;
        double r911914 = r911907 * r911913;
        double r911915 = r911912 / r911914;
        double r911916 = r911911 / r911915;
        double r911917 = r911910 - r911916;
        return r911917;
}

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. Simplified0.2

    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}}\]
  3. Using strategy rm
  4. Applied clear-num0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\]
  5. Final simplification0.2

    \[\leadsto \frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\]

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))