Average Error: 0.2 → 0.2
Time: 16.7s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} \cdot \left(1 - x \cdot \cos B\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} \cdot \left(1 - x \cdot \cos B\right)
double f(double B, double x) {
        double r44287 = x;
        double r44288 = 1.0;
        double r44289 = B;
        double r44290 = tan(r44289);
        double r44291 = r44288 / r44290;
        double r44292 = r44287 * r44291;
        double r44293 = -r44292;
        double r44294 = sin(r44289);
        double r44295 = r44288 / r44294;
        double r44296 = r44293 + r44295;
        return r44296;
}

double f(double B, double x) {
        double r44297 = 1.0;
        double r44298 = B;
        double r44299 = sin(r44298);
        double r44300 = r44297 / r44299;
        double r44301 = 1.0;
        double r44302 = x;
        double r44303 = cos(r44298);
        double r44304 = r44302 * r44303;
        double r44305 = r44301 - r44304;
        double r44306 = r44300 * r44305;
        return r44306;
}

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. Taylor expanded around inf 0.2

    \[\leadsto \color{blue}{1 \cdot \frac{1}{\sin B} - 1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  5. Simplified0.2

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

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

Reproduce

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