Average Error: 13.1 → 5.6
Time: 2.1m
Precision: 64
Internal Precision: 128
\[\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)}\]
\[\begin{array}{l} \mathbf{if}\;F \le -1.0319830905640836 \cdot 10^{+144}:\\ \;\;\;\;\frac{1}{\sin B} \cdot (e^{\left(\sqrt{\frac{1}{2}} - (x \cdot \left(\sqrt{\frac{1}{8}}\right) + \left(\frac{1}{4} \cdot F\right))_*\right) \cdot F} - 1)^* - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} \cdot {\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot F - \frac{x}{\tan B}\\ \end{array}\]

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if F < -1.0319830905640836e+144

    1. Initial program 39.3

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

      \[\leadsto \color{blue}{\frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \frac{x}{\tan B}}\]
    3. Using strategy rm
    4. Applied div-inv38.4

      \[\leadsto \frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B \cdot \frac{1}{F}}} - \frac{x}{\tan B}\]
    5. Applied *-un-lft-identity38.4

      \[\leadsto \frac{{\color{blue}{\left(1 \cdot (2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}}^{\frac{-1}{2}}}{\sin B \cdot \frac{1}{F}} - \frac{x}{\tan B}\]
    6. Applied unpow-prod-down38.4

      \[\leadsto \frac{\color{blue}{{1}^{\frac{-1}{2}} \cdot {\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}}{\sin B \cdot \frac{1}{F}} - \frac{x}{\tan B}\]
    7. Applied times-frac34.1

      \[\leadsto \color{blue}{\frac{{1}^{\frac{-1}{2}}}{\sin B} \cdot \frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\frac{1}{F}}} - \frac{x}{\tan B}\]
    8. Simplified34.1

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \cdot \frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\frac{1}{F}} - \frac{x}{\tan B}\]
    9. Simplified34.1

      \[\leadsto \frac{1}{\sin B} \cdot \color{blue}{\left({\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}} \cdot F\right)} - \frac{x}{\tan B}\]
    10. Using strategy rm
    11. Applied expm1-log1p-u34.3

      \[\leadsto \frac{1}{\sin B} \cdot \color{blue}{(e^{\log_* (1 + {\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}} \cdot F)} - 1)^*} - \frac{x}{\tan B}\]
    12. Taylor expanded around 0 9.8

      \[\leadsto \frac{1}{\sin B} \cdot (e^{\color{blue}{F \cdot \sqrt{\frac{1}{2}} - \left(x \cdot \left(F \cdot \sqrt{\frac{1}{8}}\right) + \frac{1}{2} \cdot \left({F}^{2} \cdot {\left(\sqrt{\frac{1}{2}}\right)}^{2}\right)\right)}} - 1)^* - \frac{x}{\tan B}\]
    13. Simplified3.2

      \[\leadsto \frac{1}{\sin B} \cdot (e^{\color{blue}{F \cdot \left(\sqrt{\frac{1}{2}} - (x \cdot \left(\sqrt{\frac{1}{8}}\right) + \left(\frac{1}{4} \cdot F\right))_*\right)}} - 1)^* - \frac{x}{\tan B}\]

    if -1.0319830905640836e+144 < F

    1. Initial program 8.6

      \[\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. Simplified8.1

      \[\leadsto \color{blue}{\frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \frac{x}{\tan B}}\]
    3. Using strategy rm
    4. Applied div-inv8.1

      \[\leadsto \frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B \cdot \frac{1}{F}}} - \frac{x}{\tan B}\]
    5. Applied *-un-lft-identity8.1

      \[\leadsto \frac{{\color{blue}{\left(1 \cdot (2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}}^{\frac{-1}{2}}}{\sin B \cdot \frac{1}{F}} - \frac{x}{\tan B}\]
    6. Applied unpow-prod-down8.1

      \[\leadsto \frac{\color{blue}{{1}^{\frac{-1}{2}} \cdot {\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}}{\sin B \cdot \frac{1}{F}} - \frac{x}{\tan B}\]
    7. Applied times-frac6.0

      \[\leadsto \color{blue}{\frac{{1}^{\frac{-1}{2}}}{\sin B} \cdot \frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\frac{1}{F}}} - \frac{x}{\tan B}\]
    8. Simplified6.0

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \cdot \frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\frac{1}{F}} - \frac{x}{\tan B}\]
    9. Simplified6.0

      \[\leadsto \frac{1}{\sin B} \cdot \color{blue}{\left({\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}} \cdot F\right)} - \frac{x}{\tan B}\]
    10. Using strategy rm
    11. Applied associate-*r*6.0

      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot {\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot F} - \frac{x}{\tan B}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification5.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.0319830905640836 \cdot 10^{+144}:\\ \;\;\;\;\frac{1}{\sin B} \cdot (e^{\left(\sqrt{\frac{1}{2}} - (x \cdot \left(\sqrt{\frac{1}{8}}\right) + \left(\frac{1}{4} \cdot F\right))_*\right) \cdot F} - 1)^* - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} \cdot {\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot F - \frac{x}{\tan B}\\ \end{array}\]

Reproduce

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