Average Error: 0.2 → 0.2
Time: 6.3s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[1 \cdot \left(\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
1 \cdot \left(\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\right)
double f(double B, double x) {
        double r63493 = x;
        double r63494 = 1.0;
        double r63495 = B;
        double r63496 = tan(r63495);
        double r63497 = r63494 / r63496;
        double r63498 = r63493 * r63497;
        double r63499 = -r63498;
        double r63500 = sin(r63495);
        double r63501 = r63494 / r63500;
        double r63502 = r63499 + r63501;
        return r63502;
}

double f(double B, double x) {
        double r63503 = 1.0;
        double r63504 = 1.0;
        double r63505 = B;
        double r63506 = sin(r63505);
        double r63507 = r63504 / r63506;
        double r63508 = x;
        double r63509 = cos(r63505);
        double r63510 = r63506 / r63509;
        double r63511 = r63508 / r63510;
        double r63512 = r63507 - r63511;
        double r63513 = r63503 * r63512;
        return r63513;
}

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

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

    \[\leadsto \color{blue}{1 \cdot \left(\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\right)}\]
  4. Using strategy rm
  5. Applied associate-/l*0.2

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

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

Reproduce

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