Average Error: 0.2 → 0.2
Time: 23.5s
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 r333633 = x;
        double r333634 = 1.0;
        double r333635 = B;
        double r333636 = tan(r333635);
        double r333637 = r333634 / r333636;
        double r333638 = r333633 * r333637;
        double r333639 = -r333638;
        double r333640 = sin(r333635);
        double r333641 = r333634 / r333640;
        double r333642 = r333639 + r333641;
        return r333642;
}

double f(double B, double x) {
        double r333643 = 1.0;
        double r333644 = B;
        double r333645 = sin(r333644);
        double r333646 = r333643 / r333645;
        double r333647 = x;
        double r333648 = tan(r333644);
        double r333649 = r333647 / r333648;
        double r333650 = r333646 - r333649;
        return r333650;
}

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}{\tan B}}\]
  3. Using strategy rm
  4. Applied div-inv0.2

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

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

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

Reproduce

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