Average Error: 13.6 → 0.3
Time: 12.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 -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 r40589 = x;
        double r40590 = 1.0;
        double r40591 = B;
        double r40592 = tan(r40591);
        double r40593 = r40590 / r40592;
        double r40594 = r40589 * r40593;
        double r40595 = -r40594;
        double r40596 = F;
        double r40597 = sin(r40591);
        double r40598 = r40596 / r40597;
        double r40599 = r40596 * r40596;
        double r40600 = 2.0;
        double r40601 = r40599 + r40600;
        double r40602 = r40600 * r40589;
        double r40603 = r40601 + r40602;
        double r40604 = r40590 / r40600;
        double r40605 = -r40604;
        double r40606 = pow(r40603, r40605);
        double r40607 = r40598 * r40606;
        double r40608 = r40595 + r40607;
        return r40608;
}

double f(double F, double B, double x) {
        double r40609 = F;
        double r40610 = -2.3932939828235706e+51;
        bool r40611 = r40609 <= r40610;
        double r40612 = x;
        double r40613 = 1.0;
        double r40614 = r40612 * r40613;
        double r40615 = B;
        double r40616 = tan(r40615);
        double r40617 = r40614 / r40616;
        double r40618 = -r40617;
        double r40619 = r40613 / r40609;
        double r40620 = r40619 / r40609;
        double r40621 = 1.0;
        double r40622 = r40620 - r40621;
        double r40623 = sin(r40615);
        double r40624 = r40621 / r40623;
        double r40625 = r40622 * r40624;
        double r40626 = r40618 + r40625;
        double r40627 = 1.634712104582305e+19;
        bool r40628 = r40609 <= r40627;
        double r40629 = cos(r40615);
        double r40630 = r40612 * r40629;
        double r40631 = r40630 / r40623;
        double r40632 = r40613 * r40631;
        double r40633 = -r40632;
        double r40634 = r40609 * r40609;
        double r40635 = 2.0;
        double r40636 = r40634 + r40635;
        double r40637 = r40635 * r40612;
        double r40638 = r40636 + r40637;
        double r40639 = r40613 / r40635;
        double r40640 = -r40639;
        double r40641 = pow(r40638, r40640);
        double r40642 = r40609 * r40641;
        double r40643 = r40642 * r40624;
        double r40644 = r40633 + r40643;
        double r40645 = 2.0;
        double r40646 = pow(r40609, r40645);
        double r40647 = r40623 * r40646;
        double r40648 = r40621 / r40647;
        double r40649 = r40613 * r40648;
        double r40650 = r40624 - r40649;
        double r40651 = r40618 + r40650;
        double r40652 = r40628 ? r40644 : r40651;
        double r40653 = r40611 ? r40626 : r40652;
        return r40653;
}

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 
(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))))))