Average Error: 0.2 → 0.2
Time: 13.5s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}
double f(double B, double x) {
        double r39006 = x;
        double r39007 = 1.0;
        double r39008 = B;
        double r39009 = tan(r39008);
        double r39010 = r39007 / r39009;
        double r39011 = r39006 * r39010;
        double r39012 = -r39011;
        double r39013 = sin(r39008);
        double r39014 = r39007 / r39013;
        double r39015 = r39012 + r39014;
        return r39015;
}

double f(double B, double x) {
        double r39016 = 1.0;
        double r39017 = B;
        double r39018 = sin(r39017);
        double r39019 = r39016 / r39018;
        double r39020 = x;
        double r39021 = r39020 * r39016;
        double r39022 = tan(r39017);
        double r39023 = r39021 / r39022;
        double r39024 = r39019 - r39023;
        return r39024;
}

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} - x \cdot \frac{1}{\tan B}}\]
  3. Using strategy rm
  4. Applied associate-*r/0.2

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

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

Reproduce

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