Average Error: 13.7 → 0.2
Time: 38.1s
Precision: 64
Internal Precision: 320
\[\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.3523016690045893 \cdot 10^{+19}:\\ \;\;\;\;\frac{\frac{1}{{F}^{2}} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 307.29004633516365:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{{\left(x \cdot 2 + \left(2 + F \cdot F\right)\right)}^{\left(\frac{1}{2}\right)}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \frac{1}{{F}^{2}}}{\sin B} - \frac{x}{\tan B}\\ \end{array}\]

Error

Bits error versus F

Bits error versus B

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if F < -1.3523016690045893e+19

    1. Initial program 25.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 simplification25.4

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\]
    3. Using strategy rm
    4. Applied associate-*r/19.9

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

      \[\leadsto \frac{\color{blue}{\frac{1}{{F}^{2}} - 1}}{\sin B} - \frac{x}{\tan B}\]

    if -1.3523016690045893e+19 < F < 307.29004633516365

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

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\]
    3. Using strategy rm
    4. Applied associate-*r/0.3

      \[\leadsto \color{blue}{\frac{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B}} - \frac{x}{\tan B}\]
    5. Using strategy rm
    6. Applied pow-neg0.3

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

      \[\leadsto \frac{\color{blue}{\frac{1 \cdot F}{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}}}{\sin B} - \frac{x}{\tan B}\]
    8. Applied associate-/l/0.3

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

      \[\leadsto \frac{\color{blue}{F}}{\sin B \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x}{\tan B}\]
    10. Using strategy rm
    11. Applied associate-/r*0.3

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

    if 307.29004633516365 < F

    1. Initial program 25.3

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

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\]
    3. Using strategy rm
    4. Applied associate-*r/19.8

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

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

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

Runtime

Time bar (total: 38.1s)Debug logProfile

herbie shell --seed 2018225 
(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))))))