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

    1. Initial program 41.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. Simplified36.4

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

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

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

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

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

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

      \[\leadsto x \cdot \frac{-1}{\tan B} + \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}\]
    11. Taylor expanded around -inf 3.9

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

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

    if -1.3553598376870535e154 < F < 1.96833105963148191e142

    1. Initial program 2.2

      \[\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}{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 div-inv0.4

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

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

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

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

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

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

    if 1.96833105963148191e142 < F

    1. Initial program 40.0

      \[\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. Simplified34.5

      \[\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 div-inv34.5

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

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

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

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

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

      \[\leadsto x \cdot \frac{-1}{\tan B} + \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}\]
    11. Taylor expanded around inf 3.9

      \[\leadsto x \cdot \frac{-1}{\tan B} + \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}}}} \cdot \frac{1}{\sin B}\]
    12. Simplified4.2

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

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

Reproduce

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