Average Error: 13.8 → 0.4
Time: 37.6s
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.712640818345483 \cdot 10^{+37}:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 2.8386726278963144 \cdot 10^{-05}:\\ \;\;\;\;\left({\left(\sqrt{2 \cdot x + \left(2 + F \cdot F\right)}\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B}\right) \cdot {\left(\sqrt{\sqrt{2 \cdot x + \left(2 + F \cdot F\right)}} \cdot \sqrt{\sqrt{2 \cdot x + \left(2 + F \cdot F\right)}}\right)}^{\frac{-1}{2}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\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 < -4.712640818345483e+37

    1. Initial program 27.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. Simplified27.0

      \[\leadsto \color{blue}{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}}\]
    3. 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}\]

    if -4.712640818345483e+37 < F < 2.8386726278963144e-05

    1. Initial program 0.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. Simplified0.4

      \[\leadsto \color{blue}{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt0.4

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\left(2 + F \cdot F\right) + 2 \cdot x}\right)}^{\frac{-1}{2}} \cdot \left({\left(\sqrt{\left(2 + F \cdot F\right) + 2 \cdot x}\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B}\right)} - \frac{x}{\tan B}\]
    7. Using strategy rm
    8. Applied add-sqr-sqrt0.5

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

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

    if 2.8386726278963144e-05 < F

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

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

      \[\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.4

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

Reproduce

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