Average Error: 13.9 → 11.0
Time: 36.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{\mathsf{log1p}\left(\mathsf{expm1}\left(F \cdot \left({\left(\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\frac{-1}{2}} \cdot {\left(\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\frac{-1}{2}}\right)\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(F \cdot \left({\left(\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\frac{-1}{2}} \cdot {\left(\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\frac{-1}{2}}\right)\right)\right)}{\sin B} - \frac{x}{\tan B}
double f(double F, double B, double x) {
        double r713002 = x;
        double r713003 = 1.0;
        double r713004 = B;
        double r713005 = tan(r713004);
        double r713006 = r713003 / r713005;
        double r713007 = r713002 * r713006;
        double r713008 = -r713007;
        double r713009 = F;
        double r713010 = sin(r713004);
        double r713011 = r713009 / r713010;
        double r713012 = r713009 * r713009;
        double r713013 = 2.0;
        double r713014 = r713012 + r713013;
        double r713015 = r713013 * r713002;
        double r713016 = r713014 + r713015;
        double r713017 = r713003 / r713013;
        double r713018 = -r713017;
        double r713019 = pow(r713016, r713018);
        double r713020 = r713011 * r713019;
        double r713021 = r713008 + r713020;
        return r713021;
}

double f(double F, double B, double x) {
        double r713022 = F;
        double r713023 = x;
        double r713024 = 2.0;
        double r713025 = fma(r713022, r713022, r713024);
        double r713026 = fma(r713023, r713024, r713025);
        double r713027 = sqrt(r713026);
        double r713028 = -0.5;
        double r713029 = pow(r713027, r713028);
        double r713030 = r713029 * r713029;
        double r713031 = r713022 * r713030;
        double r713032 = expm1(r713031);
        double r713033 = log1p(r713032);
        double r713034 = B;
        double r713035 = sin(r713034);
        double r713036 = r713033 / r713035;
        double r713037 = tan(r713034);
        double r713038 = r713023 / r713037;
        double r713039 = r713036 - r713038;
        return r713039;
}

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

    \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(x, 2, \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.9

    \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \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.9

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

    \[\leadsto \frac{\mathsf{log1p}\left(\mathsf{expm1}\left({\color{blue}{\left(\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}}^{\frac{-1}{2}} \cdot F\right)\right)}{\sin B} - \frac{x}{\tan B}\]
  9. Applied unpow-prod-down11.0

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

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

Reproduce

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