Average Error: 13.6 → 0.3
Time: 12.5s
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.393293982823570639154866165724748883128 \cdot 10^{51}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{\frac{1}{F}}{F} - 1\right) \cdot \frac{1}{\sin B}\\ \mathbf{elif}\;F \le 16347121045823049728:\\ \;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right) \cdot \frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{1}{\sin B} - 1 \cdot \frac{1}{\sin B \cdot {F}^{2}}\right)\\ \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.393293982823570639154866165724748883128 \cdot 10^{51}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(\frac{\frac{1}{F}}{F} - 1\right) \cdot \frac{1}{\sin B}\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r41337 = x;
        double r41338 = 1.0;
        double r41339 = B;
        double r41340 = tan(r41339);
        double r41341 = r41338 / r41340;
        double r41342 = r41337 * r41341;
        double r41343 = -r41342;
        double r41344 = F;
        double r41345 = sin(r41339);
        double r41346 = r41344 / r41345;
        double r41347 = r41344 * r41344;
        double r41348 = 2.0;
        double r41349 = r41347 + r41348;
        double r41350 = r41348 * r41337;
        double r41351 = r41349 + r41350;
        double r41352 = r41338 / r41348;
        double r41353 = -r41352;
        double r41354 = pow(r41351, r41353);
        double r41355 = r41346 * r41354;
        double r41356 = r41343 + r41355;
        return r41356;
}

double f(double F, double B, double x) {
        double r41357 = F;
        double r41358 = -2.3932939828235706e+51;
        bool r41359 = r41357 <= r41358;
        double r41360 = x;
        double r41361 = 1.0;
        double r41362 = r41360 * r41361;
        double r41363 = B;
        double r41364 = tan(r41363);
        double r41365 = r41362 / r41364;
        double r41366 = -r41365;
        double r41367 = r41361 / r41357;
        double r41368 = r41367 / r41357;
        double r41369 = 1.0;
        double r41370 = r41368 - r41369;
        double r41371 = sin(r41363);
        double r41372 = r41369 / r41371;
        double r41373 = r41370 * r41372;
        double r41374 = r41366 + r41373;
        double r41375 = 1.634712104582305e+19;
        bool r41376 = r41357 <= r41375;
        double r41377 = cos(r41363);
        double r41378 = r41360 * r41377;
        double r41379 = r41378 / r41371;
        double r41380 = r41361 * r41379;
        double r41381 = -r41380;
        double r41382 = r41357 * r41357;
        double r41383 = 2.0;
        double r41384 = r41382 + r41383;
        double r41385 = r41383 * r41360;
        double r41386 = r41384 + r41385;
        double r41387 = r41361 / r41383;
        double r41388 = -r41387;
        double r41389 = pow(r41386, r41388);
        double r41390 = r41357 * r41389;
        double r41391 = r41390 * r41372;
        double r41392 = r41381 + r41391;
        double r41393 = 2.0;
        double r41394 = pow(r41357, r41393);
        double r41395 = r41371 * r41394;
        double r41396 = r41369 / r41395;
        double r41397 = r41361 * r41396;
        double r41398 = r41372 - r41397;
        double r41399 = r41366 + r41398;
        double r41400 = r41376 ? r41392 : r41399;
        double r41401 = r41359 ? r41374 : r41400;
        return r41401;
}

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.3932939828235706e+51

    1. Initial program 28.1

      \[\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. Using strategy rm
    3. Applied associate-*l/21.4

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

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

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

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

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

    if -2.3932939828235706e+51 < F < 1.634712104582305e+19

    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. Using strategy rm
    3. Applied associate-*l/0.4

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

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

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

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

    if 1.634712104582305e+19 < F

    1. Initial program 26.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. Using strategy rm
    3. Applied associate-*l/19.9

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

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

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

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

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(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))))))