Average Error: 13.7 → 13.6
Time: 17.6s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
\[\frac{\frac{F}{\sin B}}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}} + \left(-\frac{x \cdot 1}{\tan B}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\frac{\frac{F}{\sin B}}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}} + \left(-\frac{x \cdot 1}{\tan B}\right)
double f(double F, double B, double x) {
        double r50263 = x;
        double r50264 = 1.0;
        double r50265 = B;
        double r50266 = tan(r50265);
        double r50267 = r50264 / r50266;
        double r50268 = r50263 * r50267;
        double r50269 = -r50268;
        double r50270 = F;
        double r50271 = sin(r50265);
        double r50272 = r50270 / r50271;
        double r50273 = r50270 * r50270;
        double r50274 = 2.0;
        double r50275 = r50273 + r50274;
        double r50276 = r50274 * r50263;
        double r50277 = r50275 + r50276;
        double r50278 = r50264 / r50274;
        double r50279 = -r50278;
        double r50280 = pow(r50277, r50279);
        double r50281 = r50272 * r50280;
        double r50282 = r50269 + r50281;
        return r50282;
}

double f(double F, double B, double x) {
        double r50283 = F;
        double r50284 = B;
        double r50285 = sin(r50284);
        double r50286 = r50283 / r50285;
        double r50287 = 2.0;
        double r50288 = x;
        double r50289 = fma(r50283, r50283, r50287);
        double r50290 = fma(r50287, r50288, r50289);
        double r50291 = 1.0;
        double r50292 = r50291 / r50287;
        double r50293 = pow(r50290, r50292);
        double r50294 = r50286 / r50293;
        double r50295 = r50288 * r50291;
        double r50296 = tan(r50284);
        double r50297 = r50295 / r50296;
        double r50298 = -r50297;
        double r50299 = r50294 + r50298;
        return r50299;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.7

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
  2. Simplified13.7

    \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)}\]
  3. Using strategy rm
  4. Applied associate-*r/13.6

    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\]
  5. Using strategy rm
  6. Applied pow-neg13.6

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}}, \frac{F}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]
  7. Using strategy rm
  8. Applied fma-udef13.6

    \[\leadsto \color{blue}{\frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}} \cdot \frac{F}{\sin B} + \left(-\frac{x \cdot 1}{\tan B}\right)}\]
  9. Simplified13.6

    \[\leadsto \color{blue}{\frac{\frac{F}{\sin B}}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}} + \left(-\frac{x \cdot 1}{\tan B}\right)\]
  10. Final simplification13.6

    \[\leadsto \frac{\frac{F}{\sin B}}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}} + \left(-\frac{x \cdot 1}{\tan B}\right)\]

Reproduce

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