Average Error: 0.2 → 0.2
Time: 6.2s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{\frac{1 \cdot \left(\tan B - \sin B \cdot x\right)}{\sin B}}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{\frac{1 \cdot \left(\tan B - \sin B \cdot x\right)}{\sin B}}{\tan B}
double f(double B, double x) {
        double r16018 = x;
        double r16019 = 1.0;
        double r16020 = B;
        double r16021 = tan(r16020);
        double r16022 = r16019 / r16021;
        double r16023 = r16018 * r16022;
        double r16024 = -r16023;
        double r16025 = sin(r16020);
        double r16026 = r16019 / r16025;
        double r16027 = r16024 + r16026;
        return r16027;
}

double f(double B, double x) {
        double r16028 = 1.0;
        double r16029 = B;
        double r16030 = tan(r16029);
        double r16031 = sin(r16029);
        double r16032 = x;
        double r16033 = r16031 * r16032;
        double r16034 = r16030 - r16033;
        double r16035 = r16028 * r16034;
        double r16036 = r16035 / r16031;
        double r16037 = r16036 / r16030;
        return r16037;
}

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. Applied frac-sub11.1

    \[\leadsto \color{blue}{\frac{1 \cdot \tan B - \sin B \cdot \left(x \cdot 1\right)}{\sin B \cdot \tan B}}\]
  6. Simplified11.1

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

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

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

Reproduce

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