Average Error: 13.4 → 0.3
Time: 2.4m
Precision: 64
Internal Precision: 128
\[\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.5668677365888951 \cdot 10^{+53}:\\ \;\;\;\;\frac{1}{-\left(\sin B + \frac{\sin B}{F \cdot F} \cdot x\right)} - \frac{\cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \le 94750263.48374341:\\ \;\;\;\;\frac{1}{\frac{\sin B}{F \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{\frac{-1}{2}}}} - \frac{\cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B + \frac{\sin B}{F \cdot F} \cdot x} - \frac{\cos B \cdot x}{\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 < -1.5668677365888951e+53

    1. Initial program 28.3

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

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

      \[\leadsto \frac{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \color{blue}{\frac{x \cdot \cos B}{\sin B}}\]
    4. Using strategy rm
    5. Applied clear-num22.3

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

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

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

    if -1.5668677365888951e+53 < F < 94750263.48374341

    1. Initial program 0.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. Simplified0.3

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

      \[\leadsto \frac{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \color{blue}{\frac{x \cdot \cos B}{\sin B}}\]
    4. Using strategy rm
    5. Applied clear-num0.3

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

    if 94750263.48374341 < F

    1. Initial program 24.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. Simplified19.7

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

      \[\leadsto \frac{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \color{blue}{\frac{x \cdot \cos B}{\sin B}}\]
    4. Using strategy rm
    5. Applied clear-num19.7

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

      \[\leadsto \frac{1}{\color{blue}{\frac{x \cdot \sin B}{{F}^{2}} + \sin B}} - \frac{x \cdot \cos B}{\sin B}\]
    7. Simplified0.2

      \[\leadsto \frac{1}{\color{blue}{x \cdot \frac{\sin B}{F \cdot F} + \sin B}} - \frac{x \cdot \cos B}{\sin B}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.5668677365888951 \cdot 10^{+53}:\\ \;\;\;\;\frac{1}{-\left(\sin B + \frac{\sin B}{F \cdot F} \cdot x\right)} - \frac{\cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \le 94750263.48374341:\\ \;\;\;\;\frac{1}{\frac{\sin B}{F \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{\frac{-1}{2}}}} - \frac{\cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B + \frac{\sin B}{F \cdot F} \cdot x} - \frac{\cos B \cdot x}{\sin B}\\ \end{array}\]

Reproduce

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