Average Error: 13.6 → 1.3
Time: 12.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.34634488319337696 \cdot 10^{154}:\\ \;\;\;\;F \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 + \log \left(\frac{-1}{F}\right) \cdot -2\right)} - 1 \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 + \log \left(\frac{-1}{F}\right) \cdot -2\right)}}{F \cdot F}}{\sin B} - \frac{1 \cdot x}{\tan B}\\ \mathbf{elif}\;F \le 3.95112858735259396 \cdot 10^{150}:\\ \;\;\;\;\frac{F}{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\left(\frac{1}{2}\right)}} \cdot \frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 + 2 \cdot \log F\right)} - 1 \cdot \frac{{\left(e^{-0.5}\right)}^{\left(\log 1 + 2 \cdot \log F\right)}}{F \cdot F}}{\sin B} - \frac{1 \cdot x}{\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.34634488319337696e154

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

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

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

      \[\leadsto F \cdot \frac{\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}\]
    6. Simplified3.7

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

    if -1.34634488319337696e154 < F < 3.95112858735259396e150

    1. Initial program 2.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. Simplified0.4

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\left(\frac{1}{2}\right)}}}}{\sin B} - x \cdot \frac{1}{\tan B}\]
    6. Applied associate-/l/0.4

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

      \[\leadsto F \cdot \frac{1}{\color{blue}{{\left(F \cdot F + \left(2 + 2 \cdot x\right)\right)}^{\left(\frac{1}{2}\right)} \cdot \sin B}} - x \cdot \frac{1}{\tan B}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity0.4

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

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

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

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

    if 3.95112858735259396e150 < 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.8

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

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

      \[\leadsto F \cdot \frac{\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}\]
    6. Simplified4.0

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

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

Reproduce

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