Average Error: 13.5 → 10.8
Time: 44.0s
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{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right)\right)}{\sin B} - \frac{x}{\tan B}\]
\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{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right)\right)}{\sin B} - \frac{x}{\tan B}
double f(double F, double B, double x) {
        double r1761823 = x;
        double r1761824 = 1.0;
        double r1761825 = B;
        double r1761826 = tan(r1761825);
        double r1761827 = r1761824 / r1761826;
        double r1761828 = r1761823 * r1761827;
        double r1761829 = -r1761828;
        double r1761830 = F;
        double r1761831 = sin(r1761825);
        double r1761832 = r1761830 / r1761831;
        double r1761833 = r1761830 * r1761830;
        double r1761834 = 2.0;
        double r1761835 = r1761833 + r1761834;
        double r1761836 = r1761834 * r1761823;
        double r1761837 = r1761835 + r1761836;
        double r1761838 = r1761824 / r1761834;
        double r1761839 = -r1761838;
        double r1761840 = pow(r1761837, r1761839);
        double r1761841 = r1761832 * r1761840;
        double r1761842 = r1761829 + r1761841;
        return r1761842;
}

double f(double F, double B, double x) {
        double r1761843 = 2.0;
        double r1761844 = x;
        double r1761845 = F;
        double r1761846 = fma(r1761845, r1761845, r1761843);
        double r1761847 = fma(r1761843, r1761844, r1761846);
        double r1761848 = -0.5;
        double r1761849 = pow(r1761847, r1761848);
        double r1761850 = r1761849 * r1761845;
        double r1761851 = expm1(r1761850);
        double r1761852 = log1p(r1761851);
        double r1761853 = B;
        double r1761854 = sin(r1761853);
        double r1761855 = r1761852 / r1761854;
        double r1761856 = tan(r1761853);
        double r1761857 = r1761844 / r1761856;
        double r1761858 = r1761855 - r1761857;
        return r1761858;
}

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

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

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

    \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right)\right)}}{\sin B} - \frac{x}{\tan B}\]
  7. Final simplification10.8

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

Reproduce

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