Average Error: 13.9 → 13.8
Time: 33.2s
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 r59546 = x;
        double r59547 = 1.0;
        double r59548 = B;
        double r59549 = tan(r59548);
        double r59550 = r59547 / r59549;
        double r59551 = r59546 * r59550;
        double r59552 = -r59551;
        double r59553 = F;
        double r59554 = sin(r59548);
        double r59555 = r59553 / r59554;
        double r59556 = r59553 * r59553;
        double r59557 = 2.0;
        double r59558 = r59556 + r59557;
        double r59559 = r59557 * r59546;
        double r59560 = r59558 + r59559;
        double r59561 = r59547 / r59557;
        double r59562 = -r59561;
        double r59563 = pow(r59560, r59562);
        double r59564 = r59555 * r59563;
        double r59565 = r59552 + r59564;
        return r59565;
}

double f(double F, double B, double x) {
        double r59566 = F;
        double r59567 = B;
        double r59568 = sin(r59567);
        double r59569 = r59566 / r59568;
        double r59570 = 2.0;
        double r59571 = x;
        double r59572 = fma(r59566, r59566, r59570);
        double r59573 = fma(r59570, r59571, r59572);
        double r59574 = 1.0;
        double r59575 = r59574 / r59570;
        double r59576 = pow(r59573, r59575);
        double r59577 = r59569 / r59576;
        double r59578 = r59571 * r59574;
        double r59579 = tan(r59567);
        double r59580 = r59578 / r59579;
        double r59581 = -r59580;
        double r59582 = r59577 + r59581;
        return r59582;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.9

    \[\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.9

    \[\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.8

    \[\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 div-inv13.8

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

    \[\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)}}}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]
  9. Using strategy rm
  10. Applied fma-udef13.8

    \[\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 \left(F \cdot \frac{1}{\sin B}\right) + \left(-\frac{x \cdot 1}{\tan B}\right)}\]
  11. Simplified13.8

    \[\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)\]
  12. Final simplification13.8

    \[\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 2019195 +o rules:numerics
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))