Average Error: 13.9 → 0.3
Time: 10.7s
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 -5.7648000314577582 \cdot 10^{21}:\\ \;\;\;\;\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 21.3414842217350404:\\ \;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \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 -5.7648000314577582 \cdot 10^{21}:\\
\;\;\;\;\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 21.3414842217350404:\\
\;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\

\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 r39210 = x;
        double r39211 = 1.0;
        double r39212 = B;
        double r39213 = tan(r39212);
        double r39214 = r39211 / r39213;
        double r39215 = r39210 * r39214;
        double r39216 = -r39215;
        double r39217 = F;
        double r39218 = sin(r39212);
        double r39219 = r39217 / r39218;
        double r39220 = r39217 * r39217;
        double r39221 = 2.0;
        double r39222 = r39220 + r39221;
        double r39223 = r39221 * r39210;
        double r39224 = r39222 + r39223;
        double r39225 = r39211 / r39221;
        double r39226 = -r39225;
        double r39227 = pow(r39224, r39226);
        double r39228 = r39219 * r39227;
        double r39229 = r39216 + r39228;
        return r39229;
}

double f(double F, double B, double x) {
        double r39230 = F;
        double r39231 = -5.764800031457758e+21;
        bool r39232 = r39230 <= r39231;
        double r39233 = x;
        double r39234 = 1.0;
        double r39235 = r39233 * r39234;
        double r39236 = B;
        double r39237 = tan(r39236);
        double r39238 = r39235 / r39237;
        double r39239 = -r39238;
        double r39240 = 1.0;
        double r39241 = sin(r39236);
        double r39242 = 2.0;
        double r39243 = pow(r39230, r39242);
        double r39244 = r39241 * r39243;
        double r39245 = r39240 / r39244;
        double r39246 = r39234 * r39245;
        double r39247 = r39240 / r39241;
        double r39248 = r39246 - r39247;
        double r39249 = r39239 + r39248;
        double r39250 = 21.34148422173504;
        bool r39251 = r39230 <= r39250;
        double r39252 = cos(r39236);
        double r39253 = r39233 * r39252;
        double r39254 = r39253 / r39241;
        double r39255 = r39234 * r39254;
        double r39256 = -r39255;
        double r39257 = r39230 / r39241;
        double r39258 = r39230 * r39230;
        double r39259 = 2.0;
        double r39260 = r39258 + r39259;
        double r39261 = r39259 * r39233;
        double r39262 = r39260 + r39261;
        double r39263 = r39234 / r39259;
        double r39264 = -r39263;
        double r39265 = pow(r39262, r39264);
        double r39266 = r39257 * r39265;
        double r39267 = r39256 + r39266;
        double r39268 = r39247 - r39246;
        double r39269 = r39239 + r39268;
        double r39270 = r39251 ? r39267 : r39269;
        double r39271 = r39232 ? r39249 : r39270;
        return r39271;
}

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.764800031457758e+21

    1. Initial program 26.4

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    4. Applied frac-times20.8

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    5. Simplified20.8

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}}\]
    8. 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 -5.764800031457758e+21 < F < 21.34148422173504

    1. Initial program 0.4

      \[\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. Taylor expanded around inf 0.4

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

    if 21.34148422173504 < F

    1. Initial program 24.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 pow-neg24.6

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    4. Applied frac-times18.8

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    5. Simplified18.8

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)}}\]
    8. Taylor expanded around inf 0.3

      \[\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 -5.7648000314577582 \cdot 10^{21}:\\ \;\;\;\;\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 21.3414842217350404:\\ \;\;\;\;\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \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 2020062 +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))))))