Average Error: 0.2 → 0.1
Time: 26.0s
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 r1605509 = x;
        double r1605510 = 1.0;
        double r1605511 = B;
        double r1605512 = tan(r1605511);
        double r1605513 = r1605510 / r1605512;
        double r1605514 = r1605509 * r1605513;
        double r1605515 = -r1605514;
        double r1605516 = sin(r1605511);
        double r1605517 = r1605510 / r1605516;
        double r1605518 = r1605515 + r1605517;
        return r1605518;
}

double f(double B, double x) {
        double r1605519 = 1.0;
        double r1605520 = B;
        double r1605521 = sin(r1605520);
        double r1605522 = r1605519 / r1605521;
        double r1605523 = x;
        double r1605524 = tan(r1605520);
        double r1605525 = r1605523 / r1605524;
        double r1605526 = r1605522 - r1605525;
        return r1605526;
}

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))))