Average Error: 13.2 → 0.5
Time: 37.3s
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 -57826870679626970038272:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 3.329685263856624625729256892778497939908 \cdot 10^{72}:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\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 -57826870679626970038272:\\
\;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\

\mathbf{elif}\;F \le 3.329685263856624625729256892778497939908 \cdot 10^{72}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x \cdot 1}{\tan B}\\

\end{array}
double f(double F, double B, double x) {
        double r66152 = x;
        double r66153 = 1.0;
        double r66154 = B;
        double r66155 = tan(r66154);
        double r66156 = r66153 / r66155;
        double r66157 = r66152 * r66156;
        double r66158 = -r66157;
        double r66159 = F;
        double r66160 = sin(r66154);
        double r66161 = r66159 / r66160;
        double r66162 = r66159 * r66159;
        double r66163 = 2.0;
        double r66164 = r66162 + r66163;
        double r66165 = r66163 * r66152;
        double r66166 = r66164 + r66165;
        double r66167 = r66153 / r66163;
        double r66168 = -r66167;
        double r66169 = pow(r66166, r66168);
        double r66170 = r66161 * r66169;
        double r66171 = r66158 + r66170;
        return r66171;
}

double f(double F, double B, double x) {
        double r66172 = F;
        double r66173 = -5.782687067962697e+22;
        bool r66174 = r66172 <= r66173;
        double r66175 = 1.0;
        double r66176 = B;
        double r66177 = sin(r66176);
        double r66178 = 2.0;
        double r66179 = pow(r66172, r66178);
        double r66180 = r66177 * r66179;
        double r66181 = r66175 / r66180;
        double r66182 = 1.0;
        double r66183 = r66182 / r66177;
        double r66184 = r66181 - r66183;
        double r66185 = x;
        double r66186 = r66185 * r66175;
        double r66187 = tan(r66176);
        double r66188 = r66186 / r66187;
        double r66189 = r66184 - r66188;
        double r66190 = 3.3296852638566246e+72;
        bool r66191 = r66172 <= r66190;
        double r66192 = r66172 / r66177;
        double r66193 = r66172 * r66172;
        double r66194 = 2.0;
        double r66195 = r66193 + r66194;
        double r66196 = r66194 * r66185;
        double r66197 = r66195 + r66196;
        double r66198 = r66175 / r66194;
        double r66199 = -r66198;
        double r66200 = pow(r66197, r66199);
        double r66201 = r66192 * r66200;
        double r66202 = cos(r66176);
        double r66203 = r66185 * r66202;
        double r66204 = r66203 / r66177;
        double r66205 = r66175 * r66204;
        double r66206 = r66201 - r66205;
        double r66207 = r66183 - r66181;
        double r66208 = r66207 - r66188;
        double r66209 = r66191 ? r66206 : r66208;
        double r66210 = r66174 ? r66189 : r66209;
        return r66210;
}

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.782687067962697e+22

    1. Initial program 25.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. Simplified25.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 div-inv25.6

      \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}\]
    5. Applied associate-*l*20.4

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

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

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

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

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

    if -5.782687067962697e+22 < F < 3.3296852638566246e+72

    1. Initial program 0.8

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

      \[\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.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}{1 \cdot \frac{x \cdot \cos B}{\sin B}}\]

    if 3.3296852638566246e+72 < F

    1. Initial program 29.3

      \[\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. Simplified29.3

      \[\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 div-inv29.3

      \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}\]
    5. Applied associate-*l*23.6

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -57826870679626970038272:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 3.329685263856624625729256892778497939908 \cdot 10^{72}:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x \cdot 1}{\tan B}\\ \end{array}\]

Reproduce

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