Average Error: 13.2 → 0.3
Time: 1.2m
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 -2925908745.1460295:\\ \;\;\;\;\frac{\frac{1}{F}}{\sin B \cdot F} - \left(\frac{1}{\sin B} + \frac{x}{\tan B}\right)\\ \mathbf{if}\;F \le 85621353.03007704:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{{\left((x \cdot 2 + \left((F \cdot F + 2)_*\right))_*\right)}^{\left(\frac{1}{2}\right)} \cdot \sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{x}{\tan B}\right) - \frac{\frac{1}{F}}{\sin B \cdot F}\\ \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 < -2925908745.1460295

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

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

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

    if -2925908745.1460295 < F < 85621353.03007704

    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. Using strategy rm
    3. Applied pow-neg0.4

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

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

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

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

    if 85621353.03007704 < F

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

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

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

Runtime

Time bar (total: 1.2m)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' +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))))))