Average Error: 13.4 → 0.5
Time: 41.0s
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 -2.3938499389991703 \cdot 10^{+160}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(\frac{F}{-1} - \frac{1}{F}\right)} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 10.23239862308582:\\ \;\;\;\;\frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{{F}^{2} \cdot \sin B}\right) - \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 < -2.3938499389991703e+160

    1. Initial program 42.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 simplification42.0

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

      \[\leadsto \color{blue}{\frac{1}{{\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}\]
    5. Applied frac-times36.7

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

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

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

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

    if -2.3938499389991703e+160 < F < 10.23239862308582

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

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

      \[\leadsto \color{blue}{\frac{1}{{\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}\]
    5. Applied frac-times0.6

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

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

    if 10.23239862308582 < F

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

      \[\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. 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}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.5

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

Runtime

Time bar (total: 41.0s)Debug logProfile

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