Average Error: 16.2 → 1.5
Time: 10.2s
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 -1.33556314699121738 \cdot 10^{154}:\\ \;\;\;\;\frac{F \cdot 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}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 1.3354501055926701 \cdot 10^{154}:\\ \;\;\;\;\frac{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{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}}}}{\sin B} - \frac{x \cdot 1}{\tan 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 < -1.33556314699121738e154

    1. Initial program 41.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. Simplified41.3

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

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

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

      \[\leadsto \frac{\color{blue}{F \cdot 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}}}{\sin B} - \frac{x \cdot 1}{\tan B}\]

    if -1.33556314699121738e154 < F < 1.3354501055926701e154

    1. Initial program 2.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. Simplified2.9

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

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

      \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    7. Using strategy rm
    8. Applied pow-neg0.3

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

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

    if 1.3354501055926701e154 < F

    1. Initial program 39.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. Simplified39.8

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

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

      \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
    7. Using strategy rm
    8. Applied pow-neg33.8

      \[\leadsto \frac{F \cdot \color{blue}{\frac{1}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}}{\sin B} - \frac{x \cdot 1}{\tan B}\]
    9. Applied un-div-inv33.8

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

      \[\leadsto \frac{\frac{F}{\color{blue}{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}}}}}{\sin B} - \frac{x \cdot 1}{\tan B}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.33556314699121738 \cdot 10^{154}:\\ \;\;\;\;\frac{F \cdot 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}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 1.3354501055926701 \cdot 10^{154}:\\ \;\;\;\;\frac{\frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{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}}}}{\sin B} - \frac{x \cdot 1}{\tan B}\\ \end{array}\]

Reproduce

herbie shell --seed 2020156 
(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))))))