Average Error: 0.2 → 0.2
Time: 23.3s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}
double f(double B, double x) {
        double r22009 = x;
        double r22010 = 1.0;
        double r22011 = B;
        double r22012 = tan(r22011);
        double r22013 = r22010 / r22012;
        double r22014 = r22009 * r22013;
        double r22015 = -r22014;
        double r22016 = sin(r22011);
        double r22017 = r22010 / r22016;
        double r22018 = r22015 + r22017;
        return r22018;
}

double f(double B, double x) {
        double r22019 = 1.0;
        double r22020 = x;
        double r22021 = B;
        double r22022 = cos(r22021);
        double r22023 = r22020 * r22022;
        double r22024 = r22019 * r22023;
        double r22025 = r22019 - r22024;
        double r22026 = sin(r22021);
        double r22027 = r22025 / r22026;
        return r22027;
}

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} - x \cdot \frac{1}{\tan B}}\]
  3. Using strategy rm
  4. Applied associate-*r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
  5. Taylor expanded around inf 0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  6. Using strategy rm
  7. Applied associate-*r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1 \cdot \left(x \cdot \cos B\right)}{\sin B}}\]
  8. Applied sub-div0.2

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

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

Reproduce

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