Average Error: 0.2 → 0.2
Time: 5.6s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{-x}{\frac{\sin B}{1 \cdot \cos B}} + \frac{1}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{-x}{\frac{\sin B}{1 \cdot \cos B}} + \frac{1}{\sin B}
double f(double B, double x) {
        double r11923 = x;
        double r11924 = 1.0;
        double r11925 = B;
        double r11926 = tan(r11925);
        double r11927 = r11924 / r11926;
        double r11928 = r11923 * r11927;
        double r11929 = -r11928;
        double r11930 = sin(r11925);
        double r11931 = r11924 / r11930;
        double r11932 = r11929 + r11931;
        return r11932;
}

double f(double B, double x) {
        double r11933 = x;
        double r11934 = -r11933;
        double r11935 = B;
        double r11936 = sin(r11935);
        double r11937 = 1.0;
        double r11938 = cos(r11935);
        double r11939 = r11937 * r11938;
        double r11940 = r11936 / r11939;
        double r11941 = r11934 / r11940;
        double r11942 = r11937 / r11936;
        double r11943 = r11941 + r11942;
        return r11943;
}

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}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{1}{\sin B}\right)}\]
  3. Taylor expanded around inf 0.2

    \[\leadsto \mathsf{fma}\left(-x, \color{blue}{1 \cdot \frac{\cos B}{\sin B}}, \frac{1}{\sin B}\right)\]
  4. Using strategy rm
  5. Applied fma-udef0.2

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

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

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

    \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{1 \cdot \cos B}}} + \frac{1}{\sin B}\]
  11. Final simplification0.2

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

Reproduce

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