Average Error: 13.5 → 13.4
Time: 32.5s
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 r60009 = x;
        double r60010 = 1.0;
        double r60011 = B;
        double r60012 = tan(r60011);
        double r60013 = r60010 / r60012;
        double r60014 = r60009 * r60013;
        double r60015 = -r60014;
        double r60016 = F;
        double r60017 = sin(r60011);
        double r60018 = r60016 / r60017;
        double r60019 = r60016 * r60016;
        double r60020 = 2.0;
        double r60021 = r60019 + r60020;
        double r60022 = r60020 * r60009;
        double r60023 = r60021 + r60022;
        double r60024 = r60010 / r60020;
        double r60025 = -r60024;
        double r60026 = pow(r60023, r60025);
        double r60027 = r60018 * r60026;
        double r60028 = r60015 + r60027;
        return r60028;
}

double f(double F, double B, double x) {
        double r60029 = F;
        double r60030 = B;
        double r60031 = sin(r60030);
        double r60032 = r60029 / r60031;
        double r60033 = 2.0;
        double r60034 = x;
        double r60035 = fma(r60029, r60029, r60033);
        double r60036 = fma(r60033, r60034, r60035);
        double r60037 = 1.0;
        double r60038 = r60037 / r60033;
        double r60039 = pow(r60036, r60038);
        double r60040 = r60032 / r60039;
        double r60041 = r60034 * r60037;
        double r60042 = tan(r60030);
        double r60043 = r60041 / r60042;
        double r60044 = -r60043;
        double r60045 = r60040 + r60044;
        return r60045;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.5

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

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

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

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

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

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

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

    \[\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 2019212 +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))))))