Average Error: 13.5 → 0.6
Time: 58.2s
Precision: 64
Internal Precision: 576
\[\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 -303358286894.1393:\\ \;\;\;\;\frac{\frac{1}{F \cdot F}}{\sin B} - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)\\ \mathbf{if}\;F \le 2.8577112986072757 \cdot 10^{-11}:\\ \;\;\;\;{\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B} + \frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{x}{\tan B}\right) - \frac{\frac{\frac{1}{F}}{F}}{\sin 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 < -303358286894.1393

    1. Initial program 24.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. Applied simplify24.5

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

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

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

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

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

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

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

    if -303358286894.1393 < F < 2.8577112986072757e-11

    1. Initial program 0.4

      \[\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.3

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

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

    if 2.8577112986072757e-11 < 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.1

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

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

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

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

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

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

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

Runtime

Time bar (total: 58.2s)Debug logProfile

herbie shell --seed '#(1072330854 3074818769 591214268 3603999196 3863745332 3332387116)' +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))))))