Average Error: 0.2 → 0.2
Time: 36.1s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B
double f(double B, double x) {
        double r639084 = x;
        double r639085 = 1.0;
        double r639086 = B;
        double r639087 = tan(r639086);
        double r639088 = r639085 / r639087;
        double r639089 = r639084 * r639088;
        double r639090 = -r639089;
        double r639091 = sin(r639086);
        double r639092 = r639085 / r639091;
        double r639093 = r639090 + r639092;
        return r639093;
}

double f(double B, double x) {
        double r639094 = 1.0;
        double r639095 = B;
        double r639096 = sin(r639095);
        double r639097 = r639094 / r639096;
        double r639098 = x;
        double r639099 = r639098 / r639096;
        double r639100 = cos(r639095);
        double r639101 = r639099 * r639100;
        double r639102 = r639097 - r639101;
        return r639102;
}

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. Using strategy rm
  4. Applied tan-quot0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{\frac{\sin B}{\cos B}}}\]
  5. Applied associate-/r/0.2

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

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

Reproduce

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