Average Error: 13.7 → 0.3
Time: 12.8s
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 -1.7231308537094901 \cdot 10^{155}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(\frac{\frac{1}{F}}{F} - 1\right) - \frac{x \cdot 1}{\tan B}\\ \mathbf{elif}\;F \le 29707.114427757369:\\ \;\;\;\;\frac{F}{\sin B \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}} - \frac{x \cdot 1}{\sin B} \cdot \cos B\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - 1 \cdot \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 -1.7231308537094901 \cdot 10^{155}:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left(\frac{\frac{1}{F}}{F} - 1\right) - \frac{x \cdot 1}{\tan B}\\

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

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B} - 1 \cdot \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 r39295 = x;
        double r39296 = 1.0;
        double r39297 = B;
        double r39298 = tan(r39297);
        double r39299 = r39296 / r39298;
        double r39300 = r39295 * r39299;
        double r39301 = -r39300;
        double r39302 = F;
        double r39303 = sin(r39297);
        double r39304 = r39302 / r39303;
        double r39305 = r39302 * r39302;
        double r39306 = 2.0;
        double r39307 = r39305 + r39306;
        double r39308 = r39306 * r39295;
        double r39309 = r39307 + r39308;
        double r39310 = r39296 / r39306;
        double r39311 = -r39310;
        double r39312 = pow(r39309, r39311);
        double r39313 = r39304 * r39312;
        double r39314 = r39301 + r39313;
        return r39314;
}

double f(double F, double B, double x) {
        double r39315 = F;
        double r39316 = -1.72313085370949e+155;
        bool r39317 = r39315 <= r39316;
        double r39318 = 1.0;
        double r39319 = B;
        double r39320 = sin(r39319);
        double r39321 = r39318 / r39320;
        double r39322 = 1.0;
        double r39323 = r39322 / r39315;
        double r39324 = r39323 / r39315;
        double r39325 = r39324 - r39318;
        double r39326 = r39321 * r39325;
        double r39327 = x;
        double r39328 = r39327 * r39322;
        double r39329 = tan(r39319);
        double r39330 = r39328 / r39329;
        double r39331 = r39326 - r39330;
        double r39332 = 29707.11442775737;
        bool r39333 = r39315 <= r39332;
        double r39334 = r39315 * r39315;
        double r39335 = 2.0;
        double r39336 = r39334 + r39335;
        double r39337 = r39335 * r39327;
        double r39338 = r39336 + r39337;
        double r39339 = r39322 / r39335;
        double r39340 = pow(r39338, r39339);
        double r39341 = r39320 * r39340;
        double r39342 = r39315 / r39341;
        double r39343 = r39328 / r39320;
        double r39344 = cos(r39319);
        double r39345 = r39343 * r39344;
        double r39346 = r39342 - r39345;
        double r39347 = 2.0;
        double r39348 = pow(r39315, r39347);
        double r39349 = r39320 * r39348;
        double r39350 = r39318 / r39349;
        double r39351 = r39322 * r39350;
        double r39352 = r39321 - r39351;
        double r39353 = r39352 - r39330;
        double r39354 = r39333 ? r39346 : r39353;
        double r39355 = r39317 ? r39331 : r39354;
        return r39355;
}

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 < -1.72313085370949e+155

    1. Initial program 41.7

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

      \[\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 pow-neg41.7

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

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified35.9

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/35.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}{\frac{x \cdot 1}{\tan B}}\]
    9. Using strategy rm
    10. Applied *-un-lft-identity35.8

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

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

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

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

    if -1.72313085370949e+155 < F < 29707.11442775737

    1. Initial program 1.7

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

      \[\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 pow-neg1.7

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

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified0.4

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/0.3

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

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

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

    if 29707.11442775737 < F

    1. Initial program 25.0

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

      \[\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 pow-neg24.9

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

      \[\leadsto \color{blue}{\frac{F \cdot 1}{\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}\]
    6. Simplified19.1

      \[\leadsto \frac{\color{blue}{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}\]
    7. Using strategy rm
    8. Applied associate-*r/19.0

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

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

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

Reproduce

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