Average Error: 13.5 → 0.3
Time: 42.3s
Precision: 64
\[\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 -2914735.28189227543771266937255859375:\\ \;\;\;\;\left(\frac{\frac{1}{\sin B}}{F \cdot F} + \frac{-1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 4.890764603747722816251553012989461421967:\\ \;\;\;\;F \cdot \left(\frac{{\left(\sqrt{\left(F \cdot F + x \cdot 2\right) + 2}\right)}^{\left(\frac{-1}{2}\right)}}{\sin B} \cdot {\left(\sqrt{\left(F \cdot F + x \cdot 2\right) + 2}\right)}^{\left(\frac{-1}{2}\right)}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(1 - \frac{1}{F \cdot F}\right) - \frac{x \cdot 1}{\tan B}\\ \end{array}\]
\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 -2914735.28189227543771266937255859375:\\
\;\;\;\;\left(\frac{\frac{1}{\sin B}}{F \cdot F} + \frac{-1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\

\mathbf{elif}\;F \le 4.890764603747722816251553012989461421967:\\
\;\;\;\;F \cdot \left(\frac{{\left(\sqrt{\left(F \cdot F + x \cdot 2\right) + 2}\right)}^{\left(\frac{-1}{2}\right)}}{\sin B} \cdot {\left(\sqrt{\left(F \cdot F + x \cdot 2\right) + 2}\right)}^{\left(\frac{-1}{2}\right)}\right) - \frac{x \cdot 1}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left(1 - \frac{1}{F \cdot F}\right) - \frac{x \cdot 1}{\tan B}\\

\end{array}
double f(double F, double B, double x) {
        double r2202799 = x;
        double r2202800 = 1.0;
        double r2202801 = B;
        double r2202802 = tan(r2202801);
        double r2202803 = r2202800 / r2202802;
        double r2202804 = r2202799 * r2202803;
        double r2202805 = -r2202804;
        double r2202806 = F;
        double r2202807 = sin(r2202801);
        double r2202808 = r2202806 / r2202807;
        double r2202809 = r2202806 * r2202806;
        double r2202810 = 2.0;
        double r2202811 = r2202809 + r2202810;
        double r2202812 = r2202810 * r2202799;
        double r2202813 = r2202811 + r2202812;
        double r2202814 = r2202800 / r2202810;
        double r2202815 = -r2202814;
        double r2202816 = pow(r2202813, r2202815);
        double r2202817 = r2202808 * r2202816;
        double r2202818 = r2202805 + r2202817;
        return r2202818;
}

double f(double F, double B, double x) {
        double r2202819 = F;
        double r2202820 = -2914735.2818922754;
        bool r2202821 = r2202819 <= r2202820;
        double r2202822 = 1.0;
        double r2202823 = B;
        double r2202824 = sin(r2202823);
        double r2202825 = r2202822 / r2202824;
        double r2202826 = r2202819 * r2202819;
        double r2202827 = r2202825 / r2202826;
        double r2202828 = -1.0;
        double r2202829 = r2202828 / r2202824;
        double r2202830 = r2202827 + r2202829;
        double r2202831 = x;
        double r2202832 = r2202831 * r2202822;
        double r2202833 = tan(r2202823);
        double r2202834 = r2202832 / r2202833;
        double r2202835 = r2202830 - r2202834;
        double r2202836 = 4.890764603747723;
        bool r2202837 = r2202819 <= r2202836;
        double r2202838 = 2.0;
        double r2202839 = r2202831 * r2202838;
        double r2202840 = r2202826 + r2202839;
        double r2202841 = r2202840 + r2202838;
        double r2202842 = sqrt(r2202841);
        double r2202843 = -r2202822;
        double r2202844 = r2202843 / r2202838;
        double r2202845 = pow(r2202842, r2202844);
        double r2202846 = r2202845 / r2202824;
        double r2202847 = r2202846 * r2202845;
        double r2202848 = r2202819 * r2202847;
        double r2202849 = r2202848 - r2202834;
        double r2202850 = 1.0;
        double r2202851 = r2202850 / r2202824;
        double r2202852 = r2202822 / r2202826;
        double r2202853 = r2202850 - r2202852;
        double r2202854 = r2202851 * r2202853;
        double r2202855 = r2202854 - r2202834;
        double r2202856 = r2202837 ? r2202849 : r2202855;
        double r2202857 = r2202821 ? r2202835 : r2202856;
        return r2202857;
}

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 < -2914735.2818922754

    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. Simplified24.9

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

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

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

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

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

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

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

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

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

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

    if -2914735.2818922754 < F < 4.890764603747723

    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. Simplified0.4

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{{\left(2 + \left(x \cdot 2 + F \cdot F\right)\right)}^{\left(\frac{-1}{2}\right)}}{\sin B}} \cdot F - \frac{1 \cdot x}{\tan B}\]
    15. Using strategy rm
    16. Applied *-un-lft-identity0.3

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

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

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

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

    if 4.890764603747723 < F

    1. Initial program 23.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. Simplified22.6

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

      \[\leadsto \frac{{\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}}{\color{blue}{\sin B \cdot \frac{1}{F}}} - \frac{1}{\tan B} \cdot x\]
    5. Applied *-un-lft-identity22.6

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019172 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))