Average Error: 13.4 → 0.3
Time: 11.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.3227807400901993 \cdot 10^{154}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(\frac{\frac{1}{{F}^{2}}}{\sin B} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 5.59840205479951262 \cdot 10^{123}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\sin B} \cdot \cos B\right) + \frac{1}{\sin B} \cdot \frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \cdot \frac{F}{\mathsf{fma}\left({\left(\frac{1}{{F}^{1}}\right)}^{1}, 1, {\left(\frac{1}{F}\right)}^{-1}\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 -1.3227807400901993 \cdot 10^{154}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(\frac{\frac{1}{{F}^{2}}}{\sin B} - \frac{1}{\sin B}\right)\\

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

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

\end{array}
double code(double F, double B, double x) {
	return (-(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))));
}
double code(double F, double B, double x) {
	double temp;
	if ((F <= -1.3227807400901993e+154)) {
		temp = (-(x * (1.0 / tan(B))) + (((1.0 / pow(F, 2.0)) / sin(B)) - (1.0 / sin(B))));
	} else {
		double temp_1;
		if ((F <= 5.598402054799513e+123)) {
			temp_1 = (-(((x * 1.0) / sin(B)) * cos(B)) + ((1.0 / sin(B)) * (F / pow((((F * F) + 2.0) + (2.0 * x)), (1.0 / 2.0)))));
		} else {
			temp_1 = (-(x * (1.0 / tan(B))) + ((1.0 / sin(B)) * (F / fma(pow((1.0 / pow(F, 1.0)), 1.0), 1.0, pow((1.0 / F), -1.0)))));
		}
		temp = temp_1;
	}
	return temp;
}

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.3227807400901993e+154

    1. Initial program 41.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-neg41.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-times37.0

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

      \[\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 *-un-lft-identity37.0

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    9. Taylor expanded around -inf 0.2

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

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

    if -1.3227807400901993e+154 < F < 5.598402054799513e+123

    1. Initial program 2.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. Using strategy rm
    3. Applied pow-neg2.0

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

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

      \[\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 *-un-lft-identity0.4

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    9. Using strategy rm
    10. Applied tan-quot0.4

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

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

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

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

    if 5.598402054799513e+123 < F

    1. Initial program 35.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 pow-neg35.5

      \[\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-times29.6

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

      \[\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 *-un-lft-identity29.6

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \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)}}}\]
    9. Taylor expanded around inf 0.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -1.3227807400901993 \cdot 10^{154}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(\frac{\frac{1}{{F}^{2}}}{\sin B} - \frac{1}{\sin B}\right)\\ \mathbf{elif}\;F \le 5.59840205479951262 \cdot 10^{123}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\sin B} \cdot \cos B\right) + \frac{1}{\sin B} \cdot \frac{F}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{1}{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \cdot \frac{F}{\mathsf{fma}\left({\left(\frac{1}{{F}^{1}}\right)}^{1}, 1, {\left(\frac{1}{F}\right)}^{-1}\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2020049 +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))))))