Average Error: 13.7 → 12.2
Time: 48.0s
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 -4.295685700974097 \cdot 10^{+170} \lor \neg \left(F \le 5.214059881354716 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;(\left({\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{-1}\right) \cdot \left(\frac{\frac{1}{\sin B}}{\frac{1}{F}}\right) + \left(\frac{-x}{\tan B}\right))_*\\ \end{array}\]

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if F < -4.295685700974097e+170 or 5.214059881354716e+155 < F

    1. Initial program 41.0

      \[\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 simplification41.0

      \[\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-sqrt41.0

      \[\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-down41.0

      \[\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 35.7

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

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

    if -4.295685700974097e+170 < F < 5.214059881354716e+155

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

      \[\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-sqrt3.1

      \[\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-down3.1

      \[\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. Using strategy rm
    7. Applied pow-prod-up3.1

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

      \[\leadsto (\left({\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{\color{blue}{-1}}\right) \cdot \left(\frac{F}{\sin B}\right) + \left(\frac{-x}{\tan B}\right))_*\]
    9. Using strategy rm
    10. Applied clear-num3.1

      \[\leadsto (\left({\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{-1}\right) \cdot \color{blue}{\left(\frac{1}{\frac{\sin B}{F}}\right)} + \left(\frac{-x}{\tan B}\right))_*\]
    11. Using strategy rm
    12. Applied div-inv3.1

      \[\leadsto (\left({\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{-1}\right) \cdot \left(\frac{1}{\color{blue}{\sin B \cdot \frac{1}{F}}}\right) + \left(\frac{-x}{\tan B}\right))_*\]
    13. Applied associate-/r*3.1

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

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

Runtime

Time bar (total: 48.0s)Debug logProfile

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