Average Error: 14.0 → 0.2
Time: 32.0s
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 -6.456946105717198073535144713885218120642 \cdot 10^{61}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 656096574.0901429653167724609375:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\sin B} \cdot \cos B\right) + \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\frac{\sin B}{1 - \frac{\frac{1}{F}}{F}}}\\ \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 -6.456946105717198073535144713885218120642 \cdot 10^{61}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \left(1 \cdot \frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right)\\

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

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

\end{array}
double f(double F, double B, double x) {
        double r51455 = x;
        double r51456 = 1.0;
        double r51457 = B;
        double r51458 = tan(r51457);
        double r51459 = r51456 / r51458;
        double r51460 = r51455 * r51459;
        double r51461 = -r51460;
        double r51462 = F;
        double r51463 = sin(r51457);
        double r51464 = r51462 / r51463;
        double r51465 = r51462 * r51462;
        double r51466 = 2.0;
        double r51467 = r51465 + r51466;
        double r51468 = r51466 * r51455;
        double r51469 = r51467 + r51468;
        double r51470 = r51456 / r51466;
        double r51471 = -r51470;
        double r51472 = pow(r51469, r51471);
        double r51473 = r51464 * r51472;
        double r51474 = r51461 + r51473;
        return r51474;
}

double f(double F, double B, double x) {
        double r51475 = F;
        double r51476 = -6.456946105717198e+61;
        bool r51477 = r51475 <= r51476;
        double r51478 = x;
        double r51479 = 1.0;
        double r51480 = r51478 * r51479;
        double r51481 = B;
        double r51482 = tan(r51481);
        double r51483 = r51480 / r51482;
        double r51484 = -r51483;
        double r51485 = 1.0;
        double r51486 = sin(r51481);
        double r51487 = 2.0;
        double r51488 = pow(r51475, r51487);
        double r51489 = r51486 * r51488;
        double r51490 = r51485 / r51489;
        double r51491 = r51479 * r51490;
        double r51492 = r51485 / r51486;
        double r51493 = r51491 - r51492;
        double r51494 = r51484 + r51493;
        double r51495 = 656096574.090143;
        bool r51496 = r51475 <= r51495;
        double r51497 = r51480 / r51486;
        double r51498 = cos(r51481);
        double r51499 = r51497 * r51498;
        double r51500 = -r51499;
        double r51501 = r51475 * r51475;
        double r51502 = 2.0;
        double r51503 = r51501 + r51502;
        double r51504 = r51502 * r51478;
        double r51505 = r51503 + r51504;
        double r51506 = r51479 / r51502;
        double r51507 = -r51506;
        double r51508 = pow(r51505, r51507);
        double r51509 = r51475 * r51508;
        double r51510 = r51509 / r51486;
        double r51511 = r51500 + r51510;
        double r51512 = r51479 / r51475;
        double r51513 = r51512 / r51475;
        double r51514 = r51485 - r51513;
        double r51515 = r51486 / r51514;
        double r51516 = r51485 / r51515;
        double r51517 = r51484 + r51516;
        double r51518 = r51496 ? r51511 : r51517;
        double r51519 = r51477 ? r51494 : r51518;
        return r51519;
}

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 < -6.456946105717198e+61

    1. Initial program 29.2

      \[\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/23.2

      \[\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/23.1

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

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

    if -6.456946105717198e+61 < F < 656096574.090143

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

      \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}\]
    8. Applied associate-/r/0.3

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

    if 656096574.090143 < F

    1. Initial program 26.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/20.3

      \[\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/20.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 clear-num20.3

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

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

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

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

Reproduce

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