Average Error: 0.2 → 0.2
Time: 48.6s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\tan B \cdot \frac{1}{x}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\tan B \cdot \frac{1}{x}}
double f(double B, double x) {
        double r972664 = x;
        double r972665 = 1.0;
        double r972666 = B;
        double r972667 = tan(r972666);
        double r972668 = r972665 / r972667;
        double r972669 = r972664 * r972668;
        double r972670 = -r972669;
        double r972671 = sin(r972666);
        double r972672 = r972665 / r972671;
        double r972673 = r972670 + r972672;
        return r972673;
}

double f(double B, double x) {
        double r972674 = 1.0;
        double r972675 = B;
        double r972676 = sin(r972675);
        double r972677 = r972674 / r972676;
        double r972678 = tan(r972675);
        double r972679 = 1.0;
        double r972680 = x;
        double r972681 = r972679 / r972680;
        double r972682 = r972678 * r972681;
        double r972683 = r972674 / r972682;
        double r972684 = r972677 - r972683;
        return r972684;
}

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{1 \cdot x}{\tan B}}\]
  3. Using strategy rm
  4. Applied associate-/l*0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}}\]
  5. Using strategy rm
  6. Applied div-inv0.2

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

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

Reproduce

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