Average Error: 0.2 → 0.3
Time: 35.9s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} \cdot \left(1 - \left(\cos B \cdot x\right) \cdot 1\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} \cdot \left(1 - \left(\cos B \cdot x\right) \cdot 1\right)
double f(double B, double x) {
        double r886002 = x;
        double r886003 = 1.0;
        double r886004 = B;
        double r886005 = tan(r886004);
        double r886006 = r886003 / r886005;
        double r886007 = r886002 * r886006;
        double r886008 = -r886007;
        double r886009 = sin(r886004);
        double r886010 = r886003 / r886009;
        double r886011 = r886008 + r886010;
        return r886011;
}

double f(double B, double x) {
        double r886012 = 1.0;
        double r886013 = B;
        double r886014 = sin(r886013);
        double r886015 = r886012 / r886014;
        double r886016 = 1.0;
        double r886017 = cos(r886013);
        double r886018 = x;
        double r886019 = r886017 * r886018;
        double r886020 = r886019 * r886016;
        double r886021 = r886016 - r886020;
        double r886022 = r886015 * r886021;
        return r886022;
}

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 \cdot 1}{\tan B}}\]
  3. Taylor expanded around inf 0.2

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

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

    \[\leadsto \color{blue}{\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}}\]
  7. Using strategy rm
  8. Applied div-inv0.3

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

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

Reproduce

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