Average Error: 0.2 → 0.1
Time: 3.4m
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\tan B}
double f(double B, double x) {
        double r3307351 = x;
        double r3307352 = 1.0;
        double r3307353 = B;
        double r3307354 = tan(r3307353);
        double r3307355 = r3307352 / r3307354;
        double r3307356 = r3307351 * r3307355;
        double r3307357 = -r3307356;
        double r3307358 = sin(r3307353);
        double r3307359 = r3307352 / r3307358;
        double r3307360 = r3307357 + r3307359;
        return r3307360;
}

double f(double B, double x) {
        double r3307361 = 1.0;
        double r3307362 = B;
        double r3307363 = sin(r3307362);
        double r3307364 = r3307361 / r3307363;
        double r3307365 = x;
        double r3307366 = tan(r3307362);
        double r3307367 = r3307365 / r3307366;
        double r3307368 = r3307364 - r3307367;
        return r3307368;
}

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.1

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

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

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

Reproduce

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