Average Error: 0.2 → 0.2
Time: 25.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{\frac{\tan B}{\sin B} - x}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{\frac{\tan B}{\sin B} - x}{\tan B}
double f(double B, double x) {
        double r1568459 = x;
        double r1568460 = 1.0;
        double r1568461 = B;
        double r1568462 = tan(r1568461);
        double r1568463 = r1568460 / r1568462;
        double r1568464 = r1568459 * r1568463;
        double r1568465 = -r1568464;
        double r1568466 = sin(r1568461);
        double r1568467 = r1568460 / r1568466;
        double r1568468 = r1568465 + r1568467;
        return r1568468;
}

double f(double B, double x) {
        double r1568469 = B;
        double r1568470 = tan(r1568469);
        double r1568471 = sin(r1568469);
        double r1568472 = r1568470 / r1568471;
        double r1568473 = x;
        double r1568474 = r1568472 - r1568473;
        double r1568475 = r1568474 / r1568470;
        return r1568475;
}

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 frac-sub10.4

    \[\leadsto \color{blue}{\frac{1 \cdot \tan B - \sin B \cdot x}{\sin B \cdot \tan B}}\]
  5. Simplified10.4

    \[\leadsto \frac{\color{blue}{\tan B - \sin B \cdot x}}{\sin B \cdot \tan B}\]
  6. Using strategy rm
  7. Applied associate-/r*0.2

    \[\leadsto \color{blue}{\frac{\frac{\tan B - \sin B \cdot x}{\sin B}}{\tan B}}\]
  8. Simplified0.2

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

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

Reproduce

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