Average Error: 13.7 → 0.3
Time: 34.0s
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 -1.0694560946935955 \cdot 10^{+29}:\\ \;\;\;\;\left(-x\right) \cdot \frac{1}{\tan B} + \left(\frac{1}{{F}^{2} \cdot \sin B} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 190920.051250969:\\ \;\;\;\;(\left({\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot \left(\frac{1}{\sin B} \cdot F\right) + \left(\frac{-x}{\tan B}\right))_*\\ \mathbf{else}:\\ \;\;\;\;\left(-x\right) \cdot \frac{1}{\tan B} + \left(\frac{1}{\sin B} - \frac{1}{{F}^{2} \cdot \sin 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 < -1.0694560946935955e+29

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

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

    if -1.0694560946935955e+29 < F < 190920.051250969

    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. Initial simplification0.4

      \[\leadsto (\left({\left((2 \cdot x + \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 div-inv0.4

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

    if 190920.051250969 < 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 0.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.0694560946935955 \cdot 10^{+29}:\\ \;\;\;\;\left(-x\right) \cdot \frac{1}{\tan B} + \left(\frac{1}{{F}^{2} \cdot \sin B} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 190920.051250969:\\ \;\;\;\;(\left({\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot \left(\frac{1}{\sin B} \cdot F\right) + \left(\frac{-x}{\tan B}\right))_*\\ \mathbf{else}:\\ \;\;\;\;\left(-x\right) \cdot \frac{1}{\tan B} + \left(\frac{1}{\sin B} - \frac{1}{{F}^{2} \cdot \sin B}\right)\\ \end{array}\]

Runtime

Time bar (total: 34.0s)Debug logProfile

herbie shell --seed 2018219 +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))))))