Average Error: 0.2 → 0.2
Time: 12.1s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}
double f(double B, double x) {
        double r15642 = x;
        double r15643 = 1.0;
        double r15644 = B;
        double r15645 = tan(r15644);
        double r15646 = r15643 / r15645;
        double r15647 = r15642 * r15646;
        double r15648 = -r15647;
        double r15649 = sin(r15644);
        double r15650 = r15643 / r15649;
        double r15651 = r15648 + r15650;
        return r15651;
}

double f(double B, double x) {
        double r15652 = 1.0;
        double r15653 = B;
        double r15654 = sin(r15653);
        double r15655 = r15652 / r15654;
        double r15656 = x;
        double r15657 = r15656 * r15652;
        double r15658 = tan(r15653);
        double r15659 = r15657 / r15658;
        double r15660 = r15655 - r15659;
        return r15660;
}

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. Using strategy rm
  3. Applied associate-*r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{1}{\sin B}\]
  4. Using strategy rm
  5. Applied clear-num0.2

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{\sin B}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.2

    \[\leadsto \left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \color{blue}{1 \cdot \frac{1}{\sin B}}\]
  8. Applied *-un-lft-identity0.2

    \[\leadsto \color{blue}{1 \cdot \left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right)} + 1 \cdot \frac{1}{\sin B}\]
  9. Applied distribute-lft-out0.2

    \[\leadsto \color{blue}{1 \cdot \left(\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \frac{1}{\sin B}\right)}\]
  10. Simplified0.2

    \[\leadsto 1 \cdot \color{blue}{\left(\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\right)}\]
  11. Final simplification0.2

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

Reproduce

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