Average Error: 13.0 → 0.3
Time: 1.1m
Precision: 64
Internal Precision: 384
\[\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.56400172751461 \cdot 10^{+58}:\\ \;\;\;\;\frac{\frac{1}{F \cdot F}}{\sin B} - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)\\ \mathbf{if}\;F \le 9621253.21431441:\\ \;\;\;\;\frac{{\left(\sqrt{(F \cdot F + \left((2 \cdot x + 2)_*\right))_*}\right)}^{\frac{-1}{2}} \cdot {\left(\sqrt{(F \cdot F + \left((2 \cdot x + 2)_*\right))_*}\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{1}{\sin B}\right) \cdot \left(\frac{-1}{F \cdot F}\right) + \left(\frac{1}{\sin B} - \frac{x}{\tan B}\right))_*\\ \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.56400172751461e+58

    1. Initial program 29.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. Applied simplify29.0

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

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

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

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

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

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

    if -6.56400172751461e+58 < F < 9621253.21431441

    1. Initial program 0.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. Applied simplify0.4

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

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

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

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

      \[\leadsto \frac{{\color{blue}{\left(\sqrt{(F \cdot F + \left((2 \cdot x + 2)_*\right))_*} \cdot \sqrt{(F \cdot F + \left((2 \cdot x + 2)_*\right))_*}\right)}}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \frac{-x}{\tan B}\]
    10. Applied unpow-prod-down0.4

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

    if 9621253.21431441 < F

    1. Initial program 23.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. Applied simplify23.2

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{F} - \frac{1}{{F}^{3}}}}{\frac{\sin B}{F}} + \frac{-x}{\tan B}\]
    9. Applied simplify0.1

      \[\leadsto \color{blue}{(\left(\frac{1}{\sin B}\right) \cdot \left(\frac{-1}{F \cdot F}\right) + \left(\frac{1}{\sin B} - \frac{x}{\tan B}\right))_*}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed '#(1070991898 1055468627 4280279443 640792587 928206309 3646738750)' +o rules:numerics
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))