Average Error: 13.7 → 0.2
Time: 1.5m
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 -2.249440393592266 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 1239.8194008180278:\\ \;\;\;\;\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{1}{F} - \frac{\frac{1}{F}}{F \cdot F}\right) \cdot F}{\sin B} - \frac{x}{\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 -2.249440393592266 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r5265220 = x;
        double r5265221 = 1.0;
        double r5265222 = B;
        double r5265223 = tan(r5265222);
        double r5265224 = r5265221 / r5265223;
        double r5265225 = r5265220 * r5265224;
        double r5265226 = -r5265225;
        double r5265227 = F;
        double r5265228 = sin(r5265222);
        double r5265229 = r5265227 / r5265228;
        double r5265230 = r5265227 * r5265227;
        double r5265231 = 2.0;
        double r5265232 = r5265230 + r5265231;
        double r5265233 = r5265231 * r5265220;
        double r5265234 = r5265232 + r5265233;
        double r5265235 = r5265221 / r5265231;
        double r5265236 = -r5265235;
        double r5265237 = pow(r5265234, r5265236);
        double r5265238 = r5265229 * r5265237;
        double r5265239 = r5265226 + r5265238;
        return r5265239;
}

double f(double F, double B, double x) {
        double r5265240 = F;
        double r5265241 = -2.249440393592266e+18;
        bool r5265242 = r5265240 <= r5265241;
        double r5265243 = 1.0;
        double r5265244 = r5265240 * r5265240;
        double r5265245 = r5265243 / r5265244;
        double r5265246 = r5265245 - r5265243;
        double r5265247 = B;
        double r5265248 = sin(r5265247);
        double r5265249 = r5265246 / r5265248;
        double r5265250 = x;
        double r5265251 = tan(r5265247);
        double r5265252 = r5265250 / r5265251;
        double r5265253 = r5265249 - r5265252;
        double r5265254 = 1239.8194008180278;
        bool r5265255 = r5265240 <= r5265254;
        double r5265256 = 2.0;
        double r5265257 = r5265244 + r5265256;
        double r5265258 = r5265256 * r5265250;
        double r5265259 = r5265257 + r5265258;
        double r5265260 = -0.5;
        double r5265261 = pow(r5265259, r5265260);
        double r5265262 = r5265248 / r5265240;
        double r5265263 = r5265261 / r5265262;
        double r5265264 = r5265263 - r5265252;
        double r5265265 = r5265243 / r5265240;
        double r5265266 = r5265265 / r5265244;
        double r5265267 = r5265265 - r5265266;
        double r5265268 = r5265267 * r5265240;
        double r5265269 = r5265268 / r5265248;
        double r5265270 = r5265269 - r5265252;
        double r5265271 = r5265255 ? r5265264 : r5265270;
        double r5265272 = r5265242 ? r5265253 : r5265271;
        return r5265272;
}

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.249440393592266e+18

    1. Initial program 26.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. Simplified20.2

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

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

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

    if -2.249440393592266e+18 < F < 1239.8194008180278

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

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

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

    if 1239.8194008180278 < 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. Simplified19.8

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

      \[\leadsto \frac{{\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 F}{\sin B} - \frac{x}{\tan B}\]
    5. Applied unpow-prod-down19.9

      \[\leadsto \frac{\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 F}{\sin B} - \frac{x}{\tan B}\]
    6. Taylor expanded around inf 0.2

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

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{F} - \frac{\frac{1}{F}}{F \cdot F}\right)} \cdot F}{\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 -2.249440393592266 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{1}{F \cdot F} - 1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 1239.8194008180278:\\ \;\;\;\;\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{1}{F} - \frac{\frac{1}{F}}{F \cdot F}\right) \cdot F}{\sin B} - \frac{x}{\tan B}\\ \end{array}\]

Reproduce

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