VandenBroeck and Keller, Equation (23)

Percentage Accurate: 75.1% → 99.6%
Time: 22.0s
Alternatives: 34
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ \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)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* 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) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\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)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 34 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 75.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* 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) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\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)}
\end{array}

Alternative 1: 99.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 150000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4e+36)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 150000000.0)
     (fma (/ F (sin B)) (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ (- x) (tan B)))
     (- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4e+36) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 150000000.0) {
		tmp = fma((F / sin(B)), pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (-x / tan(B)));
	} else {
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -4e+36)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 150000000.0)
		tmp = fma(Float64(F / sin(B)), (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(Float64(-x) / tan(B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -4e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 150000000.0], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 150000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.00000000000000017e36

    1. Initial program 64.2%

      \[\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 in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u77.8%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef77.8%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr77.8%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def77.8%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified99.9%

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

    if -4.00000000000000017e36 < F < 1.5e8

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]

    if 1.5e8 < F

    1. Initial program 52.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. Step-by-step derivation
      1. distribute-lft-neg-in52.8%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative52.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)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def52.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/52.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity52.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified52.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around inf 99.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
    5. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      2. mul-1-neg99.8%

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      3. unsub-neg99.8%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. associate-*l/99.7%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      5. *-commutative99.7%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    6. Simplified99.7%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 150000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \]

Alternative 2: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -3.3 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 20000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -3.3e+36)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 20000000.0)
       (- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) t_0)
       (- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -3.3e+36) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 20000000.0) {
		tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-3.3d+36)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 20000000.0d0) then
        tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - t_0
    else
        tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -3.3e+36) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 20000000.0) {
		tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -3.3e+36:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 20000000.0:
		tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0
	else:
		tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -3.3e+36)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 20000000.0)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -3.3e+36)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 20000000.0)
		tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - t_0;
	else
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.3e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 20000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.3 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 20000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3.2999999999999999e36

    1. Initial program 64.2%

      \[\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 in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u77.8%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef77.8%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr77.8%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def77.8%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified99.9%

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

    if -3.2999999999999999e36 < F < 2e7

    1. Initial program 99.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. Step-by-step derivation
      1. div-inv43.1%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u21.9%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef21.9%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    3. Applied egg-rr50.5%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def21.9%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p43.1%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    5. Simplified99.5%

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

    if 2e7 < F

    1. Initial program 52.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. Step-by-step derivation
      1. distribute-lft-neg-in52.8%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative52.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)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def52.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval52.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/52.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity52.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified52.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around inf 99.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
    5. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      2. mul-1-neg99.8%

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      3. unsub-neg99.8%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. associate-*l/99.7%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      5. *-commutative99.7%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    6. Simplified99.7%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 20000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \]

Alternative 3: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.25:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.4)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 2.25)
     (+
      (* x (/ -1.0 (tan B)))
      (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
     (- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 2.25) {
		tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))));
	} else {
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 2.25d0) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))
    else
        tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 2.25) {
		tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))));
	} else {
		tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.4:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 2.25:
		tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))
	else:
		tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 2.25)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.4)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 2.25)
		tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))));
	else
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.25], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 2.25:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.3999999999999999

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u78.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef78.5%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr78.5%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def78.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified99.9%

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

    if -1.3999999999999999 < F < 2.25

    1. Initial program 99.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 in F around 0 98.7%

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

    if 2.25 < F

    1. Initial program 53.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. Step-by-step derivation
      1. distribute-lft-neg-in53.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative53.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified53.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around inf 99.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
    5. Step-by-step derivation
      1. +-commutative99.3%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      2. mul-1-neg99.3%

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      3. unsub-neg99.3%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. associate-*l/99.2%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      5. *-commutative99.2%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    6. Simplified99.2%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.25:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \]

Alternative 4: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.45)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 1.7)
     (+
      (* x (/ -1.0 (tan B)))
      (* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (* x 2.0))))))
     (- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.45) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 1.7) {
		tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (1.0 / sqrt((2.0 + (x * 2.0)))));
	} else {
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.45d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 1.7d0) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (1.0d0 / sqrt((2.0d0 + (x * 2.0d0)))))
    else
        tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.45) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 1.7) {
		tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * (1.0 / Math.sqrt((2.0 + (x * 2.0)))));
	} else {
		tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.45:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 1.7:
		tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * (1.0 / math.sqrt((2.0 + (x * 2.0)))))
	else:
		tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.45)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 1.7)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + Float64(x * 2.0))))));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.45)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 1.7)
		tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (1.0 / sqrt((2.0 + (x * 2.0)))));
	else
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 1.7:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.44999999999999996

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u78.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef78.5%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr78.5%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def78.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified99.9%

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

    if -1.44999999999999996 < F < 1.69999999999999996

    1. Initial program 99.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. Step-by-step derivation
      1. add-sqr-sqrt99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x} \cdot \sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}}^{\left(-\frac{1}{2}\right)} \]
      2. unpow-prod-down99.5%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\color{blue}{\mathsf{fma}\left(2, x, F \cdot F + 2\right)}}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      5. fma-def99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      6. metadata-eval99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(-\color{blue}{0.5}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      7. metadata-eval99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\color{blue}{-0.5}} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      8. +-commutative99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\color{blue}{2 \cdot x + \left(F \cdot F + 2\right)}}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      9. fma-def99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\color{blue}{\mathsf{fma}\left(2, x, F \cdot F + 2\right)}}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      10. fma-def99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      11. metadata-eval99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(-\color{blue}{0.5}\right)}\right) \]
      12. metadata-eval99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\color{blue}{-0.5}}\right) \]
    3. Applied egg-rr99.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5}\right)} \]
    4. Step-by-step derivation
      1. pow-sqr99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    5. Simplified99.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    6. Taylor expanded in F around 0 98.8%

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

    if 1.69999999999999996 < F

    1. Initial program 53.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. Step-by-step derivation
      1. distribute-lft-neg-in53.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative53.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified53.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around inf 99.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
    5. Step-by-step derivation
      1. +-commutative99.3%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      2. mul-1-neg99.3%

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      3. unsub-neg99.3%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. associate-*l/99.2%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      5. *-commutative99.2%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    6. Simplified99.2%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \]

Alternative 5: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.4)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 1.4)
     (+ (* x (/ -1.0 (tan B))) (/ F (/ (sin B) (sqrt 0.5))))
     (- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 1.4) {
		tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) / sqrt(0.5)));
	} else {
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 1.4d0) then
        tmp = (x * ((-1.0d0) / tan(b))) + (f / (sin(b) / sqrt(0.5d0)))
    else
        tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 1.4) {
		tmp = (x * (-1.0 / Math.tan(B))) + (F / (Math.sin(B) / Math.sqrt(0.5)));
	} else {
		tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.4:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 1.4:
		tmp = (x * (-1.0 / math.tan(B))) + (F / (math.sin(B) / math.sqrt(0.5)))
	else:
		tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 1.4)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(sin(B) / sqrt(0.5))));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.4)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 1.4)
		tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) / sqrt(0.5)));
	else
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.3999999999999999

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u78.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef78.5%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr78.5%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def78.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified99.9%

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

    if -1.3999999999999999 < F < 1.3999999999999999

    1. Initial program 99.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 in F around 0 98.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    3. Taylor expanded in x around 0 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*98.6%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} \]
    5. Simplified98.6%

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

    if 1.3999999999999999 < F

    1. Initial program 53.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. Step-by-step derivation
      1. distribute-lft-neg-in53.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative53.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified53.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around inf 99.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
    5. Step-by-step derivation
      1. +-commutative99.3%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      2. mul-1-neg99.3%

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      3. unsub-neg99.3%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. associate-*l/99.2%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      5. *-commutative99.2%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    6. Simplified99.2%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \]

Alternative 6: 92.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 980:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -8.8e-11)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 980.0)
     (+
      (* x (/ -1.0 (tan B)))
      (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)))
     (- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 980.0) {
		tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B));
	} else {
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-8.8d-11)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 980.0d0) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b))
    else
        tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 980.0) {
		tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B));
	} else {
		tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -8.8e-11:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 980.0:
		tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B))
	else:
		tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -8.8e-11)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 980.0)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -8.8e-11)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 980.0)
		tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B));
	else
		tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -8.8e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 980.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 980:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -8.8000000000000006e-11

    1. Initial program 69.9%

      \[\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 in F around -inf 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv98.7%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u74.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef74.5%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr74.5%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def74.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p98.7%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified98.7%

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

    if -8.8000000000000006e-11 < F < 980

    1. Initial program 99.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 in B around 0 88.3%

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

    if 980 < F

    1. Initial program 53.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. Step-by-step derivation
      1. distribute-lft-neg-in53.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative53.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity53.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified53.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around inf 99.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
    5. Step-by-step derivation
      1. +-commutative99.3%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      2. mul-1-neg99.3%

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      3. unsub-neg99.3%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. associate-*l/99.2%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      5. *-commutative99.2%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    6. Simplified99.2%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification94.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 980:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \end{array} \]

Alternative 7: 92.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 195:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -8.8e-11)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 195.0)
     (+
      (* x (/ -1.0 (tan B)))
      (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)))
     (- (/ 1.0 (sin B)) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 195.0) {
		tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B));
	} else {
		tmp = (1.0 / sin(B)) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-8.8d-11)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 195.0d0) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b))
    else
        tmp = (1.0d0 / sin(b)) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 195.0) {
		tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -8.8e-11:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 195.0:
		tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B))
	else:
		tmp = (1.0 / math.sin(B)) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -8.8e-11)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 195.0)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -8.8e-11)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 195.0)
		tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B));
	else
		tmp = (1.0 / sin(B)) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -8.8e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 195.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 195:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -8.8000000000000006e-11

    1. Initial program 69.9%

      \[\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 in F around -inf 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv98.7%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u74.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef74.5%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr74.5%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def74.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p98.7%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified98.7%

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

    if -8.8000000000000006e-11 < F < 195

    1. Initial program 99.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 in B around 0 88.3%

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

    if 195 < F

    1. Initial program 53.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 in F around inf 99.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 195:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 8: 90.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{if}\;F \leq -4.8 \cdot 10^{-10}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7.8 \cdot 10^{-202}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-119}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.78:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))))
   (if (<= F -4.8e-10)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F -7.8e-202)
       t_0
       (if (<= F 1.55e-119)
         (/ (* (- x) (cos B)) (sin B))
         (if (<= F 0.78) t_0 (- (/ 1.0 (sin B)) (* x (/ 1.0 (tan B))))))))))
double code(double F, double B, double x) {
	double t_0 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	double tmp;
	if (F <= -4.8e-10) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -7.8e-202) {
		tmp = t_0;
	} else if (F <= 1.55e-119) {
		tmp = (-x * cos(B)) / sin(B);
	} else if (F <= 0.78) {
		tmp = t_0;
	} else {
		tmp = (1.0 / sin(B)) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
    if (f <= (-4.8d-10)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-7.8d-202)) then
        tmp = t_0
    else if (f <= 1.55d-119) then
        tmp = (-x * cos(b)) / sin(b)
    else if (f <= 0.78d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / sin(b)) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	double tmp;
	if (F <= -4.8e-10) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -7.8e-202) {
		tmp = t_0;
	} else if (F <= 1.55e-119) {
		tmp = (-x * Math.cos(B)) / Math.sin(B);
	} else if (F <= 0.78) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B)
	tmp = 0
	if F <= -4.8e-10:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -7.8e-202:
		tmp = t_0
	elif F <= 1.55e-119:
		tmp = (-x * math.cos(B)) / math.sin(B)
	elif F <= 0.78:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B))
	tmp = 0.0
	if (F <= -4.8e-10)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -7.8e-202)
		tmp = t_0;
	elseif (F <= 1.55e-119)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
	elseif (F <= 0.78)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	tmp = 0.0;
	if (F <= -4.8e-10)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -7.8e-202)
		tmp = t_0;
	elseif (F <= 1.55e-119)
		tmp = (-x * cos(B)) / sin(B);
	elseif (F <= 0.78)
		tmp = t_0;
	else
		tmp = (1.0 / sin(B)) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.8e-10], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.8e-202], t$95$0, If[LessEqual[F, 1.55e-119], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.78], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{if}\;F \leq -4.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -7.8 \cdot 10^{-202}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.55 \cdot 10^{-119}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 0.78:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -4.8e-10

    1. Initial program 69.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u75.4%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef75.4%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr75.4%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def75.4%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p99.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified99.9%

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

    if -4.8e-10 < F < -7.7999999999999998e-202 or 1.54999999999999989e-119 < F < 0.78000000000000003

    1. Initial program 99.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 in F around 0 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    3. Taylor expanded in B around 0 78.2%

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

    if -7.7999999999999998e-202 < F < 1.54999999999999989e-119

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 85.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]

    if 0.78000000000000003 < F

    1. Initial program 53.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 in F around inf 99.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification91.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{-10}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7.8 \cdot 10^{-202}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-119}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.78:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 9: 92.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.39:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -8.8e-11)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 0.39)
     (+ (* x (/ -1.0 (tan B))) (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)))
     (- (/ 1.0 (sin B)) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 0.39) {
		tmp = (x * (-1.0 / tan(B))) + (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B));
	} else {
		tmp = (1.0 / sin(B)) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-8.8d-11)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 0.39d0) then
        tmp = (x * ((-1.0d0) / tan(b))) + (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b))
    else
        tmp = (1.0d0 / sin(b)) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 0.39) {
		tmp = (x * (-1.0 / Math.tan(B))) + (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -8.8e-11:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 0.39:
		tmp = (x * (-1.0 / math.tan(B))) + (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B))
	else:
		tmp = (1.0 / math.sin(B)) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -8.8e-11)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 0.39)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -8.8e-11)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 0.39)
		tmp = (x * (-1.0 / tan(B))) + (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B));
	else
		tmp = (1.0 / sin(B)) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -8.8e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.39], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 0.39:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -8.8000000000000006e-11

    1. Initial program 69.9%

      \[\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 in F around -inf 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv98.7%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u74.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef74.5%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr74.5%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def74.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p98.7%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified98.7%

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

    if -8.8000000000000006e-11 < F < 0.39000000000000001

    1. Initial program 99.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 in F around 0 98.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    3. Taylor expanded in B around 0 87.7%

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

    if 0.39000000000000001 < F

    1. Initial program 53.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 in F around inf 99.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.39:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 10: 85.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.85 \cdot 10^{-60}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6.8e-33)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 1.85e-60)
     (/ (* (- x) (cos B)) (sin B))
     (- (/ 1.0 (sin B)) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.8e-33) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 1.85e-60) {
		tmp = (-x * cos(B)) / sin(B);
	} else {
		tmp = (1.0 / sin(B)) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-6.8d-33)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 1.85d-60) then
        tmp = (-x * cos(b)) / sin(b)
    else
        tmp = (1.0d0 / sin(b)) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.8e-33) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 1.85e-60) {
		tmp = (-x * Math.cos(B)) / Math.sin(B);
	} else {
		tmp = (1.0 / Math.sin(B)) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6.8e-33:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 1.85e-60:
		tmp = (-x * math.cos(B)) / math.sin(B)
	else:
		tmp = (1.0 / math.sin(B)) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6.8e-33)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 1.85e-60)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -6.8e-33)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 1.85e-60)
		tmp = (-x * cos(B)) / sin(B);
	else
		tmp = (1.0 / sin(B)) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6.8e-33], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e-60], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.8 \cdot 10^{-33}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 1.85 \cdot 10^{-60}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -6.8000000000000001e-33

    1. Initial program 71.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. Taylor expanded in F around -inf 95.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv95.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u70.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef70.2%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr70.2%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def70.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p95.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified95.3%

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

    if -6.8000000000000001e-33 < F < 1.85000000000000012e-60

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 74.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]

    if 1.85000000000000012e-60 < F

    1. Initial program 58.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. Taylor expanded in F around inf 94.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.85 \cdot 10^{-60}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 11: 72.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.082:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-8}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.082)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 2.6e-8)
     (* (cos B) (/ (- x) (sin B)))
     (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.082) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 2.6e-8) {
		tmp = cos(B) * (-x / sin(B));
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.082d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 2.6d-8) then
        tmp = cos(b) * (-x / sin(b))
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.082) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 2.6e-8) {
		tmp = Math.cos(B) * (-x / Math.sin(B));
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.082:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 2.6e-8:
		tmp = math.cos(B) * (-x / math.sin(B))
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.082)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 2.6e-8)
		tmp = Float64(cos(B) * Float64(Float64(-x) / sin(B)));
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.082)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 2.6e-8)
		tmp = cos(B) * (-x / sin(B));
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.082], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.6e-8], N[(N[Cos[B], $MachinePrecision] * N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.082:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.6 \cdot 10^{-8}:\\
\;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -0.0820000000000000034

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.9%

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

    if -0.0820000000000000034 < F < 2.6000000000000001e-8

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 73.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg73.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/73.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in73.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified73.5%

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

    if 2.6000000000000001e-8 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot 1}{\sin B \cdot F}} \]
      2. metadata-eval95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\frac{1}{1}}}{\sin B \cdot F} \]
      3. div-inv95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr95.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 82.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.082:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-8}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 12: 72.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3800:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.08 \cdot 10^{-8}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3800.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 1.08e-8)
     (/ (- x) (/ (sin B) (cos B)))
     (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3800.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 1.08e-8) {
		tmp = -x / (sin(B) / cos(B));
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-3800.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 1.08d-8) then
        tmp = -x / (sin(b) / cos(b))
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3800.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 1.08e-8) {
		tmp = -x / (Math.sin(B) / Math.cos(B));
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3800.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 1.08e-8:
		tmp = -x / (math.sin(B) / math.cos(B))
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3800.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 1.08e-8)
		tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B)));
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3800.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 1.08e-8)
		tmp = -x / (sin(B) / cos(B));
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3800.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.08e-8], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3800:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.08 \cdot 10^{-8}:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3800

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.9%

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

    if -3800 < F < 1.0800000000000001e-8

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 73.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg73.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/73.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in73.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified73.5%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in x around 0 73.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. mul-1-neg73.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-/l*73.5%

        \[\leadsto -\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      3. distribute-neg-frac73.5%

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    9. Simplified73.5%

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]

    if 1.0800000000000001e-8 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot 1}{\sin B \cdot F}} \]
      2. metadata-eval95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\frac{1}{1}}}{\sin B \cdot F} \]
      3. div-inv95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr95.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 82.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3800:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.08 \cdot 10^{-8}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 13: 72.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -130:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.75 \cdot 10^{-8}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -130.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 2.75e-8)
     (/ (* (- x) (cos B)) (sin B))
     (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -130.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 2.75e-8) {
		tmp = (-x * cos(B)) / sin(B);
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-130.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 2.75d-8) then
        tmp = (-x * cos(b)) / sin(b)
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -130.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 2.75e-8) {
		tmp = (-x * Math.cos(B)) / Math.sin(B);
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -130.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 2.75e-8:
		tmp = (-x * math.cos(B)) / math.sin(B)
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -130.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 2.75e-8)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -130.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 2.75e-8)
		tmp = (-x * cos(B)) / sin(B);
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -130.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.75e-8], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -130:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.75 \cdot 10^{-8}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -130

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.9%

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

    if -130 < F < 2.7500000000000001e-8

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 73.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]

    if 2.7500000000000001e-8 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot 1}{\sin B \cdot F}} \]
      2. metadata-eval95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\frac{1}{1}}}{\sin B \cdot F} \]
      3. div-inv95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr95.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 82.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -130:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.75 \cdot 10^{-8}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 14: 78.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-11}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.3e-32)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 2e-11)
     (/ (* (- x) (cos B)) (sin B))
     (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.3e-32) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 2e-11) {
		tmp = (-x * cos(B)) / sin(B);
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.3d-32)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 2d-11) then
        tmp = (-x * cos(b)) / sin(b)
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.3e-32) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 2e-11) {
		tmp = (-x * Math.cos(B)) / Math.sin(B);
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.3e-32:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 2e-11:
		tmp = (-x * math.cos(B)) / math.sin(B)
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.3e-32)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 2e-11)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.3e-32)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 2e-11)
		tmp = (-x * cos(B)) / sin(B);
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.3e-32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-11], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 2 \cdot 10^{-11}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.3000000000000001e-32

    1. Initial program 71.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. Taylor expanded in F around -inf 95.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. div-inv95.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p-u70.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      3. expm1-udef70.2%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    4. Applied egg-rr70.2%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. expm1-def70.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{-1}{\sin B} \]
      2. expm1-log1p95.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
    6. Simplified95.3%

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

    if -2.3000000000000001e-32 < F < 1.99999999999999988e-11

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 74.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]

    if 1.99999999999999988e-11 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot 1}{\sin B \cdot F}} \]
      2. metadata-eval95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\frac{1}{1}}}{\sin B \cdot F} \]
      3. div-inv95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr95.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 82.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-11}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 15: 67.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{-281}:\\ \;\;\;\;\frac{F \cdot t_0 - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-238}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 0.21:\\ \;\;\;\;t_0 \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
   (if (<= F -8.8e-11)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -6.5e-281)
       (/ (- (* F t_0) x) B)
       (if (<= F 2.6e-238)
         (- (* (/ F B) (/ 1.0 F)) (/ 1.0 (/ (tan B) x)))
         (if (<= F 0.21)
           (- (* t_0 (/ F B)) (/ x B))
           (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -6.5e-281) {
		tmp = ((F * t_0) - x) / B;
	} else if (F <= 2.6e-238) {
		tmp = ((F / B) * (1.0 / F)) - (1.0 / (tan(B) / x));
	} else if (F <= 0.21) {
		tmp = (t_0 * (F / B)) - (x / B);
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
    if (f <= (-8.8d-11)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-6.5d-281)) then
        tmp = ((f * t_0) - x) / b
    else if (f <= 2.6d-238) then
        tmp = ((f / b) * (1.0d0 / f)) - (1.0d0 / (tan(b) / x))
    else if (f <= 0.21d0) then
        tmp = (t_0 * (f / b)) - (x / b)
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -6.5e-281) {
		tmp = ((F * t_0) - x) / B;
	} else if (F <= 2.6e-238) {
		tmp = ((F / B) * (1.0 / F)) - (1.0 / (Math.tan(B) / x));
	} else if (F <= 0.21) {
		tmp = (t_0 * (F / B)) - (x / B);
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0))))
	tmp = 0
	if F <= -8.8e-11:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -6.5e-281:
		tmp = ((F * t_0) - x) / B
	elif F <= 2.6e-238:
		tmp = ((F / B) * (1.0 / F)) - (1.0 / (math.tan(B) / x))
	elif F <= 0.21:
		tmp = (t_0 * (F / B)) - (x / B)
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))
	tmp = 0.0
	if (F <= -8.8e-11)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -6.5e-281)
		tmp = Float64(Float64(Float64(F * t_0) - x) / B);
	elseif (F <= 2.6e-238)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - Float64(1.0 / Float64(tan(B) / x)));
	elseif (F <= 0.21)
		tmp = Float64(Float64(t_0 * Float64(F / B)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
	tmp = 0.0;
	if (F <= -8.8e-11)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -6.5e-281)
		tmp = ((F * t_0) - x) / B;
	elseif (F <= 2.6e-238)
		tmp = ((F / B) * (1.0 / F)) - (1.0 / (tan(B) / x));
	elseif (F <= 0.21)
		tmp = (t_0 * (F / B)) - (x / B);
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -8.8e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.5e-281], N[(N[(N[(F * t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.6e-238], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.21], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -6.5 \cdot 10^{-281}:\\
\;\;\;\;\frac{F \cdot t_0 - x}{B}\\

\mathbf{elif}\;F \leq 2.6 \cdot 10^{-238}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 0.21:\\
\;\;\;\;t_0 \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -8.8000000000000006e-11

    1. Initial program 69.9%

      \[\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 in F around -inf 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 76.9%

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

    if -8.8000000000000006e-11 < F < -6.5e-281

    1. Initial program 99.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 in F around 0 99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    3. Taylor expanded in B around 0 60.0%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]

    if -6.5e-281 < F < 2.6000000000000001e-238

    1. Initial program 99.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. Taylor expanded in F around inf 41.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 81.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. div-inv81.1%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{B} \cdot \frac{1}{F} \]
      2. clear-num81.4%

        \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{B} \cdot \frac{1}{F} \]
    5. Applied egg-rr81.4%

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

    if 2.6000000000000001e-238 < F < 0.209999999999999992

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in B around 0 66.6%

      \[\leadsto \color{blue}{\frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
    5. Taylor expanded in F around 0 64.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]

    if 0.209999999999999992 < F

    1. Initial program 53.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 in F around inf 76.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times99.1%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num99.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity99.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr99.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 85.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\frac{\sin B \cdot F}{F}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification73.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{-281}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-238}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 0.21:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 16: 63.2% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{1}{B} - t_0\\ \mathbf{if}\;F \leq -18:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-176}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{-200}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-8}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))) (t_1 (- (/ 1.0 B) t_0)))
   (if (<= F -18.0)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -3e-176)
       t_1
       (if (<= F -1.05e-200)
         (/ (- x) B)
         (if (<= F 2.7e-8)
           (- (* (/ F B) (/ 1.0 F)) t_0)
           (if (<= F 2.7e+82)
             (- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))
             t_1)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = (1.0 / B) - t_0;
	double tmp;
	if (F <= -18.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -3e-176) {
		tmp = t_1;
	} else if (F <= -1.05e-200) {
		tmp = -x / B;
	} else if (F <= 2.7e-8) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else if (F <= 2.7e+82) {
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = (1.0d0 / b) - t_0
    if (f <= (-18.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-3d-176)) then
        tmp = t_1
    else if (f <= (-1.05d-200)) then
        tmp = -x / b
    else if (f <= 2.7d-8) then
        tmp = ((f / b) * (1.0d0 / f)) - t_0
    else if (f <= 2.7d+82) then
        tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double t_1 = (1.0 / B) - t_0;
	double tmp;
	if (F <= -18.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -3e-176) {
		tmp = t_1;
	} else if (F <= -1.05e-200) {
		tmp = -x / B;
	} else if (F <= 2.7e-8) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else if (F <= 2.7e+82) {
		tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = (1.0 / B) - t_0
	tmp = 0
	if F <= -18.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -3e-176:
		tmp = t_1
	elif F <= -1.05e-200:
		tmp = -x / B
	elif F <= 2.7e-8:
		tmp = ((F / B) * (1.0 / F)) - t_0
	elif F <= 2.7e+82:
		tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B)
	else:
		tmp = t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(Float64(1.0 / B) - t_0)
	tmp = 0.0
	if (F <= -18.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -3e-176)
		tmp = t_1;
	elseif (F <= -1.05e-200)
		tmp = Float64(Float64(-x) / B);
	elseif (F <= 2.7e-8)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - t_0);
	elseif (F <= 2.7e+82)
		tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	t_1 = (1.0 / B) - t_0;
	tmp = 0.0;
	if (F <= -18.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -3e-176)
		tmp = t_1;
	elseif (F <= -1.05e-200)
		tmp = -x / B;
	elseif (F <= 2.7e-8)
		tmp = ((F / B) * (1.0 / F)) - t_0;
	elseif (F <= 2.7e+82)
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -18.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3e-176], t$95$1, If[LessEqual[F, -1.05e-200], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 2.7e-8], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.7e+82], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{B} - t_0\\
\mathbf{if}\;F \leq -18:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -3 \cdot 10^{-176}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -1.05 \cdot 10^{-200}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;F \leq 2.7 \cdot 10^{-8}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\

\mathbf{elif}\;F \leq 2.7 \cdot 10^{+82}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -18

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.9%

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

    if -18 < F < -3e-176 or 2.6999999999999999e82 < F

    1. Initial program 65.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. Taylor expanded in F around inf 60.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 55.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative55.6%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. *-un-lft-identity55.6%

        \[\leadsto \color{blue}{1 \cdot \left(\frac{F}{B} \cdot \frac{1}{F}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      3. fma-def55.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{F}{B} \cdot \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. associate-*l/71.6%

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{F \cdot \frac{1}{F}}{B}}, -x \cdot \frac{1}{\tan B}\right) \]
      5. pow171.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{1}} \cdot \frac{1}{F}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      6. inv-pow71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{1} \cdot \color{blue}{{F}^{-1}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      7. pow-prod-up71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{\color{blue}{0}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{1}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      10. un-div-inv71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr71.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{1}{B}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef71.6%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg71.6%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} - \frac{x}{\tan B}} \]
      3. *-lft-identity71.6%

        \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    7. Simplified71.6%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{\tan B}} \]

    if -3e-176 < F < -1.05e-200

    1. Initial program 99.2%

      \[\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. Step-by-step derivation
      1. distribute-lft-neg-in99.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.2%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 84.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg84.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/84.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in84.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified84.5%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/84.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-184.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified84.5%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if -1.05e-200 < F < 2.70000000000000002e-8

    1. Initial program 99.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. Taylor expanded in F around inf 38.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 59.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative59.6%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. un-div-inv59.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr59.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef59.6%

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

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}} \]
      3. times-frac44.4%

        \[\leadsto \color{blue}{\frac{F \cdot 1}{B \cdot F}} - \frac{x}{\tan B} \]
      4. *-rgt-identity44.4%

        \[\leadsto \frac{\color{blue}{F}}{B \cdot F} - \frac{x}{\tan B} \]
      5. *-commutative44.4%

        \[\leadsto \frac{F}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    7. Simplified44.4%

      \[\leadsto \color{blue}{\frac{F}{F \cdot B} - \frac{x}{\tan B}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity44.4%

        \[\leadsto \frac{\color{blue}{1 \cdot F}}{F \cdot B} - \frac{x}{\tan B} \]
      2. times-frac59.6%

        \[\leadsto \color{blue}{\frac{1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
    9. Applied egg-rr59.6%

      \[\leadsto \color{blue}{\frac{1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if 2.70000000000000002e-8 < F < 2.6999999999999999e82

    1. Initial program 99.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. Taylor expanded in F around inf 83.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 76.8%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification71.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -18:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-176}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{-200}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-8}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 17: 66.9% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.6 \cdot 10^{-281}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-248}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.205:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)))
   (if (<= F -8.8e-11)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -6.6e-281)
       t_0
       (if (<= F 1.8e-248)
         (- (* (/ F B) (/ 1.0 F)) (/ x (tan B)))
         (if (<= F 0.205) t_0 (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -6.6e-281) {
		tmp = t_0;
	} else if (F <= 1.8e-248) {
		tmp = ((F / B) * (1.0 / F)) - (x / tan(B));
	} else if (F <= 0.205) {
		tmp = t_0;
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    if (f <= (-8.8d-11)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-6.6d-281)) then
        tmp = t_0
    else if (f <= 1.8d-248) then
        tmp = ((f / b) * (1.0d0 / f)) - (x / tan(b))
    else if (f <= 0.205d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -6.6e-281) {
		tmp = t_0;
	} else if (F <= 1.8e-248) {
		tmp = ((F / B) * (1.0 / F)) - (x / Math.tan(B));
	} else if (F <= 0.205) {
		tmp = t_0;
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	tmp = 0
	if F <= -8.8e-11:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -6.6e-281:
		tmp = t_0
	elif F <= 1.8e-248:
		tmp = ((F / B) * (1.0 / F)) - (x / math.tan(B))
	elif F <= 0.205:
		tmp = t_0
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B)
	tmp = 0.0
	if (F <= -8.8e-11)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -6.6e-281)
		tmp = t_0;
	elseif (F <= 1.8e-248)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - Float64(x / tan(B)));
	elseif (F <= 0.205)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	tmp = 0.0;
	if (F <= -8.8e-11)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -6.6e-281)
		tmp = t_0;
	elseif (F <= 1.8e-248)
		tmp = ((F / B) * (1.0 / F)) - (x / tan(B));
	elseif (F <= 0.205)
		tmp = t_0;
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -8.8e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.6e-281], t$95$0, If[LessEqual[F, 1.8e-248], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.205], t$95$0, N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -6.6 \cdot 10^{-281}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.8 \cdot 10^{-248}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 0.205:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -8.8000000000000006e-11

    1. Initial program 69.9%

      \[\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 in F around -inf 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 76.9%

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

    if -8.8000000000000006e-11 < F < -6.5999999999999998e-281 or 1.79999999999999992e-248 < F < 0.204999999999999988

    1. Initial program 99.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 in F around 0 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    3. Taylor expanded in B around 0 61.7%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]

    if -6.5999999999999998e-281 < F < 1.79999999999999992e-248

    1. Initial program 99.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. Taylor expanded in F around inf 41.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 81.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative81.2%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. fma-def81.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. un-div-inv81.1%

        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr81.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef81.1%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg81.1%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}} \]
      3. times-frac67.7%

        \[\leadsto \color{blue}{\frac{F \cdot 1}{B \cdot F}} - \frac{x}{\tan B} \]
      4. *-rgt-identity67.7%

        \[\leadsto \frac{\color{blue}{F}}{B \cdot F} - \frac{x}{\tan B} \]
      5. *-commutative67.7%

        \[\leadsto \frac{F}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    7. Simplified67.7%

      \[\leadsto \color{blue}{\frac{F}{F \cdot B} - \frac{x}{\tan B}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity67.7%

        \[\leadsto \frac{\color{blue}{1 \cdot F}}{F \cdot B} - \frac{x}{\tan B} \]
      2. times-frac81.1%

        \[\leadsto \color{blue}{\frac{1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
    9. Applied egg-rr81.1%

      \[\leadsto \color{blue}{\frac{1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if 0.204999999999999988 < F

    1. Initial program 53.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 in F around inf 76.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times99.1%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num99.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity99.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr99.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 85.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\frac{\sin B \cdot F}{F}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.6 \cdot 10^{-281}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-248}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.205:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 18: 67.0% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.6 \cdot 10^{-281}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-238}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\ \mathbf{elif}\;F \leq 0.44:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)))
   (if (<= F -8.8e-11)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -6.6e-281)
       t_0
       (if (<= F 6.6e-238)
         (+ (* x (/ -1.0 (tan B))) (* (/ F B) (/ 1.0 F)))
         (if (<= F 0.44) t_0 (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -6.6e-281) {
		tmp = t_0;
	} else if (F <= 6.6e-238) {
		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / F));
	} else if (F <= 0.44) {
		tmp = t_0;
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    if (f <= (-8.8d-11)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-6.6d-281)) then
        tmp = t_0
    else if (f <= 6.6d-238) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * (1.0d0 / f))
    else if (f <= 0.44d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -6.6e-281) {
		tmp = t_0;
	} else if (F <= 6.6e-238) {
		tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * (1.0 / F));
	} else if (F <= 0.44) {
		tmp = t_0;
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	tmp = 0
	if F <= -8.8e-11:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -6.6e-281:
		tmp = t_0
	elif F <= 6.6e-238:
		tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * (1.0 / F))
	elif F <= 0.44:
		tmp = t_0
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B)
	tmp = 0.0
	if (F <= -8.8e-11)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -6.6e-281)
		tmp = t_0;
	elseif (F <= 6.6e-238)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / F)));
	elseif (F <= 0.44)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	tmp = 0.0;
	if (F <= -8.8e-11)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -6.6e-281)
		tmp = t_0;
	elseif (F <= 6.6e-238)
		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / F));
	elseif (F <= 0.44)
		tmp = t_0;
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -8.8e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.6e-281], t$95$0, If[LessEqual[F, 6.6e-238], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.44], t$95$0, N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -6.6 \cdot 10^{-281}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 6.6 \cdot 10^{-238}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\

\mathbf{elif}\;F \leq 0.44:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -8.8000000000000006e-11

    1. Initial program 69.9%

      \[\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 in F around -inf 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 76.9%

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

    if -8.8000000000000006e-11 < F < -6.5999999999999998e-281 or 6.59999999999999939e-238 < F < 0.440000000000000002

    1. Initial program 99.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 in F around 0 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    3. Taylor expanded in B around 0 61.7%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]

    if -6.5999999999999998e-281 < F < 6.59999999999999939e-238

    1. Initial program 99.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. Taylor expanded in F around inf 41.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 81.2%

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

    if 0.440000000000000002 < F

    1. Initial program 53.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 in F around inf 76.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times99.1%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num99.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity99.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr99.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 85.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\frac{\sin B \cdot F}{F}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.6 \cdot 10^{-281}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-238}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\ \mathbf{elif}\;F \leq 0.44:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 19: 66.9% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{-281}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-243}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 0.195:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)))
   (if (<= F -8.8e-11)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -6.5e-281)
       t_0
       (if (<= F 1.55e-243)
         (- (* (/ F B) (/ 1.0 F)) (/ 1.0 (/ (tan B) x)))
         (if (<= F 0.195) t_0 (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -6.5e-281) {
		tmp = t_0;
	} else if (F <= 1.55e-243) {
		tmp = ((F / B) * (1.0 / F)) - (1.0 / (tan(B) / x));
	} else if (F <= 0.195) {
		tmp = t_0;
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    if (f <= (-8.8d-11)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-6.5d-281)) then
        tmp = t_0
    else if (f <= 1.55d-243) then
        tmp = ((f / b) * (1.0d0 / f)) - (1.0d0 / (tan(b) / x))
    else if (f <= 0.195d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -8.8e-11) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -6.5e-281) {
		tmp = t_0;
	} else if (F <= 1.55e-243) {
		tmp = ((F / B) * (1.0 / F)) - (1.0 / (Math.tan(B) / x));
	} else if (F <= 0.195) {
		tmp = t_0;
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	tmp = 0
	if F <= -8.8e-11:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -6.5e-281:
		tmp = t_0
	elif F <= 1.55e-243:
		tmp = ((F / B) * (1.0 / F)) - (1.0 / (math.tan(B) / x))
	elif F <= 0.195:
		tmp = t_0
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B)
	tmp = 0.0
	if (F <= -8.8e-11)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -6.5e-281)
		tmp = t_0;
	elseif (F <= 1.55e-243)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - Float64(1.0 / Float64(tan(B) / x)));
	elseif (F <= 0.195)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	tmp = 0.0;
	if (F <= -8.8e-11)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -6.5e-281)
		tmp = t_0;
	elseif (F <= 1.55e-243)
		tmp = ((F / B) * (1.0 / F)) - (1.0 / (tan(B) / x));
	elseif (F <= 0.195)
		tmp = t_0;
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -8.8e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.5e-281], t$95$0, If[LessEqual[F, 1.55e-243], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.195], t$95$0, N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -6.5 \cdot 10^{-281}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.55 \cdot 10^{-243}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 0.195:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -8.8000000000000006e-11

    1. Initial program 69.9%

      \[\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 in F around -inf 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 76.9%

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

    if -8.8000000000000006e-11 < F < -6.5e-281 or 1.55e-243 < F < 0.19500000000000001

    1. Initial program 99.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 in F around 0 98.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    3. Taylor expanded in B around 0 61.7%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]

    if -6.5e-281 < F < 1.55e-243

    1. Initial program 99.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. Taylor expanded in F around inf 41.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 81.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. div-inv81.1%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{B} \cdot \frac{1}{F} \]
      2. clear-num81.4%

        \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{B} \cdot \frac{1}{F} \]
    5. Applied egg-rr81.4%

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

    if 0.19500000000000001 < F

    1. Initial program 53.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 in F around inf 76.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times99.1%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num99.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity99.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr99.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 85.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\frac{\sin B \cdot F}{F}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{-281}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-243}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 0.195:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 20: 62.0% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{1}{B} - t_0\\ \mathbf{if}\;F \leq -0.08:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{-176}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-197}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 20500:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+86}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))) (t_1 (- (/ 1.0 B) t_0)))
   (if (<= F -0.08)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -2.8e-176)
       t_1
       (if (<= F -1.6e-197)
         (/ (- x) B)
         (if (<= F 20500.0)
           (- (* (/ F B) (/ 1.0 F)) t_0)
           (if (<= F 9e+86) (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = (1.0 / B) - t_0;
	double tmp;
	if (F <= -0.08) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -2.8e-176) {
		tmp = t_1;
	} else if (F <= -1.6e-197) {
		tmp = -x / B;
	} else if (F <= 20500.0) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else if (F <= 9e+86) {
		tmp = 1.0 / sin(B);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = (1.0d0 / b) - t_0
    if (f <= (-0.08d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-2.8d-176)) then
        tmp = t_1
    else if (f <= (-1.6d-197)) then
        tmp = -x / b
    else if (f <= 20500.0d0) then
        tmp = ((f / b) * (1.0d0 / f)) - t_0
    else if (f <= 9d+86) then
        tmp = 1.0d0 / sin(b)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double t_1 = (1.0 / B) - t_0;
	double tmp;
	if (F <= -0.08) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -2.8e-176) {
		tmp = t_1;
	} else if (F <= -1.6e-197) {
		tmp = -x / B;
	} else if (F <= 20500.0) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else if (F <= 9e+86) {
		tmp = 1.0 / Math.sin(B);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = (1.0 / B) - t_0
	tmp = 0
	if F <= -0.08:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -2.8e-176:
		tmp = t_1
	elif F <= -1.6e-197:
		tmp = -x / B
	elif F <= 20500.0:
		tmp = ((F / B) * (1.0 / F)) - t_0
	elif F <= 9e+86:
		tmp = 1.0 / math.sin(B)
	else:
		tmp = t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(Float64(1.0 / B) - t_0)
	tmp = 0.0
	if (F <= -0.08)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -2.8e-176)
		tmp = t_1;
	elseif (F <= -1.6e-197)
		tmp = Float64(Float64(-x) / B);
	elseif (F <= 20500.0)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - t_0);
	elseif (F <= 9e+86)
		tmp = Float64(1.0 / sin(B));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	t_1 = (1.0 / B) - t_0;
	tmp = 0.0;
	if (F <= -0.08)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -2.8e-176)
		tmp = t_1;
	elseif (F <= -1.6e-197)
		tmp = -x / B;
	elseif (F <= 20500.0)
		tmp = ((F / B) * (1.0 / F)) - t_0;
	elseif (F <= 9e+86)
		tmp = 1.0 / sin(B);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -0.08], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.8e-176], t$95$1, If[LessEqual[F, -1.6e-197], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 20500.0], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 9e+86], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{B} - t_0\\
\mathbf{if}\;F \leq -0.08:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.8 \cdot 10^{-176}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -1.6 \cdot 10^{-197}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;F \leq 20500:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\

\mathbf{elif}\;F \leq 9 \cdot 10^{+86}:\\
\;\;\;\;\frac{1}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -0.0800000000000000017

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.9%

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

    if -0.0800000000000000017 < F < -2.8000000000000001e-176 or 8.99999999999999986e86 < F

    1. Initial program 65.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. Taylor expanded in F around inf 60.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 55.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative55.6%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. *-un-lft-identity55.6%

        \[\leadsto \color{blue}{1 \cdot \left(\frac{F}{B} \cdot \frac{1}{F}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      3. fma-def55.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{F}{B} \cdot \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. associate-*l/71.6%

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{F \cdot \frac{1}{F}}{B}}, -x \cdot \frac{1}{\tan B}\right) \]
      5. pow171.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{1}} \cdot \frac{1}{F}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      6. inv-pow71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{1} \cdot \color{blue}{{F}^{-1}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      7. pow-prod-up71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{\color{blue}{0}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{1}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      10. un-div-inv71.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr71.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{1}{B}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef71.6%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg71.6%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} - \frac{x}{\tan B}} \]
      3. *-lft-identity71.6%

        \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    7. Simplified71.6%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{\tan B}} \]

    if -2.8000000000000001e-176 < F < -1.5999999999999999e-197

    1. Initial program 99.2%

      \[\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. Step-by-step derivation
      1. distribute-lft-neg-in99.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.2%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 84.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg84.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/84.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in84.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified84.5%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/84.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-184.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified84.5%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if -1.5999999999999999e-197 < F < 20500

    1. Initial program 99.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 in F around inf 38.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 58.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative58.0%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. fma-def58.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. un-div-inv58.1%

        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr58.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef58.1%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg58.1%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}} \]
      3. times-frac43.8%

        \[\leadsto \color{blue}{\frac{F \cdot 1}{B \cdot F}} - \frac{x}{\tan B} \]
      4. *-rgt-identity43.8%

        \[\leadsto \frac{\color{blue}{F}}{B \cdot F} - \frac{x}{\tan B} \]
      5. *-commutative43.8%

        \[\leadsto \frac{F}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    7. Simplified43.8%

      \[\leadsto \color{blue}{\frac{F}{F \cdot B} - \frac{x}{\tan B}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity43.8%

        \[\leadsto \frac{\color{blue}{1 \cdot F}}{F \cdot B} - \frac{x}{\tan B} \]
      2. times-frac58.1%

        \[\leadsto \color{blue}{\frac{1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
    9. Applied egg-rr58.1%

      \[\leadsto \color{blue}{\frac{1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if 20500 < F < 8.99999999999999986e86

    1. Initial program 99.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. Taylor expanded in F around inf 96.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 64.3%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    4. Taylor expanded in x around 0 82.1%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification70.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.08:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{-176}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-197}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 20500:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+86}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 21: 64.1% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.2:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.6 \cdot 10^{-174}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-198}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-8}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.2)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -5.6e-174)
       (- (/ 1.0 B) t_0)
       (if (<= F -2.3e-198)
         (/ (- x) B)
         (if (<= F 2.7e-8)
           (- (* (/ F B) (/ 1.0 F)) t_0)
           (- (/ 1.0 (/ (* F (sin B)) F)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.2) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -5.6e-174) {
		tmp = (1.0 / B) - t_0;
	} else if (F <= -2.3e-198) {
		tmp = -x / B;
	} else if (F <= 2.7e-8) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else {
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-1.2d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-5.6d-174)) then
        tmp = (1.0d0 / b) - t_0
    else if (f <= (-2.3d-198)) then
        tmp = -x / b
    else if (f <= 2.7d-8) then
        tmp = ((f / b) * (1.0d0 / f)) - t_0
    else
        tmp = (1.0d0 / ((f * sin(b)) / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -1.2) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -5.6e-174) {
		tmp = (1.0 / B) - t_0;
	} else if (F <= -2.3e-198) {
		tmp = -x / B;
	} else if (F <= 2.7e-8) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else {
		tmp = (1.0 / ((F * Math.sin(B)) / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.2:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -5.6e-174:
		tmp = (1.0 / B) - t_0
	elif F <= -2.3e-198:
		tmp = -x / B
	elif F <= 2.7e-8:
		tmp = ((F / B) * (1.0 / F)) - t_0
	else:
		tmp = (1.0 / ((F * math.sin(B)) / F)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.2)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -5.6e-174)
		tmp = Float64(Float64(1.0 / B) - t_0);
	elseif (F <= -2.3e-198)
		tmp = Float64(Float64(-x) / B);
	elseif (F <= 2.7e-8)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - t_0);
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(F * sin(B)) / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.2)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -5.6e-174)
		tmp = (1.0 / B) - t_0;
	elseif (F <= -2.3e-198)
		tmp = -x / B;
	elseif (F <= 2.7e-8)
		tmp = ((F / B) * (1.0 / F)) - t_0;
	else
		tmp = (1.0 / ((F * sin(B)) / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.6e-174], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.3e-198], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 2.7e-8], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[(N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.2:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -5.6 \cdot 10^{-174}:\\
\;\;\;\;\frac{1}{B} - t_0\\

\mathbf{elif}\;F \leq -2.3 \cdot 10^{-198}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;F \leq 2.7 \cdot 10^{-8}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -1.19999999999999996

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.9%

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

    if -1.19999999999999996 < F < -5.59999999999999998e-174

    1. Initial program 99.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 in F around inf 46.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 55.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative55.9%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. *-un-lft-identity55.9%

        \[\leadsto \color{blue}{1 \cdot \left(\frac{F}{B} \cdot \frac{1}{F}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      3. fma-def55.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{F}{B} \cdot \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. associate-*l/55.9%

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{F \cdot \frac{1}{F}}{B}}, -x \cdot \frac{1}{\tan B}\right) \]
      5. pow155.9%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{1}} \cdot \frac{1}{F}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      6. inv-pow55.9%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{1} \cdot \color{blue}{{F}^{-1}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      7. pow-prod-up55.9%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval55.9%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{\color{blue}{0}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval55.9%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{1}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      10. un-div-inv55.9%

        \[\leadsto \mathsf{fma}\left(1, \frac{1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr55.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{1}{B}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef55.9%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg55.9%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} - \frac{x}{\tan B}} \]
      3. *-lft-identity55.9%

        \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    7. Simplified55.9%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{\tan B}} \]

    if -5.59999999999999998e-174 < F < -2.30000000000000013e-198

    1. Initial program 99.2%

      \[\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. Step-by-step derivation
      1. distribute-lft-neg-in99.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.2%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 84.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg84.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/84.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in84.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified84.5%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/84.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-184.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified84.5%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if -2.30000000000000013e-198 < F < 2.70000000000000002e-8

    1. Initial program 99.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. Taylor expanded in F around inf 38.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 59.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative59.6%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. un-div-inv59.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr59.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{1}{F}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef59.6%

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

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}} \]
      3. times-frac44.4%

        \[\leadsto \color{blue}{\frac{F \cdot 1}{B \cdot F}} - \frac{x}{\tan B} \]
      4. *-rgt-identity44.4%

        \[\leadsto \frac{\color{blue}{F}}{B \cdot F} - \frac{x}{\tan B} \]
      5. *-commutative44.4%

        \[\leadsto \frac{F}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    7. Simplified44.4%

      \[\leadsto \color{blue}{\frac{F}{F \cdot B} - \frac{x}{\tan B}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity44.4%

        \[\leadsto \frac{\color{blue}{1 \cdot F}}{F \cdot B} - \frac{x}{\tan B} \]
      2. times-frac59.6%

        \[\leadsto \color{blue}{\frac{1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
    9. Applied egg-rr59.6%

      \[\leadsto \color{blue}{\frac{1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if 2.70000000000000002e-8 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. frac-times95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot 1}{\sin B \cdot F}} \]
      2. metadata-eval95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \color{blue}{\frac{1}{1}}}{\sin B \cdot F} \]
      3. div-inv95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F}{1}}}{\sin B \cdot F} \]
      4. clear-num95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{\frac{F}{1}}}} \]
      5. /-rgt-identity95.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B \cdot F}{\color{blue}{F}}} \]
    4. Applied egg-rr95.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot F}{F}}} \]
    5. Taylor expanded in B around 0 82.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.2:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.6 \cdot 10^{-174}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-198}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-8}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{F \cdot \sin B}{F}} - \frac{x}{B}\\ \end{array} \]

Alternative 22: 61.1% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.19:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-176}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -8 \cdot 10^{-200}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 0.175 \lor \neg \left(F \leq 5.9 \cdot 10^{+87}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ 1.0 B) (/ x (tan B)))))
   (if (<= F -0.19)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -4.2e-176)
       t_0
       (if (<= F -8e-200)
         (/ (- x) B)
         (if (or (<= F 0.175) (not (<= F 5.9e+87))) t_0 (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
	double t_0 = (1.0 / B) - (x / tan(B));
	double tmp;
	if (F <= -0.19) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -4.2e-176) {
		tmp = t_0;
	} else if (F <= -8e-200) {
		tmp = -x / B;
	} else if ((F <= 0.175) || !(F <= 5.9e+87)) {
		tmp = t_0;
	} else {
		tmp = 1.0 / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (1.0d0 / b) - (x / tan(b))
    if (f <= (-0.19d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-4.2d-176)) then
        tmp = t_0
    else if (f <= (-8d-200)) then
        tmp = -x / b
    else if ((f <= 0.175d0) .or. (.not. (f <= 5.9d+87))) then
        tmp = t_0
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (1.0 / B) - (x / Math.tan(B));
	double tmp;
	if (F <= -0.19) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -4.2e-176) {
		tmp = t_0;
	} else if (F <= -8e-200) {
		tmp = -x / B;
	} else if ((F <= 0.175) || !(F <= 5.9e+87)) {
		tmp = t_0;
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (1.0 / B) - (x / math.tan(B))
	tmp = 0
	if F <= -0.19:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -4.2e-176:
		tmp = t_0
	elif F <= -8e-200:
		tmp = -x / B
	elif (F <= 0.175) or not (F <= 5.9e+87):
		tmp = t_0
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(1.0 / B) - Float64(x / tan(B)))
	tmp = 0.0
	if (F <= -0.19)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -4.2e-176)
		tmp = t_0;
	elseif (F <= -8e-200)
		tmp = Float64(Float64(-x) / B);
	elseif ((F <= 0.175) || !(F <= 5.9e+87))
		tmp = t_0;
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (1.0 / B) - (x / tan(B));
	tmp = 0.0;
	if (F <= -0.19)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -4.2e-176)
		tmp = t_0;
	elseif (F <= -8e-200)
		tmp = -x / B;
	elseif ((F <= 0.175) || ~((F <= 5.9e+87)))
		tmp = t_0;
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.2e-176], t$95$0, If[LessEqual[F, -8e-200], N[((-x) / B), $MachinePrecision], If[Or[LessEqual[F, 0.175], N[Not[LessEqual[F, 5.9e+87]], $MachinePrecision]], t$95$0, N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.19:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -4.2 \cdot 10^{-176}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -8 \cdot 10^{-200}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;F \leq 0.175 \lor \neg \left(F \leq 5.9 \cdot 10^{+87}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -0.19

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.9%

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

    if -0.19 < F < -4.19999999999999984e-176 or -7.9999999999999999e-200 < F < 0.17499999999999999 or 5.8999999999999997e87 < F

    1. Initial program 79.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. Taylor expanded in F around inf 51.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 56.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative56.9%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. *-un-lft-identity56.9%

        \[\leadsto \color{blue}{1 \cdot \left(\frac{F}{B} \cdot \frac{1}{F}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      3. fma-def56.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{F}{B} \cdot \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. associate-*l/65.6%

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{F \cdot \frac{1}{F}}{B}}, -x \cdot \frac{1}{\tan B}\right) \]
      5. pow165.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{1}} \cdot \frac{1}{F}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      6. inv-pow65.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{1} \cdot \color{blue}{{F}^{-1}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      7. pow-prod-up65.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval65.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{\color{blue}{0}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval65.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{1}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      10. un-div-inv65.7%

        \[\leadsto \mathsf{fma}\left(1, \frac{1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr65.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{1}{B}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef65.7%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg65.7%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} - \frac{x}{\tan B}} \]
      3. *-lft-identity65.7%

        \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    7. Simplified65.7%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{\tan B}} \]

    if -4.19999999999999984e-176 < F < -7.9999999999999999e-200

    1. Initial program 99.2%

      \[\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. Step-by-step derivation
      1. distribute-lft-neg-in99.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.2%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 84.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg84.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/84.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in84.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified84.5%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/84.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-184.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified84.5%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 0.17499999999999999 < F < 5.8999999999999997e87

    1. Initial program 99.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. Taylor expanded in F around inf 91.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 61.1%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    4. Taylor expanded in x around 0 77.7%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification70.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.19:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-176}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8 \cdot 10^{-200}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 0.175 \lor \neg \left(F \leq 5.9 \cdot 10^{+87}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]

Alternative 23: 55.6% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;x \leq -1.3 \cdot 10^{-146}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-137}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;x \leq 8.6 \cdot 10^{-82} \lor \neg \left(x \leq 1.15 \cdot 10^{-18}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ 1.0 B) (/ x (tan B)))))
   (if (<= x -1.3e-146)
     t_0
     (if (<= x 9e-137)
       (/ -1.0 (sin B))
       (if (or (<= x 8.6e-82) (not (<= x 1.15e-18)))
         t_0
         (- (/ (- x) B) (* B (* x -0.3333333333333333))))))))
double code(double F, double B, double x) {
	double t_0 = (1.0 / B) - (x / tan(B));
	double tmp;
	if (x <= -1.3e-146) {
		tmp = t_0;
	} else if (x <= 9e-137) {
		tmp = -1.0 / sin(B);
	} else if ((x <= 8.6e-82) || !(x <= 1.15e-18)) {
		tmp = t_0;
	} else {
		tmp = (-x / B) - (B * (x * -0.3333333333333333));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (1.0d0 / b) - (x / tan(b))
    if (x <= (-1.3d-146)) then
        tmp = t_0
    else if (x <= 9d-137) then
        tmp = (-1.0d0) / sin(b)
    else if ((x <= 8.6d-82) .or. (.not. (x <= 1.15d-18))) then
        tmp = t_0
    else
        tmp = (-x / b) - (b * (x * (-0.3333333333333333d0)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (1.0 / B) - (x / Math.tan(B));
	double tmp;
	if (x <= -1.3e-146) {
		tmp = t_0;
	} else if (x <= 9e-137) {
		tmp = -1.0 / Math.sin(B);
	} else if ((x <= 8.6e-82) || !(x <= 1.15e-18)) {
		tmp = t_0;
	} else {
		tmp = (-x / B) - (B * (x * -0.3333333333333333));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (1.0 / B) - (x / math.tan(B))
	tmp = 0
	if x <= -1.3e-146:
		tmp = t_0
	elif x <= 9e-137:
		tmp = -1.0 / math.sin(B)
	elif (x <= 8.6e-82) or not (x <= 1.15e-18):
		tmp = t_0
	else:
		tmp = (-x / B) - (B * (x * -0.3333333333333333))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(1.0 / B) - Float64(x / tan(B)))
	tmp = 0.0
	if (x <= -1.3e-146)
		tmp = t_0;
	elseif (x <= 9e-137)
		tmp = Float64(-1.0 / sin(B));
	elseif ((x <= 8.6e-82) || !(x <= 1.15e-18))
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(-x) / B) - Float64(B * Float64(x * -0.3333333333333333)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (1.0 / B) - (x / tan(B));
	tmp = 0.0;
	if (x <= -1.3e-146)
		tmp = t_0;
	elseif (x <= 9e-137)
		tmp = -1.0 / sin(B);
	elseif ((x <= 8.6e-82) || ~((x <= 1.15e-18)))
		tmp = t_0;
	else
		tmp = (-x / B) - (B * (x * -0.3333333333333333));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e-146], t$95$0, If[LessEqual[x, 9e-137], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 8.6e-82], N[Not[LessEqual[x, 1.15e-18]], $MachinePrecision]], t$95$0, N[(N[((-x) / B), $MachinePrecision] - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{-146}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 9 \cdot 10^{-137}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;x \leq 8.6 \cdot 10^{-82} \lor \neg \left(x \leq 1.15 \cdot 10^{-18}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.29999999999999993e-146 or 8.9999999999999994e-137 < x < 8.60000000000000037e-82 or 1.15e-18 < x

    1. Initial program 80.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. Taylor expanded in F around inf 65.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 69.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Step-by-step derivation
      1. +-commutative69.8%

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. *-un-lft-identity69.8%

        \[\leadsto \color{blue}{1 \cdot \left(\frac{F}{B} \cdot \frac{1}{F}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      3. fma-def69.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{F}{B} \cdot \frac{1}{F}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. associate-*l/80.3%

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{F \cdot \frac{1}{F}}{B}}, -x \cdot \frac{1}{\tan B}\right) \]
      5. pow180.3%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{1}} \cdot \frac{1}{F}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      6. inv-pow80.3%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{1} \cdot \color{blue}{{F}^{-1}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      7. pow-prod-up80.3%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval80.3%

        \[\leadsto \mathsf{fma}\left(1, \frac{{F}^{\color{blue}{0}}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval80.3%

        \[\leadsto \mathsf{fma}\left(1, \frac{\color{blue}{1}}{B}, -x \cdot \frac{1}{\tan B}\right) \]
      10. un-div-inv80.4%

        \[\leadsto \mathsf{fma}\left(1, \frac{1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    5. Applied egg-rr80.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{1}{B}, -\frac{x}{\tan B}\right)} \]
    6. Step-by-step derivation
      1. fma-udef80.4%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg80.4%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{B} - \frac{x}{\tan B}} \]
      3. *-lft-identity80.4%

        \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    7. Simplified80.4%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{\tan B}} \]

    if -1.29999999999999993e-146 < x < 8.9999999999999994e-137

    1. Initial program 71.2%

      \[\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 in F around -inf 39.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around 0 39.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if 8.60000000000000037e-82 < x < 1.15e-18

    1. Initial program 85.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. Step-by-step derivation
      1. distribute-lft-neg-in85.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative85.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative85.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def85.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval85.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval85.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/85.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity85.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified85.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 59.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg59.6%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/59.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in59.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified59.5%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 44.7%

      \[\leadsto \color{blue}{-1 \cdot \left(B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)\right) + -1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. distribute-lft-out44.7%

        \[\leadsto \color{blue}{-1 \cdot \left(B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) + \frac{x}{B}\right)} \]
      2. distribute-rgt-out--44.7%

        \[\leadsto -1 \cdot \left(B \cdot \color{blue}{\left(x \cdot \left(-0.5 - -0.16666666666666666\right)\right)} + \frac{x}{B}\right) \]
      3. metadata-eval44.7%

        \[\leadsto -1 \cdot \left(B \cdot \left(x \cdot \color{blue}{-0.3333333333333333}\right) + \frac{x}{B}\right) \]
    9. Simplified44.7%

      \[\leadsto \color{blue}{-1 \cdot \left(B \cdot \left(x \cdot -0.3333333333333333\right) + \frac{x}{B}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{-146}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-137}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;x \leq 8.6 \cdot 10^{-82} \lor \neg \left(x \leq 1.15 \cdot 10^{-18}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \end{array} \]

Alternative 24: 46.1% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.2:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 0.175:\\ \;\;\;\;\cos B \cdot \frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{+83}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot \left(0.16666666666666666 - x \cdot -0.3333333333333333\right)\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.2)
   (/ -1.0 (sin B))
   (if (<= F 0.175)
     (* (cos B) (/ (- x) B))
     (if (<= F 2.3e+83)
       (/ 1.0 (sin B))
       (-
        (+ (/ 1.0 B) (* B (- 0.16666666666666666 (* x -0.3333333333333333))))
        (/ x B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.2) {
		tmp = -1.0 / sin(B);
	} else if (F <= 0.175) {
		tmp = cos(B) * (-x / B);
	} else if (F <= 2.3e+83) {
		tmp = 1.0 / sin(B);
	} else {
		tmp = ((1.0 / B) + (B * (0.16666666666666666 - (x * -0.3333333333333333)))) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.2d0)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 0.175d0) then
        tmp = cos(b) * (-x / b)
    else if (f <= 2.3d+83) then
        tmp = 1.0d0 / sin(b)
    else
        tmp = ((1.0d0 / b) + (b * (0.16666666666666666d0 - (x * (-0.3333333333333333d0))))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.2) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 0.175) {
		tmp = Math.cos(B) * (-x / B);
	} else if (F <= 2.3e+83) {
		tmp = 1.0 / Math.sin(B);
	} else {
		tmp = ((1.0 / B) + (B * (0.16666666666666666 - (x * -0.3333333333333333)))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.2:
		tmp = -1.0 / math.sin(B)
	elif F <= 0.175:
		tmp = math.cos(B) * (-x / B)
	elif F <= 2.3e+83:
		tmp = 1.0 / math.sin(B)
	else:
		tmp = ((1.0 / B) + (B * (0.16666666666666666 - (x * -0.3333333333333333)))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.2)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 0.175)
		tmp = Float64(cos(B) * Float64(Float64(-x) / B));
	elseif (F <= 2.3e+83)
		tmp = Float64(1.0 / sin(B));
	else
		tmp = Float64(Float64(Float64(1.0 / B) + Float64(B * Float64(0.16666666666666666 - Float64(x * -0.3333333333333333)))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.2)
		tmp = -1.0 / sin(B);
	elseif (F <= 0.175)
		tmp = cos(B) * (-x / B);
	elseif (F <= 2.3e+83)
		tmp = 1.0 / sin(B);
	else
		tmp = ((1.0 / B) + (B * (0.16666666666666666 - (x * -0.3333333333333333)))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.2], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.175], N[(N[Cos[B], $MachinePrecision] * N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e+83], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] + N[(B * N[(0.16666666666666666 - N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 0.175:\\
\;\;\;\;\cos B \cdot \frac{-x}{B}\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{+83}:\\
\;\;\;\;\frac{1}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} + B \cdot \left(0.16666666666666666 - x \cdot -0.3333333333333333\right)\right) - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.19999999999999996

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around 0 62.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -1.19999999999999996 < F < 0.17499999999999999

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 72.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg72.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/72.4%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in72.4%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified72.4%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 42.5%

      \[\leadsto \color{blue}{\frac{x}{B}} \cdot \left(-\cos B\right) \]

    if 0.17499999999999999 < F < 2.29999999999999995e83

    1. Initial program 99.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. Taylor expanded in F around inf 91.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 61.1%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    4. Taylor expanded in x around 0 77.7%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]

    if 2.29999999999999995e83 < F

    1. Initial program 42.2%

      \[\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 in F around inf 70.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 43.9%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 67.8%

      \[\leadsto \color{blue}{\left(B \cdot \left(0.16666666666666666 - -0.3333333333333333 \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification55.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.2:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 0.175:\\ \;\;\;\;\cos B \cdot \frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{+83}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot \left(0.16666666666666666 - x \cdot -0.3333333333333333\right)\right) - \frac{x}{B}\\ \end{array} \]

Alternative 25: 46.1% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.1:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 0.145:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{+85}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot \left(0.16666666666666666 - x \cdot -0.3333333333333333\right)\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -7.1)
   (/ -1.0 (sin B))
   (if (<= F 0.145)
     (/ (- x) B)
     (if (<= F 2.8e+85)
       (/ 1.0 (sin B))
       (-
        (+ (/ 1.0 B) (* B (- 0.16666666666666666 (* x -0.3333333333333333))))
        (/ x B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.1) {
		tmp = -1.0 / sin(B);
	} else if (F <= 0.145) {
		tmp = -x / B;
	} else if (F <= 2.8e+85) {
		tmp = 1.0 / sin(B);
	} else {
		tmp = ((1.0 / B) + (B * (0.16666666666666666 - (x * -0.3333333333333333)))) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-7.1d0)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 0.145d0) then
        tmp = -x / b
    else if (f <= 2.8d+85) then
        tmp = 1.0d0 / sin(b)
    else
        tmp = ((1.0d0 / b) + (b * (0.16666666666666666d0 - (x * (-0.3333333333333333d0))))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.1) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 0.145) {
		tmp = -x / B;
	} else if (F <= 2.8e+85) {
		tmp = 1.0 / Math.sin(B);
	} else {
		tmp = ((1.0 / B) + (B * (0.16666666666666666 - (x * -0.3333333333333333)))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -7.1:
		tmp = -1.0 / math.sin(B)
	elif F <= 0.145:
		tmp = -x / B
	elif F <= 2.8e+85:
		tmp = 1.0 / math.sin(B)
	else:
		tmp = ((1.0 / B) + (B * (0.16666666666666666 - (x * -0.3333333333333333)))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -7.1)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 0.145)
		tmp = Float64(Float64(-x) / B);
	elseif (F <= 2.8e+85)
		tmp = Float64(1.0 / sin(B));
	else
		tmp = Float64(Float64(Float64(1.0 / B) + Float64(B * Float64(0.16666666666666666 - Float64(x * -0.3333333333333333)))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -7.1)
		tmp = -1.0 / sin(B);
	elseif (F <= 0.145)
		tmp = -x / B;
	elseif (F <= 2.8e+85)
		tmp = 1.0 / sin(B);
	else
		tmp = ((1.0 / B) + (B * (0.16666666666666666 - (x * -0.3333333333333333)))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -7.1], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.145], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 2.8e+85], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] + N[(B * N[(0.16666666666666666 - N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.1:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 0.145:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;F \leq 2.8 \cdot 10^{+85}:\\
\;\;\;\;\frac{1}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} + B \cdot \left(0.16666666666666666 - x \cdot -0.3333333333333333\right)\right) - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -7.0999999999999996

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around 0 62.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -7.0999999999999996 < F < 0.14499999999999999

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 72.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg72.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/72.4%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in72.4%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified72.4%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 42.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/42.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified42.4%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 0.14499999999999999 < F < 2.7999999999999999e85

    1. Initial program 99.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. Taylor expanded in F around inf 91.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 61.1%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    4. Taylor expanded in x around 0 77.7%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]

    if 2.7999999999999999e85 < F

    1. Initial program 42.2%

      \[\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 in F around inf 70.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 43.9%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 67.8%

      \[\leadsto \color{blue}{\left(B \cdot \left(0.16666666666666666 - -0.3333333333333333 \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification55.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.1:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 0.145:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{+85}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot \left(0.16666666666666666 - x \cdot -0.3333333333333333\right)\right) - \frac{x}{B}\\ \end{array} \]

Alternative 26: 45.8% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.5:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 8.6 \cdot 10^{-14}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.5)
   (/ -1.0 (sin B))
   (if (<= F 8.6e-14)
     (/ (- x) B)
     (- (+ (/ 1.0 B) (* 0.3333333333333333 (* x B))) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5) {
		tmp = -1.0 / sin(B);
	} else if (F <= 8.6e-14) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-5.5d0)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 8.6d-14) then
        tmp = -x / b
    else
        tmp = ((1.0d0 / b) + (0.3333333333333333d0 * (x * b))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 8.6e-14) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.5:
		tmp = -1.0 / math.sin(B)
	elif F <= 8.6e-14:
		tmp = -x / B
	else:
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.5)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 8.6e-14)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(Float64(1.0 / B) + Float64(0.3333333333333333 * Float64(x * B))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.5)
		tmp = -1.0 / sin(B);
	elseif (F <= 8.6e-14)
		tmp = -x / B;
	else
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.5], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.6e-14], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] + N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 8.6 \cdot 10^{-14}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.5

    1. Initial program 67.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. Taylor expanded in F around -inf 99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around 0 62.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -5.5 < F < 8.59999999999999996e-14

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 73.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg73.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/73.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in73.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified73.5%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 42.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/42.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.6%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified42.6%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 8.59999999999999996e-14 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 53.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 62.0%

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 8.6 \cdot 10^{-14}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\ \end{array} \]

Alternative 27: 45.4% accurate, 18.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.9 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-13}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.9e-31)
   (/ (- -1.0 x) B)
   (if (<= F 2.6e-13)
     (/ (- x) B)
     (- (+ (/ 1.0 B) (* 0.3333333333333333 (* x B))) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.9e-31) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.6e-13) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-4.9d-31)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 2.6d-13) then
        tmp = -x / b
    else
        tmp = ((1.0d0 / b) + (0.3333333333333333d0 * (x * b))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.9e-31) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.6e-13) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.9e-31:
		tmp = (-1.0 - x) / B
	elif F <= 2.6e-13:
		tmp = -x / B
	else:
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.9e-31)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 2.6e-13)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(Float64(1.0 / B) + Float64(0.3333333333333333 * Float64(x * B))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4.9e-31)
		tmp = (-1.0 - x) / B;
	elseif (F <= 2.6e-13)
		tmp = -x / B;
	else
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.9e-31], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.6e-13], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] + N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.9 \cdot 10^{-31}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 2.6 \cdot 10^{-13}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.90000000000000023e-31

    1. Initial program 71.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 in F around -inf 95.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 44.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/44.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in44.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval44.7%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-144.7%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified44.7%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -4.90000000000000023e-31 < F < 2.6e-13

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 74.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.9%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/74.9%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in74.9%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified74.9%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 43.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/43.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-143.2%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified43.2%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.6e-13 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 53.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 62.0%

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.9 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-13}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\ \end{array} \]

Alternative 28: 45.4% accurate, 18.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{-37}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-14}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.9e-37)
   (+ (* B (- (* x 0.3333333333333333) 0.16666666666666666)) (/ (- -1.0 x) B))
   (if (<= F 9.6e-14)
     (/ (- x) B)
     (- (+ (/ 1.0 B) (* 0.3333333333333333 (* x B))) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.9e-37) {
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
	} else if (F <= 9.6e-14) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.9d-37)) then
        tmp = (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0)) + (((-1.0d0) - x) / b)
    else if (f <= 9.6d-14) then
        tmp = -x / b
    else
        tmp = ((1.0d0 / b) + (0.3333333333333333d0 * (x * b))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.9e-37) {
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
	} else if (F <= 9.6e-14) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.9e-37:
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B)
	elif F <= 9.6e-14:
		tmp = -x / B
	else:
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.9e-37)
		tmp = Float64(Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666)) + Float64(Float64(-1.0 - x) / B));
	elseif (F <= 9.6e-14)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(Float64(1.0 / B) + Float64(0.3333333333333333 * Float64(x * B))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.9e-37)
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
	elseif (F <= 9.6e-14)
		tmp = -x / B;
	else
		tmp = ((1.0 / B) + (0.3333333333333333 * (x * B))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.9e-37], N[(N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.6e-14], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] + N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.9 \cdot 10^{-37}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 9.6 \cdot 10^{-14}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.9000000000000002e-37

    1. Initial program 72.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 in F around -inf 94.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 43.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + B \cdot \left(0.3333333333333333 \cdot x - 0.16666666666666666\right)} \]

    if -1.9000000000000002e-37 < F < 9.599999999999999e-14

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 74.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.2%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/74.2%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in74.2%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified74.2%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 44.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/44.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-144.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified44.4%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 9.599999999999999e-14 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 53.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 62.0%

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{-37}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-14}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}\\ \end{array} \]

Alternative 29: 45.4% accurate, 21.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.7 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.72 \cdot 10^{-10}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.7e-32)
   (/ (- -1.0 x) B)
   (if (<= F 1.72e-10)
     (/ (- x) B)
     (+ (* 0.3333333333333333 (* x B)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.7e-32) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.72e-10) {
		tmp = -x / B;
	} else {
		tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-4.7d-32)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.72d-10) then
        tmp = -x / b
    else
        tmp = (0.3333333333333333d0 * (x * b)) + ((1.0d0 - x) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.7e-32) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.72e-10) {
		tmp = -x / B;
	} else {
		tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.7e-32:
		tmp = (-1.0 - x) / B
	elif F <= 1.72e-10:
		tmp = -x / B
	else:
		tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.7e-32)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.72e-10)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(0.3333333333333333 * Float64(x * B)) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4.7e-32)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.72e-10)
		tmp = -x / B;
	else
		tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.7e-32], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.72e-10], N[((-x) / B), $MachinePrecision], N[(N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.7 \cdot 10^{-32}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.72 \cdot 10^{-10}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.70000000000000019e-32

    1. Initial program 71.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 in F around -inf 95.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 44.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/44.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in44.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval44.7%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-144.7%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified44.7%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -4.70000000000000019e-32 < F < 1.72000000000000001e-10

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 74.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.9%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/74.9%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in74.9%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified74.9%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 43.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/43.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-143.2%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified43.2%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.72000000000000001e-10 < F

    1. Initial program 55.9%

      \[\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 in F around inf 73.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 53.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 62.0%

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate--l+62.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. div-sub62.0%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\frac{1 - x}{B}} \]
    6. Simplified62.0%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.7 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.72 \cdot 10^{-10}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 30: 45.2% accurate, 29.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.15 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.15e-31)
   (/ (- -1.0 x) B)
   (if (<= F 2.6e-60) (/ (- x) B) (- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.15e-31) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.6e-60) {
		tmp = -x / B;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.15d-31)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 2.6d-60) then
        tmp = -x / b
    else
        tmp = (1.0d0 / b) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.15e-31) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.6e-60) {
		tmp = -x / B;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.15e-31:
		tmp = (-1.0 - x) / B
	elif F <= 2.6e-60:
		tmp = -x / B
	else:
		tmp = (1.0 / B) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.15e-31)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 2.6e-60)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.15e-31)
		tmp = (-1.0 - x) / B;
	elseif (F <= 2.6e-60)
		tmp = -x / B;
	else
		tmp = (1.0 / B) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.15e-31], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.6e-60], N[((-x) / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.15 \cdot 10^{-31}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 2.6 \cdot 10^{-60}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.15e-31

    1. Initial program 71.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 in F around -inf 95.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 44.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/44.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in44.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval44.7%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-144.7%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified44.7%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -2.15e-31 < F < 2.5999999999999998e-60

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 74.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.2%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/74.1%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in74.1%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified74.1%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 42.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/42.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified42.4%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.5999999999999998e-60 < F

    1. Initial program 57.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. Taylor expanded in F around inf 74.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 55.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 61.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    5. Step-by-step derivation
      1. div-sub61.8%

        \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{B}} \]
    6. Applied egg-rr61.8%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.15 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 31: 45.2% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9.5e-32)
   (/ (- -1.0 x) B)
   (if (<= F 3e-60) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-32) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3e-60) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-9.5d-32)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 3d-60) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-32) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3e-60) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -9.5e-32:
		tmp = (-1.0 - x) / B
	elif F <= 3e-60:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -9.5e-32)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 3e-60)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -9.5e-32)
		tmp = (-1.0 - x) / B;
	elseif (F <= 3e-60)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -9.5e-32], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3e-60], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-32}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3 \cdot 10^{-60}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -9.4999999999999999e-32

    1. Initial program 71.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 in F around -inf 95.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 44.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/44.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in44.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval44.7%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-144.7%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified44.7%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -9.4999999999999999e-32 < F < 3.00000000000000019e-60

    1. Initial program 99.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. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 74.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.2%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/74.1%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in74.1%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified74.1%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 42.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/42.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified42.4%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 3.00000000000000019e-60 < F

    1. Initial program 57.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. Taylor expanded in F around inf 74.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 55.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 61.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 32: 31.9% accurate, 39.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-95} \lor \neg \left(x \leq 1.95 \cdot 10^{-82}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -5e-95) (not (<= x 1.95e-82))) (/ (- x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -5e-95) || !(x <= 1.95e-82)) {
		tmp = -x / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-5d-95)) .or. (.not. (x <= 1.95d-82))) then
        tmp = -x / b
    else
        tmp = 1.0d0 / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -5e-95) || !(x <= 1.95e-82)) {
		tmp = -x / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -5e-95) or not (x <= 1.95e-82):
		tmp = -x / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -5e-95) || !(x <= 1.95e-82))
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -5e-95) || ~((x <= 1.95e-82)))
		tmp = -x / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -5e-95], N[Not[LessEqual[x, 1.95e-82]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-95} \lor \neg \left(x \leq 1.95 \cdot 10^{-82}\right):\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.9999999999999998e-95 or 1.94999999999999987e-82 < x

    1. Initial program 82.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. Step-by-step derivation
      1. distribute-lft-neg-in82.6%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative82.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)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def82.6%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative82.6%

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

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def82.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval82.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval82.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/82.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity82.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified82.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 83.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg83.9%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/83.8%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in83.8%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified83.8%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 51.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/51.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-151.7%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified51.7%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if -4.9999999999999998e-95 < x < 1.94999999999999987e-82

    1. Initial program 71.2%

      \[\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 in F around inf 25.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 21.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 17.6%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    5. Taylor expanded in x around 0 17.6%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-95} \lor \neg \left(x \leq 1.95 \cdot 10^{-82}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]

Alternative 33: 37.6% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 3 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 3e-60) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 3e-60) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= 3d-60) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 3e-60) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 3e-60:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 3e-60)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 3e-60)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 3e-60], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 3 \cdot 10^{-60}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 3.00000000000000019e-60

    1. Initial program 87.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. Step-by-step derivation
      1. distribute-lft-neg-in87.0%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative87.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)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def87.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative87.0%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative87.0%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def87.0%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def87.0%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval87.0%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval87.0%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/87.1%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity87.1%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified87.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 59.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg59.2%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/59.2%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in59.2%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified59.2%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 32.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/32.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-132.7%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified32.7%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 3.00000000000000019e-60 < F

    1. Initial program 57.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. Taylor expanded in F around inf 74.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 55.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
    4. Taylor expanded in B around 0 61.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 3 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 34: 10.4% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
	return 1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
	return 1.0 / B;
}
def code(F, B, x):
	return 1.0 / B
function code(F, B, x)
	return Float64(1.0 / B)
end
function tmp = code(F, B, x)
	tmp = 1.0 / B;
end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{B}
\end{array}
Derivation
  1. Initial program 78.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. Taylor expanded in F around inf 47.6%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
  3. Taylor expanded in B around 0 48.8%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
  4. Taylor expanded in B around 0 33.9%

    \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  5. Taylor expanded in x around 0 9.8%

    \[\leadsto \color{blue}{\frac{1}{B}} \]
  6. Final simplification9.8%

    \[\leadsto \frac{1}{B} \]

Reproduce

?
herbie shell --seed 2023313 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  :precision binary64
  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))