Average Error: 13.9 → 0.3
Time: 10.4s
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 -5.7648000314577582 \cdot 10^{21}:\\ \;\;\;\;\left(\frac{\frac{1}{\sin B}}{{F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 21.3414842217350404:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - 1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(1 - \frac{\frac{1}{F}}{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 -5.7648000314577582 \cdot 10^{21}:\\
\;\;\;\;\left(\frac{\frac{1}{\sin B}}{{F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r37947 = x;
        double r37948 = 1.0;
        double r37949 = B;
        double r37950 = tan(r37949);
        double r37951 = r37948 / r37950;
        double r37952 = r37947 * r37951;
        double r37953 = -r37952;
        double r37954 = F;
        double r37955 = sin(r37949);
        double r37956 = r37954 / r37955;
        double r37957 = r37954 * r37954;
        double r37958 = 2.0;
        double r37959 = r37957 + r37958;
        double r37960 = r37958 * r37947;
        double r37961 = r37959 + r37960;
        double r37962 = r37948 / r37958;
        double r37963 = -r37962;
        double r37964 = pow(r37961, r37963);
        double r37965 = r37956 * r37964;
        double r37966 = r37953 + r37965;
        return r37966;
}

double f(double F, double B, double x) {
        double r37967 = F;
        double r37968 = -5.764800031457758e+21;
        bool r37969 = r37967 <= r37968;
        double r37970 = 1.0;
        double r37971 = B;
        double r37972 = sin(r37971);
        double r37973 = r37970 / r37972;
        double r37974 = 2.0;
        double r37975 = pow(r37967, r37974);
        double r37976 = r37973 / r37975;
        double r37977 = 1.0;
        double r37978 = r37977 / r37972;
        double r37979 = r37976 - r37978;
        double r37980 = x;
        double r37981 = r37980 * r37970;
        double r37982 = tan(r37971);
        double r37983 = r37981 / r37982;
        double r37984 = r37979 - r37983;
        double r37985 = 21.34148422173504;
        bool r37986 = r37967 <= r37985;
        double r37987 = r37967 / r37972;
        double r37988 = r37967 * r37967;
        double r37989 = 2.0;
        double r37990 = r37988 + r37989;
        double r37991 = r37989 * r37980;
        double r37992 = r37990 + r37991;
        double r37993 = r37970 / r37989;
        double r37994 = -r37993;
        double r37995 = pow(r37992, r37994);
        double r37996 = r37987 * r37995;
        double r37997 = cos(r37971);
        double r37998 = r37980 * r37997;
        double r37999 = r37998 / r37972;
        double r38000 = r37970 * r37999;
        double r38001 = r37996 - r38000;
        double r38002 = r37970 / r37967;
        double r38003 = r38002 / r37967;
        double r38004 = r37977 - r38003;
        double r38005 = r37978 * r38004;
        double r38006 = r38005 - r37983;
        double r38007 = r37986 ? r38001 : r38006;
        double r38008 = r37969 ? r37984 : r38007;
        return r38008;
}

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 < -5.764800031457758e+21

    1. Initial program 26.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. Simplified26.4

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

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times20.8

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified20.8

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

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

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

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

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

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

    if -5.764800031457758e+21 < F < 21.34148422173504

    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{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}}\]
    3. Taylor expanded around inf 0.4

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

    if 21.34148422173504 < F

    1. Initial program 24.6

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

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

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    5. Applied frac-times18.8

      \[\leadsto \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)}}} - x \cdot \frac{1}{\tan B}\]
    6. Simplified18.8

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020062 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  :precision binary64
  (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))