Average Error: 0.2 → 0.2
Time: 25.3s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}
double f(double B, double x) {
        double r886776 = x;
        double r886777 = 1.0;
        double r886778 = B;
        double r886779 = tan(r886778);
        double r886780 = r886777 / r886779;
        double r886781 = r886776 * r886780;
        double r886782 = -r886781;
        double r886783 = sin(r886778);
        double r886784 = r886777 / r886783;
        double r886785 = r886782 + r886784;
        return r886785;
}

double f(double B, double x) {
        double r886786 = 1.0;
        double r886787 = B;
        double r886788 = sin(r886787);
        double r886789 = r886786 / r886788;
        double r886790 = 1.0;
        double r886791 = tan(r886787);
        double r886792 = x;
        double r886793 = r886786 * r886792;
        double r886794 = r886791 / r886793;
        double r886795 = r886790 / r886794;
        double r886796 = r886789 - r886795;
        return r886796;
}

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. Using strategy rm
  4. Applied clear-num0.2

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

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

Reproduce

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