Average Error: 0.2 → 0.1
Time: 3.4m
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\tan B}
double f(double B, double x) {
        double r4593837 = x;
        double r4593838 = 1.0;
        double r4593839 = B;
        double r4593840 = tan(r4593839);
        double r4593841 = r4593838 / r4593840;
        double r4593842 = r4593837 * r4593841;
        double r4593843 = -r4593842;
        double r4593844 = sin(r4593839);
        double r4593845 = r4593838 / r4593844;
        double r4593846 = r4593843 + r4593845;
        return r4593846;
}

double f(double B, double x) {
        double r4593847 = 1.0;
        double r4593848 = B;
        double r4593849 = sin(r4593848);
        double r4593850 = r4593847 / r4593849;
        double r4593851 = x;
        double r4593852 = tan(r4593848);
        double r4593853 = r4593851 / r4593852;
        double r4593854 = r4593850 - r4593853;
        return r4593854;
}

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.1

    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}}\]
  3. Taylor expanded around -inf 0.1

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

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

Reproduce

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