Average Error: 13.7 → 13.7
Time: 38.9s
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)}\]
\[\mathsf{fma}\left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\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)\]
\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)}
\mathsf{fma}\left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\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)
double f(double F, double B, double x) {
        double r62655 = x;
        double r62656 = 1.0;
        double r62657 = B;
        double r62658 = tan(r62657);
        double r62659 = r62656 / r62658;
        double r62660 = r62655 * r62659;
        double r62661 = -r62660;
        double r62662 = F;
        double r62663 = sin(r62657);
        double r62664 = r62662 / r62663;
        double r62665 = r62662 * r62662;
        double r62666 = 2.0;
        double r62667 = r62665 + r62666;
        double r62668 = r62666 * r62655;
        double r62669 = r62667 + r62668;
        double r62670 = r62656 / r62666;
        double r62671 = -r62670;
        double r62672 = pow(r62669, r62671);
        double r62673 = r62664 * r62672;
        double r62674 = r62661 + r62673;
        return r62674;
}

double f(double F, double B, double x) {
        double r62675 = 2.0;
        double r62676 = x;
        double r62677 = F;
        double r62678 = fma(r62677, r62677, r62675);
        double r62679 = fma(r62675, r62676, r62678);
        double r62680 = sqrt(r62679);
        double r62681 = 1.0;
        double r62682 = r62681 / r62675;
        double r62683 = -r62682;
        double r62684 = pow(r62680, r62683);
        double r62685 = r62684 * r62684;
        double r62686 = B;
        double r62687 = sin(r62686);
        double r62688 = r62677 / r62687;
        double r62689 = r62676 * r62681;
        double r62690 = tan(r62686);
        double r62691 = r62689 / r62690;
        double r62692 = -r62691;
        double r62693 = fma(r62685, r62688, r62692);
        return r62693;
}

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.7

    \[\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 add-sqr-sqrt13.7

    \[\leadsto \mathsf{fma}\left({\color{blue}{\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sqrt{\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. Applied unpow-prod-down13.7

    \[\leadsto \mathsf{fma}\left(\color{blue}{{\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\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)\]
  8. Final simplification13.7

    \[\leadsto \mathsf{fma}\left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\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)\]

Reproduce

herbie shell --seed 2019322 +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))))))