Average Error: 0.2 → 0.2
Time: 4.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\left(-\frac{1}{\frac{\sin B}{x \cdot 1}} \cdot \cos B\right) + \frac{1}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\left(-\frac{1}{\frac{\sin B}{x \cdot 1}} \cdot \cos B\right) + \frac{1}{\sin B}
double f(double B, double x) {
        double r52094 = x;
        double r52095 = 1.0;
        double r52096 = B;
        double r52097 = tan(r52096);
        double r52098 = r52095 / r52097;
        double r52099 = r52094 * r52098;
        double r52100 = -r52099;
        double r52101 = sin(r52096);
        double r52102 = r52095 / r52101;
        double r52103 = r52100 + r52102;
        return r52103;
}

double f(double B, double x) {
        double r52104 = 1.0;
        double r52105 = B;
        double r52106 = sin(r52105);
        double r52107 = x;
        double r52108 = 1.0;
        double r52109 = r52107 * r52108;
        double r52110 = r52106 / r52109;
        double r52111 = r52104 / r52110;
        double r52112 = cos(r52105);
        double r52113 = r52111 * r52112;
        double r52114 = -r52113;
        double r52115 = r52108 / r52106;
        double r52116 = r52114 + r52115;
        return r52116;
}

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

    \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + \frac{1}{\sin B}\]
  4. Applied associate-/r/0.3

    \[\leadsto \left(-x \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \cos B\right)}\right) + \frac{1}{\sin B}\]
  5. Applied associate-*r*0.2

    \[\leadsto \left(-\color{blue}{\left(x \cdot \frac{1}{\sin B}\right) \cdot \cos B}\right) + \frac{1}{\sin B}\]
  6. Using strategy rm
  7. Applied associate-*r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\sin B}} \cdot \cos B\right) + \frac{1}{\sin B}\]
  8. Using strategy rm
  9. Applied clear-num0.2

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

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

Reproduce

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