Average Error: 0.2 → 0.3
Time: 6.8m
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 r7131178 = x;
        double r7131179 = 1.0;
        double r7131180 = B;
        double r7131181 = tan(r7131180);
        double r7131182 = r7131179 / r7131181;
        double r7131183 = r7131178 * r7131182;
        double r7131184 = -r7131183;
        double r7131185 = sin(r7131180);
        double r7131186 = r7131179 / r7131185;
        double r7131187 = r7131184 + r7131186;
        return r7131187;
}

double f(double B, double x) {
        double r7131188 = 1.0;
        double r7131189 = B;
        double r7131190 = sin(r7131189);
        double r7131191 = r7131188 / r7131190;
        double r7131192 = x;
        double r7131193 = r7131188 / r7131192;
        double r7131194 = tan(r7131189);
        double r7131195 = r7131193 * r7131194;
        double r7131196 = r7131188 / r7131195;
        double r7131197 = r7131191 - r7131196;
        return r7131197;
}

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

    \[\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.3

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

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

Reproduce

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