Average Error: 14.2 → 1.4
Time: 9.6s
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 -6.2014271651733198 \cdot 10^{155}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(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)}\right)} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \le 1.9896310056246522 \cdot 10^{151}:\\ \;\;\;\;\frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{e^{-0.5 \cdot \left(\log 1 - 2 \cdot \log \left(\frac{1}{F}\right)\right)} \cdot F}{\sin B} - 1 \cdot \frac{e^{-0.5 \cdot \left(\log 1 - 2 \cdot \log \left(\frac{1}{F}\right)\right)}}{\sin B \cdot F}\right) - x \cdot \frac{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 < -6.2014271651733198e155

    1. Initial program 41.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. Simplified41.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 pow-neg41.9

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

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified36.2

      \[\leadsto \frac{\color{blue}{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}\]
    7. Taylor expanded around -inf 4.0

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

    if -6.2014271651733198e155 < F < 1.9896310056246522e151

    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. Simplified2.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 pow-neg2.8

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

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified0.4

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/0.4

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

    if 1.9896310056246522e151 < F

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

      \[\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. Taylor expanded around inf 3.9

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

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

Reproduce

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