Average Error: 13.7 → 1.5
Time: 15.3s
Precision: binary64
\[\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 -2.84628236833302262 \cdot 10^{159}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \left({\left(e^{-0.5}\right)}^{\left(\log 1 - 2 \cdot \log \left(\frac{-1}{F}\right)\right)} - 1 \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 - 2 \cdot \log \left(\frac{-1}{F}\right)\right)}}{F \cdot F}\right)}{\sin B}\\ \mathbf{elif}\;F \le 1.3316745337714515 \cdot 10^{154}:\\ \;\;\;\;\frac{x \cdot \left(-1\right)}{\tan B} + F \cdot \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\left(\frac{-1}{2}\right)}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \left({\left(e^{-0.5}\right)}^{\left(\log 1 - \log F \cdot -2\right)} - 1 \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 - \log F \cdot -2\right)}}{F \cdot F}\right)}{\sin B}\\ \end{array}\]

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if F < -2.84628236833302262e159

    1. Initial program 39.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. Simplified35.3

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

      \[\leadsto x \cdot \frac{-1}{\tan B} + \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\left(\frac{-1}{2}\right)}}{\sin B}}\]
    5. Simplified35.3

      \[\leadsto x \cdot \frac{-1}{\tan B} + \frac{\color{blue}{F \cdot {\left(F \cdot F + \left(2 + 2 \cdot x\right)\right)}^{\left(\frac{-1}{2}\right)}}}{\sin B}\]
    6. Taylor expanded around -inf 3.8

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

      \[\leadsto x \cdot \frac{-1}{\tan B} + \frac{F \cdot \color{blue}{\left({\left(e^{-0.5}\right)}^{\left(\log 1 - 2 \cdot \log \left(\frac{-1}{F}\right)\right)} - 1 \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 - 2 \cdot \log \left(\frac{-1}{F}\right)\right)}}{F \cdot F}\right)}}{\sin B}\]

    if -2.84628236833302262e159 < F < 1.3316745337714515e154

    1. Initial program 2.8

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

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

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

    if 1.3316745337714515e154 < F

    1. Initial program 41.8

      \[\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. Simplified36.6

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

      \[\leadsto x \cdot \frac{-1}{\tan B} + \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\left(\frac{-1}{2}\right)}}{\sin B}}\]
    5. Simplified36.6

      \[\leadsto x \cdot \frac{-1}{\tan B} + \frac{\color{blue}{F \cdot {\left(F \cdot F + \left(2 + 2 \cdot x\right)\right)}^{\left(\frac{-1}{2}\right)}}}{\sin B}\]
    6. Taylor expanded around inf 4.0

      \[\leadsto x \cdot \frac{-1}{\tan B} + \frac{F \cdot \color{blue}{\left(e^{-0.5 \cdot \left(\log 1 - 2 \cdot \log \left(\frac{1}{F}\right)\right)} - 1 \cdot \frac{e^{-0.5 \cdot \left(\log 1 - 2 \cdot \log \left(\frac{1}{F}\right)\right)}}{{F}^{2}}\right)}}{\sin B}\]
    7. Simplified4.0

      \[\leadsto x \cdot \frac{-1}{\tan B} + \frac{F \cdot \color{blue}{\left({\left(e^{-0.5}\right)}^{\left(\log 1 - \log F \cdot -2\right)} - 1 \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 - \log F \cdot -2\right)}}{F \cdot F}\right)}}{\sin B}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -2.84628236833302262 \cdot 10^{159}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \left({\left(e^{-0.5}\right)}^{\left(\log 1 - 2 \cdot \log \left(\frac{-1}{F}\right)\right)} - 1 \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 - 2 \cdot \log \left(\frac{-1}{F}\right)\right)}}{F \cdot F}\right)}{\sin B}\\ \mathbf{elif}\;F \le 1.3316745337714515 \cdot 10^{154}:\\ \;\;\;\;\frac{x \cdot \left(-1\right)}{\tan B} + F \cdot \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\left(\frac{-1}{2}\right)}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \left({\left(e^{-0.5}\right)}^{\left(\log 1 - \log F \cdot -2\right)} - 1 \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 - \log F \cdot -2\right)}}{F \cdot F}\right)}{\sin B}\\ \end{array}\]

Reproduce

herbie shell --seed 2020179 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  :precision binary64
  (+ (neg (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (neg (/ 1.0 2.0))))))