Average Error: 13.7 → 0.5
Time: 56.7s
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 -3.87112730016545 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{1}{F}}{\sin B \cdot F} - \left(\frac{1}{\sin B} + \frac{x}{\tan B}\right)\\ \mathbf{if}\;F \le 289118697.5268865:\\ \;\;\;\;(\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}{\sin B} \cdot \cos B\right))_*\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{x}{\tan B}\right) - \frac{\frac{1}{F}}{\sin B \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 < -3.87112730016545e+98

    1. Initial program 32.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. Taylor expanded around -inf 16.1

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

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

    if -3.87112730016545e+98 < F < 289118697.5268865

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

      \[\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 tan-quot0.9

      \[\leadsto (\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}{\color{blue}{\frac{\sin B}{\cos B}}}\right))_*\]
    5. Applied associate-/r/0.9

      \[\leadsto (\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) + \color{blue}{\left(\frac{-x}{\sin B} \cdot \cos B\right)})_*\]

    if 289118697.5268865 < F

    1. Initial program 25.1

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

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

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

Runtime

Time bar (total: 56.7s)Debug logProfile

herbie shell --seed '#(1072840222 1305617769 1692503039 1353360431 4178980589 1488672652)' +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))))))