Average Error: 0.2 → 0.1
Time: 27.2s
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 r486525 = x;
        double r486526 = 1.0;
        double r486527 = B;
        double r486528 = tan(r486527);
        double r486529 = r486526 / r486528;
        double r486530 = r486525 * r486529;
        double r486531 = -r486530;
        double r486532 = sin(r486527);
        double r486533 = r486526 / r486532;
        double r486534 = r486531 + r486533;
        return r486534;
}

double f(double B, double x) {
        double r486535 = 1.0;
        double r486536 = B;
        double r486537 = sin(r486536);
        double r486538 = r486535 / r486537;
        double r486539 = x;
        double r486540 = tan(r486536);
        double r486541 = r486539 / r486540;
        double r486542 = r486538 - r486541;
        return r486542;
}

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 
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))