Average Error: 14.1 → 0.2
Time: 54.1s
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 -18438164.265172437:\\ \;\;\;\;\frac{\frac{1}{F \cdot F}}{\sin B} - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)\\ \mathbf{if}\;F \le 24796.391831495683:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\left(\frac{1}{2}\right)}} + \frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{x}{\tan B}\right) - \frac{\frac{\frac{1}{F}}{F}}{\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 < -18438164.265172437

    1. Initial program 25.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. Applied simplify25.7

      \[\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 pow-neg25.7

      \[\leadsto (\color{blue}{\left(\frac{1}{{\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))_*\]
    5. Using strategy rm
    6. Applied fma-udef25.7

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

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

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

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

    if -18438164.265172437 < F < 24796.391831495683

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

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

      \[\leadsto (\color{blue}{\left(\frac{1}{{\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))_*\]
    5. Using strategy rm
    6. Applied fma-udef0.3

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

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

    if 24796.391831495683 < F

    1. Initial program 25.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. Applied simplify24.9

      \[\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 pow-neg24.9

      \[\leadsto (\color{blue}{\left(\frac{1}{{\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))_*\]
    5. Using strategy rm
    6. Applied fma-udef24.9

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

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

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

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

Runtime

Time bar (total: 54.1s)Debug logProfile

herbie shell --seed '#(1071852389 864846987 1238109217 3425890003 4124793586 650694553)' +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))))))