Average Error: 0.2 → 0.2
Time: 26.9s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\frac{1}{x} \cdot \tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\frac{1}{x} \cdot \tan B}
double f(double B, double x) {
        double r1120214 = x;
        double r1120215 = 1.0;
        double r1120216 = B;
        double r1120217 = tan(r1120216);
        double r1120218 = r1120215 / r1120217;
        double r1120219 = r1120214 * r1120218;
        double r1120220 = -r1120219;
        double r1120221 = sin(r1120216);
        double r1120222 = r1120215 / r1120221;
        double r1120223 = r1120220 + r1120222;
        return r1120223;
}

double f(double B, double x) {
        double r1120224 = 1.0;
        double r1120225 = B;
        double r1120226 = sin(r1120225);
        double r1120227 = r1120224 / r1120226;
        double r1120228 = x;
        double r1120229 = r1120224 / r1120228;
        double r1120230 = tan(r1120225);
        double r1120231 = r1120229 * r1120230;
        double r1120232 = r1120224 / r1120231;
        double r1120233 = r1120227 - r1120232;
        return r1120233;
}

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 clear-num0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}}\]
  5. Using strategy rm
  6. Applied div-inv0.2

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

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

Reproduce

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