Average Error: 13.4 → 11.9
Time: 50.3s
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}\;\frac{-1}{\tan B} \cdot x + {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} \le 1.6431865757466258 \cdot 10^{+286}:\\ \;\;\;\;(\left({\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot \left(\frac{1}{\sin B} \cdot F\right) + \left(\frac{-x}{\tan B}\right))_*\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \end{array}\]

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))) < 1.6431865757466258e+286

    1. Initial program 8.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. Initial simplification8.2

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

      \[\leadsto (\left({\left((2 \cdot x + \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))_*\]

    if 1.6431865757466258e+286 < (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2)))))

    1. Initial program 54.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. Initial simplification54.9

      \[\leadsto (\left({\left((2 \cdot x + \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 add-sqr-sqrt54.9

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
    7. Simplified41.6

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification11.9

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

Runtime

Time bar (total: 50.3s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes13.411.911.22.169.4%
herbie shell --seed 2018355 +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))))))