VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.0% → 99.6%
Time: 24.6s
Alternatives: 29
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 29 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: 77.0% 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.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -400000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 550000000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\sin B} \cdot \cos B\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -400000000.0)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 550000000000.0)
     (-
      (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
      (* (/ x (sin B)) (cos B)))
     (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -400000000.0) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 550000000000.0) {
		tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x / sin(B)) * cos(B));
	} else {
		tmp = (x * (-1.0 / tan(B))) + (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) :: tmp
    if (f <= (-400000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 550000000000.0d0) then
        tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - ((x / sin(b)) * cos(b))
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -400000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 550000000000.0) {
		tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x / Math.sin(B)) * Math.cos(B));
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -400000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 550000000000.0:
		tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x / math.sin(B)) * math.cos(B))
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -400000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 550000000000.0)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(Float64(x / sin(B)) * cos(B)));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -400000000.0)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 550000000000.0)
		tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - ((x / sin(B)) * cos(B));
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -400000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 550000000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 59.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.7%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    4. Applied egg-rr99.8%

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

    if -4e8 < F < 5.5e11

    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 x around 0 99.5%

      \[\leadsto \left(-\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. associate-/l*99.5%

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

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

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

    if 5.5e11 < F

    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.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -400000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 550000000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\sin B} \cdot \cos B\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\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 -150000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+17}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -150000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1.5e+17)
       (- (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) t_0)
       (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -150000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1.5e+17) {
		tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0;
	} else {
		tmp = (x * (-1.0 / tan(B))) + (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 = x / tan(b)
    if (f <= (-150000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1.5d+17) then
        tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - t_0
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / 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 <= -150000000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1.5e+17) {
		tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0;
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -150000000.0:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1.5e+17:
		tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -150000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1.5e+17)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - t_0);
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -150000000.0)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 1.5e+17)
		tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - t_0;
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / 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, -150000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.5e+17], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 59.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.7%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    4. Applied egg-rr99.8%

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

    if -1.5e8 < F < 1.5e17

    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. Step-by-step derivation
      1. expm1-log1p-u76.3%

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

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{1}{\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)} \]
      3. div-inv60.1%

        \[\leadsto \left(-\left(e^{\mathsf{log1p}\left(\color{blue}{\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)} \]
    3. Applied egg-rr60.1%

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

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p99.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)} \]
    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 1.5e17 < F

    1. Initial program 66.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 99.7%

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

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

Alternative 3: 98.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -0.9:\\ \;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+17}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2 + x \cdot 2}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B)))))
   (if (<= F -0.9)
     (+ t_0 (/ 1.0 (/ (* (sin B) (- (/ -1.0 F) F)) F)))
     (if (<= F 1.5e+17)
       (- (/ (/ F (sin B)) (sqrt (+ 2.0 (* x 2.0)))) (/ x (tan B)))
       (+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double tmp;
	if (F <= -0.9) {
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= 1.5e+17) {
		tmp = ((F / sin(B)) / sqrt((2.0 + (x * 2.0)))) - (x / tan(B));
	} else {
		tmp = t_0 + (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 = x * ((-1.0d0) / tan(b))
    if (f <= (-0.9d0)) then
        tmp = t_0 + (1.0d0 / ((sin(b) * (((-1.0d0) / f) - f)) / f))
    else if (f <= 1.5d+17) then
        tmp = ((f / sin(b)) / sqrt((2.0d0 + (x * 2.0d0)))) - (x / tan(b))
    else
        tmp = t_0 + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / Math.tan(B));
	double tmp;
	if (F <= -0.9) {
		tmp = t_0 + (1.0 / ((Math.sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= 1.5e+17) {
		tmp = ((F / Math.sin(B)) / Math.sqrt((2.0 + (x * 2.0)))) - (x / Math.tan(B));
	} else {
		tmp = t_0 + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	tmp = 0
	if F <= -0.9:
		tmp = t_0 + (1.0 / ((math.sin(B) * ((-1.0 / F) - F)) / F))
	elif F <= 1.5e+17:
		tmp = ((F / math.sin(B)) / math.sqrt((2.0 + (x * 2.0)))) - (x / math.tan(B))
	else:
		tmp = t_0 + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	tmp = 0.0
	if (F <= -0.9)
		tmp = Float64(t_0 + Float64(1.0 / Float64(Float64(sin(B) * Float64(Float64(-1.0 / F) - F)) / F)));
	elseif (F <= 1.5e+17)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(Float64(2.0 + Float64(x * 2.0)))) - Float64(x / tan(B)));
	else
		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	tmp = 0.0;
	if (F <= -0.9)
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	elseif (F <= 1.5e+17)
		tmp = ((F / sin(B)) / sqrt((2.0 + (x * 2.0)))) - (x / tan(B));
	else
		tmp = t_0 + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.9], N[(t$95$0 + N[(1.0 / N[(N[(N[Sin[B], $MachinePrecision] * N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e+17], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -0.9:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\

\mathbf{elif}\;F \leq 1.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2 + x \cdot 2}} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\


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

    1. Initial program 62.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. Step-by-step derivation
      1. associate-/r/73.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\color{blue}{\sin B \cdot \sqrt{2 + {F}^{2}}}}{F}} \]
    5. Step-by-step derivation
      1. +-commutative74.0%

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

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

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

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

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

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

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

    if -0.900000000000000022 < F < 1.5e17

    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 0 98.1%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x \cdot \frac{1}{\tan B}} \]
      3. sqrt-div98.0%

        \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{2 + 2 \cdot x}}} - x \cdot \frac{1}{\tan B} \]
      4. metadata-eval98.0%

        \[\leadsto \frac{F}{\sin B} \cdot \frac{\color{blue}{1}}{\sqrt{2 + 2 \cdot x}} - x \cdot \frac{1}{\tan B} \]
      5. un-div-inv98.0%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sin B}}{\sqrt{2 + 2 \cdot x}}} - x \cdot \frac{1}{\tan B} \]
      6. un-div-inv98.2%

        \[\leadsto \frac{\frac{F}{\sin B}}{\sqrt{2 + 2 \cdot x}} - \color{blue}{\frac{x}{\tan B}} \]
    4. Applied egg-rr98.2%

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

    if 1.5e17 < F

    1. Initial program 66.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 99.7%

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

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

Alternative 4: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -0.9:\\ \;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;t_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B)))))
   (if (<= F -0.9)
     (+ t_0 (/ 1.0 (/ (* (sin B) (- (/ -1.0 F) F)) F)))
     (if (<= F 1.4)
       (+ t_0 (* (/ F (sin B)) (sqrt 0.5)))
       (+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double tmp;
	if (F <= -0.9) {
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= 1.4) {
		tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
	} else {
		tmp = t_0 + (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 = x * ((-1.0d0) / tan(b))
    if (f <= (-0.9d0)) then
        tmp = t_0 + (1.0d0 / ((sin(b) * (((-1.0d0) / f) - f)) / f))
    else if (f <= 1.4d0) then
        tmp = t_0 + ((f / sin(b)) * sqrt(0.5d0))
    else
        tmp = t_0 + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / Math.tan(B));
	double tmp;
	if (F <= -0.9) {
		tmp = t_0 + (1.0 / ((Math.sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= 1.4) {
		tmp = t_0 + ((F / Math.sin(B)) * Math.sqrt(0.5));
	} else {
		tmp = t_0 + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	tmp = 0
	if F <= -0.9:
		tmp = t_0 + (1.0 / ((math.sin(B) * ((-1.0 / F) - F)) / F))
	elif F <= 1.4:
		tmp = t_0 + ((F / math.sin(B)) * math.sqrt(0.5))
	else:
		tmp = t_0 + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	tmp = 0.0
	if (F <= -0.9)
		tmp = Float64(t_0 + Float64(1.0 / Float64(Float64(sin(B) * Float64(Float64(-1.0 / F) - F)) / F)));
	elseif (F <= 1.4)
		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(0.5)));
	else
		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	tmp = 0.0;
	if (F <= -0.9)
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	elseif (F <= 1.4)
		tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
	else
		tmp = t_0 + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.9], N[(t$95$0 + N[(1.0 / N[(N[(N[Sin[B], $MachinePrecision] * N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -0.9:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\

\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\


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

    1. Initial program 62.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. Step-by-step derivation
      1. associate-/r/73.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\color{blue}{\sin B \cdot \sqrt{2 + {F}^{2}}}}{F}} \]
    5. Step-by-step derivation
      1. +-commutative74.0%

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

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

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

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

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

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

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

    if -0.900000000000000022 < F < 1.3999999999999999

    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 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 x around 0 97.9%

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} \]
      2. associate-/r/98.0%

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

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

    if 1.3999999999999999 < F

    1. Initial program 68.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 99.7%

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

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

Alternative 5: 88.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\ \;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{-181}:\\ \;\;\;\;\left(F \cdot t_1\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-184}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 850:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0 + t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B)))) (t_1 (/ 1.0 (sin B))))
   (if (<= F -1.8e-9)
     (+ t_0 (/ 1.0 (/ (* (sin B) (- (/ -1.0 F) F)) F)))
     (if (<= F -1.05e-181)
       (- (* (* F t_1) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
       (if (<= F 1.25e-184)
         (/ (- x) (/ (sin B) (cos B)))
         (if (<= F 850.0)
           (-
            (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
            (/ x B))
           (+ t_0 t_1)))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double t_1 = 1.0 / sin(B);
	double tmp;
	if (F <= -1.8e-9) {
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= -1.05e-181) {
		tmp = ((F * t_1) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	} else if (F <= 1.25e-184) {
		tmp = -x / (sin(B) / cos(B));
	} else if (F <= 850.0) {
		tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
	} else {
		tmp = t_0 + 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 * ((-1.0d0) / tan(b))
    t_1 = 1.0d0 / sin(b)
    if (f <= (-1.8d-9)) then
        tmp = t_0 + (1.0d0 / ((sin(b) * (((-1.0d0) / f) - f)) / f))
    else if (f <= (-1.05d-181)) then
        tmp = ((f * t_1) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
    else if (f <= 1.25d-184) then
        tmp = -x / (sin(b) / cos(b))
    else if (f <= 850.0d0) then
        tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
    else
        tmp = t_0 + t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / Math.tan(B));
	double t_1 = 1.0 / Math.sin(B);
	double tmp;
	if (F <= -1.8e-9) {
		tmp = t_0 + (1.0 / ((Math.sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= -1.05e-181) {
		tmp = ((F * t_1) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	} else if (F <= 1.25e-184) {
		tmp = -x / (Math.sin(B) / Math.cos(B));
	} else if (F <= 850.0) {
		tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
	} else {
		tmp = t_0 + t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	t_1 = 1.0 / math.sin(B)
	tmp = 0
	if F <= -1.8e-9:
		tmp = t_0 + (1.0 / ((math.sin(B) * ((-1.0 / F) - F)) / F))
	elif F <= -1.05e-181:
		tmp = ((F * t_1) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B)
	elif F <= 1.25e-184:
		tmp = -x / (math.sin(B) / math.cos(B))
	elif F <= 850.0:
		tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B)
	else:
		tmp = t_0 + t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	t_1 = Float64(1.0 / sin(B))
	tmp = 0.0
	if (F <= -1.8e-9)
		tmp = Float64(t_0 + Float64(1.0 / Float64(Float64(sin(B) * Float64(Float64(-1.0 / F) - F)) / F)));
	elseif (F <= -1.05e-181)
		tmp = Float64(Float64(Float64(F * t_1) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B));
	elseif (F <= 1.25e-184)
		tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B)));
	elseif (F <= 850.0)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B));
	else
		tmp = Float64(t_0 + t_1);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	t_1 = 1.0 / sin(B);
	tmp = 0.0;
	if (F <= -1.8e-9)
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	elseif (F <= -1.05e-181)
		tmp = ((F * t_1) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	elseif (F <= 1.25e-184)
		tmp = -x / (sin(B) / cos(B));
	elseif (F <= 850.0)
		tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / B);
	else
		tmp = t_0 + t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.8e-9], N[(t$95$0 + N[(1.0 / N[(N[(N[Sin[B], $MachinePrecision] * N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.05e-181], N[(N[(N[(F * t$95$1), $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, 1.25e-184], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 850.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\

\mathbf{elif}\;F \leq -1.05 \cdot 10^{-181}:\\
\;\;\;\;\left(F \cdot t_1\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\

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

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

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. associate-/r/75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8e-9 < F < -1.05000000000000002e-181

    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 82.2%

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

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

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

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

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

    if -1.05000000000000002e-181 < F < 1.25000000000000001e-184

    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 35.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*94.6%

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

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

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

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

    if 1.25000000000000001e-184 < F < 850

    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 83.5%

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

    if 850 < F

    1. Initial program 68.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 99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{-181}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-184}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 850:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 6: 91.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -57:\\ \;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\ \mathbf{elif}\;F \leq 550:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B)))))
   (if (<= F -57.0)
     (+ t_0 (/ 1.0 (/ (* (sin B) (- (/ -1.0 F) F)) F)))
     (if (<= F 550.0)
       (-
        (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
        (* x (/ 1.0 (tan B))))
       (+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double tmp;
	if (F <= -57.0) {
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= 550.0) {
		tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x * (1.0 / tan(B)));
	} else {
		tmp = t_0 + (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 = x * ((-1.0d0) / tan(b))
    if (f <= (-57.0d0)) then
        tmp = t_0 + (1.0d0 / ((sin(b) * (((-1.0d0) / f) - f)) / f))
    else if (f <= 550.0d0) then
        tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x * (1.0d0 / tan(b)))
    else
        tmp = t_0 + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / Math.tan(B));
	double tmp;
	if (F <= -57.0) {
		tmp = t_0 + (1.0 / ((Math.sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= 550.0) {
		tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x * (1.0 / Math.tan(B)));
	} else {
		tmp = t_0 + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	tmp = 0
	if F <= -57.0:
		tmp = t_0 + (1.0 / ((math.sin(B) * ((-1.0 / F) - F)) / F))
	elif F <= 550.0:
		tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x * (1.0 / math.tan(B)))
	else:
		tmp = t_0 + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	tmp = 0.0
	if (F <= -57.0)
		tmp = Float64(t_0 + Float64(1.0 / Float64(Float64(sin(B) * Float64(Float64(-1.0 / F) - F)) / F)));
	elseif (F <= 550.0)
		tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x * Float64(1.0 / tan(B))));
	else
		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	tmp = 0.0;
	if (F <= -57.0)
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	elseif (F <= 550.0)
		tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x * (1.0 / tan(B)));
	else
		tmp = t_0 + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -57.0], N[(t$95$0 + N[(1.0 / N[(N[(N[Sin[B], $MachinePrecision] * N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 550.0], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -57:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\

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

\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\


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

    1. Initial program 62.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. Step-by-step derivation
      1. associate-/r/73.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\color{blue}{\sin B \cdot \sqrt{2 + {F}^{2}}}}{F}} \]
    5. Step-by-step derivation
      1. +-commutative74.0%

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

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

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

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

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

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

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

    if -57 < F < 550

    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 B around 0 83.8%

      \[\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 550 < F

    1. Initial program 68.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 99.7%

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

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

Alternative 7: 88.7% 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 -1.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8.5 \cdot 10^{-182}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-184}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.36:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin 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 -1.8e-9)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F -8.5e-182)
       t_0
       (if (<= F 1.2e-184)
         (/ (- x) (/ (sin B) (cos B)))
         (if (<= F 1.36) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin 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 <= -1.8e-9) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -8.5e-182) {
		tmp = t_0;
	} else if (F <= 1.2e-184) {
		tmp = -x / (sin(B) / cos(B));
	} else if (F <= 1.36) {
		tmp = t_0;
	} else {
		tmp = (x * (-1.0 / tan(B))) + (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 = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
    if (f <= (-1.8d-9)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-8.5d-182)) then
        tmp = t_0
    else if (f <= 1.2d-184) then
        tmp = -x / (sin(b) / cos(b))
    else if (f <= 1.36d0) then
        tmp = t_0
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(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 <= -1.8e-9) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -8.5e-182) {
		tmp = t_0;
	} else if (F <= 1.2e-184) {
		tmp = -x / (Math.sin(B) / Math.cos(B));
	} else if (F <= 1.36) {
		tmp = t_0;
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(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 <= -1.8e-9:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -8.5e-182:
		tmp = t_0
	elif F <= 1.2e-184:
		tmp = -x / (math.sin(B) / math.cos(B))
	elif F <= 1.36:
		tmp = t_0
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(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 <= -1.8e-9)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -8.5e-182)
		tmp = t_0;
	elseif (F <= 1.2e-184)
		tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B)));
	elseif (F <= 1.36)
		tmp = t_0;
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(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 <= -1.8e-9)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -8.5e-182)
		tmp = t_0;
	elseif (F <= 1.2e-184)
		tmp = -x / (sin(B) / cos(B));
	elseif (F <= 1.36)
		tmp = t_0;
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(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, -1.8e-9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.5e-182], t$95$0, If[LessEqual[F, 1.2e-184], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.36], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $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 -1.8 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -8.5 \cdot 10^{-182}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 63.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 97.3%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv97.4%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    4. Applied egg-rr97.4%

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

    if -1.8e-9 < F < -8.5000000000000001e-182 or 1.20000000000000012e-184 < F < 1.3600000000000001

    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 97.1%

      \[\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 80.7%

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

    if -8.5000000000000001e-182 < F < 1.20000000000000012e-184

    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 35.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*94.6%

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

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

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

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

    if 1.3600000000000001 < F

    1. Initial program 68.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 99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8.5 \cdot 10^{-182}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-184}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.36:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 8: 88.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sin B}\\ t_1 := \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-182}:\\ \;\;\;\;\left(F \cdot t_0\right) \cdot t_1 - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.06 \cdot 10^{-184}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.36:\\ \;\;\;\;\frac{F}{\sin B} \cdot t_1 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ 1.0 (sin B))) (t_1 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
   (if (<= F -1.8e-9)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F -9.5e-182)
       (- (* (* F t_0) t_1) (/ x B))
       (if (<= F 1.06e-184)
         (/ (- x) (/ (sin B) (cos B)))
         (if (<= F 1.36)
           (- (* (/ F (sin B)) t_1) (/ x B))
           (+ (* x (/ -1.0 (tan B))) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = 1.0 / sin(B);
	double t_1 = sqrt((1.0 / (2.0 + (x * 2.0))));
	double tmp;
	if (F <= -1.8e-9) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -9.5e-182) {
		tmp = ((F * t_0) * t_1) - (x / B);
	} else if (F <= 1.06e-184) {
		tmp = -x / (sin(B) / cos(B));
	} else if (F <= 1.36) {
		tmp = ((F / sin(B)) * t_1) - (x / B);
	} else {
		tmp = (x * (-1.0 / tan(B))) + t_0;
	}
	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 = 1.0d0 / sin(b)
    t_1 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
    if (f <= (-1.8d-9)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-9.5d-182)) then
        tmp = ((f * t_0) * t_1) - (x / b)
    else if (f <= 1.06d-184) then
        tmp = -x / (sin(b) / cos(b))
    else if (f <= 1.36d0) then
        tmp = ((f / sin(b)) * t_1) - (x / b)
    else
        tmp = (x * ((-1.0d0) / tan(b))) + t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = 1.0 / Math.sin(B);
	double t_1 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
	double tmp;
	if (F <= -1.8e-9) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -9.5e-182) {
		tmp = ((F * t_0) * t_1) - (x / B);
	} else if (F <= 1.06e-184) {
		tmp = -x / (Math.sin(B) / Math.cos(B));
	} else if (F <= 1.36) {
		tmp = ((F / Math.sin(B)) * t_1) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = 1.0 / math.sin(B)
	t_1 = math.sqrt((1.0 / (2.0 + (x * 2.0))))
	tmp = 0
	if F <= -1.8e-9:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -9.5e-182:
		tmp = ((F * t_0) * t_1) - (x / B)
	elif F <= 1.06e-184:
		tmp = -x / (math.sin(B) / math.cos(B))
	elif F <= 1.36:
		tmp = ((F / math.sin(B)) * t_1) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(1.0 / sin(B))
	t_1 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))
	tmp = 0.0
	if (F <= -1.8e-9)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -9.5e-182)
		tmp = Float64(Float64(Float64(F * t_0) * t_1) - Float64(x / B));
	elseif (F <= 1.06e-184)
		tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B)));
	elseif (F <= 1.36)
		tmp = Float64(Float64(Float64(F / sin(B)) * t_1) - Float64(x / B));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = 1.0 / sin(B);
	t_1 = sqrt((1.0 / (2.0 + (x * 2.0))));
	tmp = 0.0;
	if (F <= -1.8e-9)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -9.5e-182)
		tmp = ((F * t_0) * t_1) - (x / B);
	elseif (F <= 1.06e-184)
		tmp = -x / (sin(B) / cos(B));
	elseif (F <= 1.36)
		tmp = ((F / sin(B)) * t_1) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -1.8e-9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.5e-182], N[(N[(N[(F * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.06e-184], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.36], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -9.5 \cdot 10^{-182}:\\
\;\;\;\;\left(F \cdot t_0\right) \cdot t_1 - \frac{x}{B}\\

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

\mathbf{elif}\;F \leq 1.36:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_1 - \frac{x}{B}\\

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


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

    1. Initial program 63.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 97.3%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv97.4%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    4. Applied egg-rr97.4%

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

    if -1.8e-9 < F < -9.4999999999999994e-182

    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 82.2%

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

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

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

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

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

    if -9.4999999999999994e-182 < F < 1.05999999999999995e-184

    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 35.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*94.6%

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

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

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

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

    if 1.05999999999999995e-184 < F < 1.3600000000000001

    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 95.5%

      \[\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 79.5%

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

    if 1.3600000000000001 < F

    1. Initial program 68.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 99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-182}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.06 \cdot 10^{-184}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.36:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 9: 88.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := \frac{1}{\sin B}\\ t_2 := \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\ \;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-182}:\\ \;\;\;\;\left(F \cdot t_1\right) \cdot t_2 - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-185}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.36:\\ \;\;\;\;\frac{F}{\sin B} \cdot t_2 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0 + t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B))))
        (t_1 (/ 1.0 (sin B)))
        (t_2 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
   (if (<= F -1.8e-9)
     (+ t_0 (/ 1.0 (/ (* (sin B) (- (/ -1.0 F) F)) F)))
     (if (<= F -9.5e-182)
       (- (* (* F t_1) t_2) (/ x B))
       (if (<= F 6e-185)
         (/ (- x) (/ (sin B) (cos B)))
         (if (<= F 1.36) (- (* (/ F (sin B)) t_2) (/ x B)) (+ t_0 t_1)))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double t_1 = 1.0 / sin(B);
	double t_2 = sqrt((1.0 / (2.0 + (x * 2.0))));
	double tmp;
	if (F <= -1.8e-9) {
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= -9.5e-182) {
		tmp = ((F * t_1) * t_2) - (x / B);
	} else if (F <= 6e-185) {
		tmp = -x / (sin(B) / cos(B));
	} else if (F <= 1.36) {
		tmp = ((F / sin(B)) * t_2) - (x / B);
	} else {
		tmp = t_0 + 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) :: t_2
    real(8) :: tmp
    t_0 = x * ((-1.0d0) / tan(b))
    t_1 = 1.0d0 / sin(b)
    t_2 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
    if (f <= (-1.8d-9)) then
        tmp = t_0 + (1.0d0 / ((sin(b) * (((-1.0d0) / f) - f)) / f))
    else if (f <= (-9.5d-182)) then
        tmp = ((f * t_1) * t_2) - (x / b)
    else if (f <= 6d-185) then
        tmp = -x / (sin(b) / cos(b))
    else if (f <= 1.36d0) then
        tmp = ((f / sin(b)) * t_2) - (x / b)
    else
        tmp = t_0 + t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / Math.tan(B));
	double t_1 = 1.0 / Math.sin(B);
	double t_2 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
	double tmp;
	if (F <= -1.8e-9) {
		tmp = t_0 + (1.0 / ((Math.sin(B) * ((-1.0 / F) - F)) / F));
	} else if (F <= -9.5e-182) {
		tmp = ((F * t_1) * t_2) - (x / B);
	} else if (F <= 6e-185) {
		tmp = -x / (Math.sin(B) / Math.cos(B));
	} else if (F <= 1.36) {
		tmp = ((F / Math.sin(B)) * t_2) - (x / B);
	} else {
		tmp = t_0 + t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	t_1 = 1.0 / math.sin(B)
	t_2 = math.sqrt((1.0 / (2.0 + (x * 2.0))))
	tmp = 0
	if F <= -1.8e-9:
		tmp = t_0 + (1.0 / ((math.sin(B) * ((-1.0 / F) - F)) / F))
	elif F <= -9.5e-182:
		tmp = ((F * t_1) * t_2) - (x / B)
	elif F <= 6e-185:
		tmp = -x / (math.sin(B) / math.cos(B))
	elif F <= 1.36:
		tmp = ((F / math.sin(B)) * t_2) - (x / B)
	else:
		tmp = t_0 + t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	t_1 = Float64(1.0 / sin(B))
	t_2 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))
	tmp = 0.0
	if (F <= -1.8e-9)
		tmp = Float64(t_0 + Float64(1.0 / Float64(Float64(sin(B) * Float64(Float64(-1.0 / F) - F)) / F)));
	elseif (F <= -9.5e-182)
		tmp = Float64(Float64(Float64(F * t_1) * t_2) - Float64(x / B));
	elseif (F <= 6e-185)
		tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B)));
	elseif (F <= 1.36)
		tmp = Float64(Float64(Float64(F / sin(B)) * t_2) - Float64(x / B));
	else
		tmp = Float64(t_0 + t_1);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	t_1 = 1.0 / sin(B);
	t_2 = sqrt((1.0 / (2.0 + (x * 2.0))));
	tmp = 0.0;
	if (F <= -1.8e-9)
		tmp = t_0 + (1.0 / ((sin(B) * ((-1.0 / F) - F)) / F));
	elseif (F <= -9.5e-182)
		tmp = ((F * t_1) * t_2) - (x / B);
	elseif (F <= 6e-185)
		tmp = -x / (sin(B) / cos(B));
	elseif (F <= 1.36)
		tmp = ((F / sin(B)) * t_2) - (x / B);
	else
		tmp = t_0 + t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -1.8e-9], N[(t$95$0 + N[(1.0 / N[(N[(N[Sin[B], $MachinePrecision] * N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.5e-182], N[(N[(N[(F * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-185], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.36], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
t_2 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\

\mathbf{elif}\;F \leq -9.5 \cdot 10^{-182}:\\
\;\;\;\;\left(F \cdot t_1\right) \cdot t_2 - \frac{x}{B}\\

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

\mathbf{elif}\;F \leq 1.36:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_2 - \frac{x}{B}\\

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. associate-/r/75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8e-9 < F < -9.4999999999999994e-182

    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 82.2%

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

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

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

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

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

    if -9.4999999999999994e-182 < F < 6.00000000000000061e-185

    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 35.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*94.6%

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

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

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

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

    if 6.00000000000000061e-185 < F < 1.3600000000000001

    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 95.5%

      \[\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 79.5%

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

    if 1.3600000000000001 < F

    1. Initial program 68.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 99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\frac{\sin B \cdot \left(\frac{-1}{F} - F\right)}{F}}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-182}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-185}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.36:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 10: 85.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{if}\;F \leq -1.36 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-133}:\\ \;\;\;\;t_0 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{elif}\;F \leq 52:\\ \;\;\;\;t_0 \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)))
   (if (<= F -1.36e-12)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F -2.1e-133)
       (- (* t_0 (+ (/ F B) (* 0.16666666666666666 (* F B)))) (/ x B))
       (if (<= F 2.5e-69)
         (* (/ x (sin B)) (- (cos B)))
         (if (<= F 52.0)
           (- (* t_0 (/ F B)) (/ x B))
           (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
	double t_0 = pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double tmp;
	if (F <= -1.36e-12) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -2.1e-133) {
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	} else if (F <= 2.5e-69) {
		tmp = (x / sin(B)) * -cos(B);
	} else if (F <= 52.0) {
		tmp = (t_0 * (F / B)) - (x / B);
	} else {
		tmp = (x * (-1.0 / tan(B))) + (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 = (((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)
    if (f <= (-1.36d-12)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-2.1d-133)) then
        tmp = (t_0 * ((f / b) + (0.16666666666666666d0 * (f * b)))) - (x / b)
    else if (f <= 2.5d-69) then
        tmp = (x / sin(b)) * -cos(b)
    else if (f <= 52.0d0) then
        tmp = (t_0 * (f / b)) - (x / b)
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double tmp;
	if (F <= -1.36e-12) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -2.1e-133) {
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	} else if (F <= 2.5e-69) {
		tmp = (x / Math.sin(B)) * -Math.cos(B);
	} else if (F <= 52.0) {
		tmp = (t_0 * (F / B)) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)
	tmp = 0
	if F <= -1.36e-12:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -2.1e-133:
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B)
	elif F <= 2.5e-69:
		tmp = (x / math.sin(B)) * -math.cos(B)
	elif F <= 52.0:
		tmp = (t_0 * (F / B)) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5
	tmp = 0.0
	if (F <= -1.36e-12)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -2.1e-133)
		tmp = Float64(Float64(t_0 * Float64(Float64(F / B) + Float64(0.16666666666666666 * Float64(F * B)))) - Float64(x / B));
	elseif (F <= 2.5e-69)
		tmp = Float64(Float64(x / sin(B)) * Float64(-cos(B)));
	elseif (F <= 52.0)
		tmp = Float64(Float64(t_0 * Float64(F / B)) - Float64(x / B));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (((F * F) + 2.0) + (x * 2.0)) ^ -0.5;
	tmp = 0.0;
	if (F <= -1.36e-12)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -2.1e-133)
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	elseif (F <= 2.5e-69)
		tmp = (x / sin(B)) * -cos(B);
	elseif (F <= 52.0)
		tmp = (t_0 * (F / B)) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[F, -1.36e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.1e-133], N[(N[(t$95$0 * N[(N[(F / B), $MachinePrecision] + N[(0.16666666666666666 * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-69], N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * (-N[Cos[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 52.0], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{if}\;F \leq -1.36 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -2.1 \cdot 10^{-133}:\\
\;\;\;\;t_0 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\

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

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

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


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

    1. Initial program 63.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 97.3%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv97.4%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    4. Applied egg-rr97.4%

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

    if -1.36000000000000006e-12 < F < -2.1000000000000001e-133

    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 82.4%

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

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

    if -2.1000000000000001e-133 < F < 2.50000000000000017e-69

    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 31.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*99.6%

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

        \[\leadsto \left(-\color{blue}{\frac{x}{\sin B} \cdot \cos B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Applied egg-rr79.3%

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

    if 2.50000000000000017e-69 < F < 52

    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. Taylor expanded in B around 0 93.1%

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

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

    if 52 < F

    1. Initial program 68.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 99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.36 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-133}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{elif}\;F \leq 52:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 11: 71.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\
\mathbf{if}\;F \leq -7000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\

\mathbf{elif}\;F \leq -4.3 \cdot 10^{-132}:\\
\;\;\;\;t_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -7e6

    1. Initial program 59.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.7%

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

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

    if -7e6 < F < -4.2999999999999997e-132 or 4.50000000000000009e-69 < F < 9e11

    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 B around 0 81.7%

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

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

    if -4.2999999999999997e-132 < F < 4.50000000000000009e-69

    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 31.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*79.3%

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

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

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

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

    if 9e11 < F

    1. Initial program 67.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 B around 0 50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -4.3 \cdot 10^{-132}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 12: 71.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\
\mathbf{if}\;F \leq -7000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\

\mathbf{elif}\;F \leq -6.8 \cdot 10^{-132}:\\
\;\;\;\;t_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -7e6

    1. Initial program 59.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.7%

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

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

    if -7e6 < F < -6.79999999999999965e-132 or 1.3999999999999999e-69 < F < 9e11

    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 B around 0 81.7%

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

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

    if -6.79999999999999965e-132 < F < 1.3999999999999999e-69

    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 31.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*99.6%

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

        \[\leadsto \left(-\color{blue}{\frac{x}{\sin B} \cdot \cos B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Applied egg-rr79.3%

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

    if 9e11 < F

    1. Initial program 67.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 B around 0 50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{-132}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 13: 78.5% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\
\mathbf{if}\;F \leq -3.75 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -6.7 \cdot 10^{-133}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 63.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 97.3%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv97.4%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    4. Applied egg-rr97.4%

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

    if -3.74999999999999998e-10 < F < -6.7000000000000002e-133 or 2.50000000000000017e-69 < F < 9e11

    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 B around 0 81.1%

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

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

    if -6.7000000000000002e-133 < F < 2.50000000000000017e-69

    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 31.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. associate-/l*99.6%

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

        \[\leadsto \left(-\color{blue}{\frac{x}{\sin B} \cdot \cos B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Applied egg-rr79.3%

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

    if 9e11 < F

    1. Initial program 67.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 B around 0 50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.75 \cdot 10^{-10}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6.7 \cdot 10^{-133}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 14: 71.4% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{if}\;F \leq -6600000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{-132}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0
         (-
          (*
           (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)
           (+ (/ F B) (* 0.16666666666666666 (* F B))))
          (/ x B))))
   (if (<= F -6600000.0)
     (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
     (if (<= F -5.5e-132)
       t_0
       (if (<= F 1.35e-68)
         (/ (- x) (tan B))
         (if (<= F 900000000000.0) t_0 (- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	double tmp;
	if (F <= -6600000.0) {
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	} else if (F <= -5.5e-132) {
		tmp = t_0;
	} else if (F <= 1.35e-68) {
		tmp = -x / tan(B);
	} else if (F <= 900000000000.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 / sin(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) :: t_0
    real(8) :: tmp
    t_0 = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * ((f / b) + (0.16666666666666666d0 * (f * b)))) - (x / b)
    if (f <= (-6600000.0d0)) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
    else if (f <= (-5.5d-132)) then
        tmp = t_0
    else if (f <= 1.35d-68) then
        tmp = -x / tan(b)
    else if (f <= 900000000000.0d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	double tmp;
	if (F <= -6600000.0) {
		tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
	} else if (F <= -5.5e-132) {
		tmp = t_0;
	} else if (F <= 1.35e-68) {
		tmp = -x / Math.tan(B);
	} else if (F <= 900000000000.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B)
	tmp = 0
	if F <= -6600000.0:
		tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	elif F <= -5.5e-132:
		tmp = t_0
	elif F <= 1.35e-68:
		tmp = -x / math.tan(B)
	elif F <= 900000000000.0:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(Float64(F / B) + Float64(0.16666666666666666 * Float64(F * B)))) - Float64(x / B))
	tmp = 0.0
	if (F <= -6600000.0)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B));
	elseif (F <= -5.5e-132)
		tmp = t_0;
	elseif (F <= 1.35e-68)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 900000000000.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	tmp = 0.0;
	if (F <= -6600000.0)
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	elseif (F <= -5.5e-132)
		tmp = t_0;
	elseif (F <= 1.35e-68)
		tmp = -x / tan(B);
	elseif (F <= 900000000000.0)
		tmp = t_0;
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(N[(F / B), $MachinePrecision] + N[(0.16666666666666666 * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6600000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.5e-132], t$95$0, If[LessEqual[F, 1.35e-68], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 900000000000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\
\mathbf{if}\;F \leq -6600000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\

\mathbf{elif}\;F \leq -5.5 \cdot 10^{-132}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.35 \cdot 10^{-68}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -6.6e6

    1. Initial program 59.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.7%

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

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

    if -6.6e6 < F < -5.4999999999999999e-132 or 1.3500000000000001e-68 < F < 9e11

    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 B around 0 81.7%

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

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

    if -5.4999999999999999e-132 < F < 1.3500000000000001e-68

    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 31.5%

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

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

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

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

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u54.4%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
      2. expm1-udef28.8%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)} - 1\right)} \]
      3. clear-num28.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. un-div-inv28.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      5. quot-tan28.8%

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    9. Simplified79.2%

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

    if 9e11 < F

    1. Initial program 67.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 B around 0 50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6600000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{-132}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 15: 71.6% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -7000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -1.3 \cdot 10^{-133}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 8.8 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 550:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B))))
   (if (<= F -7000000.0)
     (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
     (if (<= F -1.3e-133)
       t_0
       (if (<= F 8.8e-69)
         (/ (- x) (tan B))
         (if (<= F 550.0) t_0 (- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
	double tmp;
	if (F <= -7000000.0) {
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	} else if (F <= -1.3e-133) {
		tmp = t_0;
	} else if (F <= 8.8e-69) {
		tmp = -x / tan(B);
	} else if (F <= 550.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 / sin(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) :: t_0
    real(8) :: tmp
    t_0 = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
    if (f <= (-7000000.0d0)) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
    else if (f <= (-1.3d-133)) then
        tmp = t_0
    else if (f <= 8.8d-69) then
        tmp = -x / tan(b)
    else if (f <= 550.0d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
	double tmp;
	if (F <= -7000000.0) {
		tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
	} else if (F <= -1.3e-133) {
		tmp = t_0;
	} else if (F <= 8.8e-69) {
		tmp = -x / Math.tan(B);
	} else if (F <= 550.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B)
	tmp = 0
	if F <= -7000000.0:
		tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	elif F <= -1.3e-133:
		tmp = t_0
	elif F <= 8.8e-69:
		tmp = -x / math.tan(B)
	elif F <= 550.0:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -7000000.0)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B));
	elseif (F <= -1.3e-133)
		tmp = t_0;
	elseif (F <= 8.8e-69)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 550.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B);
	tmp = 0.0;
	if (F <= -7000000.0)
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	elseif (F <= -1.3e-133)
		tmp = t_0;
	elseif (F <= 8.8e-69)
		tmp = -x / tan(B);
	elseif (F <= 550.0)
		tmp = t_0;
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-133], t$95$0, If[LessEqual[F, 8.8e-69], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 550.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -7000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\

\mathbf{elif}\;F \leq -1.3 \cdot 10^{-133}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 8.8 \cdot 10^{-69}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -7e6

    1. Initial program 59.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.7%

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

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

    if -7e6 < F < -1.3e-133 or 8.8000000000000001e-69 < F < 550

    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 B around 0 86.5%

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

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

    if -1.3e-133 < F < 8.8000000000000001e-69

    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 31.5%

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

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

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

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

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u54.4%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
      2. expm1-udef28.8%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)} - 1\right)} \]
      3. clear-num28.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. un-div-inv28.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      5. quot-tan28.8%

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    9. Simplified79.2%

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

    if 550 < F

    1. Initial program 68.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 B around 0 48.9%

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

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

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

Alternative 16: 71.4% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\

\mathbf{elif}\;F \leq -2.1 \cdot 10^{-132}:\\
\;\;\;\;t_0 \cdot \left(F \cdot \frac{1}{B}\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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

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


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

    1. Initial program 58.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 99.7%

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

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

    if -4.9999999999999998e30 < F < -2.1000000000000001e-132

    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 84.1%

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

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

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

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

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

    if -2.1000000000000001e-132 < F < 5.00000000000000033e-69

    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 31.5%

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

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

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

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

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u54.4%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
      2. expm1-udef28.8%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)} - 1\right)} \]
      3. clear-num28.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. un-div-inv28.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      5. quot-tan28.8%

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    9. Simplified79.2%

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

    if 5.00000000000000033e-69 < F < 310

    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. Taylor expanded in B around 0 93.1%

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

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

    if 310 < F

    1. Initial program 68.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 B around 0 48.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-132}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 310:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 17: 71.1% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ t_1 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -3.75 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -2.7 \cdot 10^{-132}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-69}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \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))
        (t_1 (/ (- x) (tan B))))
   (if (<= F -3.75e-10)
     (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
     (if (<= F -2.7e-132)
       t_0
       (if (<= F 2.6e-69)
         t_1
         (if (<= F 3.8e-11)
           t_0
           (if (<= F 900000000000.0) t_1 (- (/ 1.0 (sin B)) (/ 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 t_1 = -x / tan(B);
	double tmp;
	if (F <= -3.75e-10) {
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	} else if (F <= -2.7e-132) {
		tmp = t_0;
	} else if (F <= 2.6e-69) {
		tmp = t_1;
	} else if (F <= 3.8e-11) {
		tmp = t_0;
	} else if (F <= 900000000000.0) {
		tmp = t_1;
	} else {
		tmp = (1.0 / sin(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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    t_1 = -x / tan(b)
    if (f <= (-3.75d-10)) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
    else if (f <= (-2.7d-132)) then
        tmp = t_0
    else if (f <= 2.6d-69) then
        tmp = t_1
    else if (f <= 3.8d-11) then
        tmp = t_0
    else if (f <= 900000000000.0d0) then
        tmp = t_1
    else
        tmp = (1.0d0 / sin(b)) - (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 t_1 = -x / Math.tan(B);
	double tmp;
	if (F <= -3.75e-10) {
		tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
	} else if (F <= -2.7e-132) {
		tmp = t_0;
	} else if (F <= 2.6e-69) {
		tmp = t_1;
	} else if (F <= 3.8e-11) {
		tmp = t_0;
	} else if (F <= 900000000000.0) {
		tmp = t_1;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	t_1 = -x / math.tan(B)
	tmp = 0
	if F <= -3.75e-10:
		tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	elif F <= -2.7e-132:
		tmp = t_0
	elif F <= 2.6e-69:
		tmp = t_1
	elif F <= 3.8e-11:
		tmp = t_0
	elif F <= 900000000000.0:
		tmp = t_1
	else:
		tmp = (1.0 / math.sin(B)) - (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)
	t_1 = Float64(Float64(-x) / tan(B))
	tmp = 0.0
	if (F <= -3.75e-10)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B));
	elseif (F <= -2.7e-132)
		tmp = t_0;
	elseif (F <= 2.6e-69)
		tmp = t_1;
	elseif (F <= 3.8e-11)
		tmp = t_0;
	elseif (F <= 900000000000.0)
		tmp = t_1;
	else
		tmp = Float64(Float64(1.0 / sin(B)) - 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;
	t_1 = -x / tan(B);
	tmp = 0.0;
	if (F <= -3.75e-10)
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	elseif (F <= -2.7e-132)
		tmp = t_0;
	elseif (F <= 2.6e-69)
		tmp = t_1;
	elseif (F <= 3.8e-11)
		tmp = t_0;
	elseif (F <= 900000000000.0)
		tmp = t_1;
	else
		tmp = (1.0 / sin(B)) - (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]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.75e-10], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.7e-132], t$95$0, If[LessEqual[F, 2.6e-69], t$95$1, If[LessEqual[F, 3.8e-11], t$95$0, If[LessEqual[F, 900000000000.0], t$95$1, N[(N[(1.0 / N[Sin[B], $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}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -3.75 \cdot 10^{-10}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\

\mathbf{elif}\;F \leq -2.7 \cdot 10^{-132}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 2.6 \cdot 10^{-69}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 3.8 \cdot 10^{-11}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 900000000000:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 63.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 97.3%

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

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

    if -3.74999999999999998e-10 < F < -2.6999999999999999e-132 or 2.6000000000000002e-69 < F < 3.7999999999999998e-11

    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 0 99.3%

      \[\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 63.9%

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

    if -2.6999999999999999e-132 < F < 2.6000000000000002e-69 or 3.7999999999999998e-11 < F < 9e11

    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 34.9%

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

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

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

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

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u53.6%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
      2. expm1-udef30.8%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)} - 1\right)} \]
      3. clear-num30.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. un-div-inv30.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      5. quot-tan30.8%

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

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

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
      2. expm1-log1p77.6%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    9. Simplified77.6%

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

    if 9e11 < F

    1. Initial program 67.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 B around 0 50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.75 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -2.7 \cdot 10^{-132}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 18: 64.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -2.3 \cdot 10^{+115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -4.1 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B))))
   (if (<= F -2.3e+115)
     t_0
     (if (<= F -4.1e-8)
       (/ (- -1.0 x) B)
       (if (<= F 900000000000.0) t_0 (- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double tmp;
	if (F <= -2.3e+115) {
		tmp = t_0;
	} else if (F <= -4.1e-8) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 900000000000.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 / sin(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) :: t_0
    real(8) :: tmp
    t_0 = -x / tan(b)
    if (f <= (-2.3d+115)) then
        tmp = t_0
    else if (f <= (-4.1d-8)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 900000000000.0d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / sin(b)) - (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 <= -2.3e+115) {
		tmp = t_0;
	} else if (F <= -4.1e-8) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 900000000000.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / math.tan(B)
	tmp = 0
	if F <= -2.3e+115:
		tmp = t_0
	elif F <= -4.1e-8:
		tmp = (-1.0 - x) / B
	elif F <= 900000000000.0:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	tmp = 0.0
	if (F <= -2.3e+115)
		tmp = t_0;
	elseif (F <= -4.1e-8)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 900000000000.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / tan(B);
	tmp = 0.0;
	if (F <= -2.3e+115)
		tmp = t_0;
	elseif (F <= -4.1e-8)
		tmp = (-1.0 - x) / B;
	elseif (F <= 900000000000.0)
		tmp = t_0;
	else
		tmp = (1.0 / sin(B)) - (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, -2.3e+115], t$95$0, If[LessEqual[F, -4.1e-8], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 900000000000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{+115}:\\
\;\;\;\;t_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.30000000000000004e115 or -4.10000000000000032e-8 < F < 9e11

    1. Initial program 83.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 51.0%

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

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

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

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

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u41.0%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)} - 1\right)} \]
      3. clear-num29.1%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. un-div-inv29.1%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      5. quot-tan29.1%

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

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

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
      2. expm1-log1p61.0%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    9. Simplified61.0%

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

    if -2.30000000000000004e115 < F < -4.10000000000000032e-8

    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. Taylor expanded in F around -inf 92.6%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in46.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval46.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-146.6%

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

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

    if 9e11 < F

    1. Initial program 67.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 B around 0 50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{+115}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -4.1 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 19: 58.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-67} \lor \neg \left(x \leq -1.6 \cdot 10^{-123}\right) \land \left(x \leq -3.5 \cdot 10^{-187} \lor \neg \left(x \leq 9 \cdot 10^{-92}\right)\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -2.2e-67)
         (and (not (<= x -1.6e-123)) (or (<= x -3.5e-187) (not (<= x 9e-92)))))
   (/ (- x) (tan B))
   (/ 1.0 (sin B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.2e-67) || (!(x <= -1.6e-123) && ((x <= -3.5e-187) || !(x <= 9e-92)))) {
		tmp = -x / tan(B);
	} 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) :: tmp
    if ((x <= (-2.2d-67)) .or. (.not. (x <= (-1.6d-123))) .and. (x <= (-3.5d-187)) .or. (.not. (x <= 9d-92))) then
        tmp = -x / tan(b)
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.2e-67) || (!(x <= -1.6e-123) && ((x <= -3.5e-187) || !(x <= 9e-92)))) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -2.2e-67) or (not (x <= -1.6e-123) and ((x <= -3.5e-187) or not (x <= 9e-92))):
		tmp = -x / math.tan(B)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -2.2e-67) || (!(x <= -1.6e-123) && ((x <= -3.5e-187) || !(x <= 9e-92))))
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -2.2e-67) || (~((x <= -1.6e-123)) && ((x <= -3.5e-187) || ~((x <= 9e-92)))))
		tmp = -x / tan(B);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.2e-67], And[N[Not[LessEqual[x, -1.6e-123]], $MachinePrecision], Or[LessEqual[x, -3.5e-187], N[Not[LessEqual[x, 9e-92]], $MachinePrecision]]]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-67} \lor \neg \left(x \leq -1.6 \cdot 10^{-123}\right) \land \left(x \leq -3.5 \cdot 10^{-187} \lor \neg \left(x \leq 9 \cdot 10^{-92}\right)\right):\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.2000000000000001e-67 or -1.59999999999999989e-123 < x < -3.49999999999999979e-187 or 9.0000000000000001e-92 < x

    1. Initial program 81.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 72.4%

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

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

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

        \[\leadsto -\color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
    5. Simplified76.6%

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u45.6%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
      2. expm1-udef38.6%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)} - 1\right)} \]
      3. clear-num38.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. un-div-inv38.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      5. quot-tan38.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    7. Applied egg-rr38.6%

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

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

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    9. Simplified76.7%

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

    if -2.2000000000000001e-67 < x < -1.59999999999999989e-123 or -3.49999999999999979e-187 < x < 9.0000000000000001e-92

    1. Initial program 78.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 B around 0 74.3%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    4. Taylor expanded in B around inf 36.4%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-67} \lor \neg \left(x \leq -1.6 \cdot 10^{-123}\right) \land \left(x \leq -3.5 \cdot 10^{-187} \lor \neg \left(x \leq 9 \cdot 10^{-92}\right)\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]

Alternative 20: 71.9% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5e-8)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 900000000000.0) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5e-8) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 900000000000.0) {
		tmp = -x / tan(B);
	} else {
		tmp = (1.0 / sin(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 <= (-5d-8)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 900000000000.0d0) then
        tmp = -x / tan(b)
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5e-8) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 900000000000.0) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5e-8:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 900000000000.0:
		tmp = -x / math.tan(B)
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5e-8)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 900000000000.0)
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5e-8)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 900000000000.0)
		tmp = -x / tan(B);
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5e-8], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 900000000000.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 900000000000:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

    1. Initial program 63.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 97.3%

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

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

    if -4.9999999999999998e-8 < F < 9e11

    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 30.1%

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

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

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

        \[\leadsto -\color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
    5. Simplified61.3%

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u43.1%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
      2. expm1-udef26.2%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)} - 1\right)} \]
      3. clear-num26.2%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. un-div-inv26.2%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      5. quot-tan26.2%

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

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

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
      2. expm1-log1p61.4%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    9. Simplified61.4%

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

    if 9e11 < F

    1. Initial program 67.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 B around 0 50.1%

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

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

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

Alternative 21: 70.9% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.6 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6.6e-49)
   (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
   (if (<= F 900000000000.0) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.6e-49) {
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	} else if (F <= 900000000000.0) {
		tmp = -x / tan(B);
	} else {
		tmp = (1.0 / sin(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 <= (-6.6d-49)) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
    else if (f <= 900000000000.0d0) then
        tmp = -x / tan(b)
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.6e-49) {
		tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
	} else if (F <= 900000000000.0) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6.6e-49:
		tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	elif F <= 900000000000.0:
		tmp = -x / math.tan(B)
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6.6e-49)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B));
	elseif (F <= 900000000000.0)
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -6.6e-49)
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	elseif (F <= 900000000000.0)
		tmp = -x / tan(B);
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6.6e-49], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 900000000000.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 900000000000:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

    1. Initial program 66.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 91.5%

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

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

    if -6.6e-49 < F < 9e11

    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 30.5%

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

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

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

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

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u44.5%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
      2. expm1-udef26.6%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot \frac{\cos B}{\sin B}\right)} - 1\right)} \]
      3. clear-num26.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. un-div-inv26.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      5. quot-tan26.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    7. Applied egg-rr26.6%

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

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
      2. expm1-log1p63.8%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    9. Simplified63.8%

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

    if 9e11 < F

    1. Initial program 67.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 B around 0 50.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.6 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 900000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 22: 43.7% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-113}:\\ \;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\ \mathbf{elif}\;F \leq 3.9 \cdot 10^{+24}:\\ \;\;\;\;B \cdot \left(x \cdot -0.16666666666666666 - x \cdot -0.5\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.5e-113)
   (+ (/ (- -1.0 x) B) (* B (- (* x 0.3333333333333333) 0.16666666666666666)))
   (if (<= F 3.9e+24)
     (- (* B (- (* x -0.16666666666666666) (* x -0.5))) (/ x B))
     (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e-113) {
		tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
	} else if (F <= 3.9e+24) {
		tmp = (B * ((x * -0.16666666666666666) - (x * -0.5))) - (x / B);
	} 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) :: tmp
    if (f <= (-5.5d-113)) then
        tmp = (((-1.0d0) - x) / b) + (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0))
    else if (f <= 3.9d+24) then
        tmp = (b * ((x * (-0.16666666666666666d0)) - (x * (-0.5d0)))) - (x / b)
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e-113) {
		tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
	} else if (F <= 3.9e+24) {
		tmp = (B * ((x * -0.16666666666666666) - (x * -0.5))) - (x / B);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.5e-113:
		tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666))
	elif F <= 3.9e+24:
		tmp = (B * ((x * -0.16666666666666666) - (x * -0.5))) - (x / B)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.5e-113)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666)));
	elseif (F <= 3.9e+24)
		tmp = Float64(Float64(B * Float64(Float64(x * -0.16666666666666666) - Float64(x * -0.5))) - Float64(x / B));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.5e-113)
		tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
	elseif (F <= 3.9e+24)
		tmp = (B * ((x * -0.16666666666666666) - (x * -0.5))) - (x / B);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.5e-113], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e+24], N[(N[(B * N[(N[(x * -0.16666666666666666), $MachinePrecision] - N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\

\mathbf{elif}\;F \leq 3.9 \cdot 10^{+24}:\\
\;\;\;\;B \cdot \left(x \cdot -0.16666666666666666 - x \cdot -0.5\right) - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


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

    1. Initial program 70.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 83.0%

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

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

    if -5.50000000000000053e-113 < F < 3.8999999999999998e24

    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 32.5%

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

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

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

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

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Taylor expanded in B around 0 37.3%

      \[\leadsto -\color{blue}{\left(B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) + \frac{x}{B}\right)} \]

    if 3.8999999999999998e24 < F

    1. Initial program 66.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 B around 0 48.1%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    4. Taylor expanded in B around inf 56.3%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-113}:\\ \;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\ \mathbf{elif}\;F \leq 3.9 \cdot 10^{+24}:\\ \;\;\;\;B \cdot \left(x \cdot -0.16666666666666666 - x \cdot -0.5\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]

Alternative 23: 43.7% accurate, 18.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{-110}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-86}:\\ \;\;\;\;B \cdot \left(x \cdot -0.16666666666666666 - x \cdot -0.5\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.5e-110)
   (/ (- -1.0 x) B)
   (if (<= F 1.15e-86)
     (- (* B (- (* x -0.16666666666666666) (* x -0.5))) (/ x B))
     (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.5e-110) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.15e-86) {
		tmp = (B * ((x * -0.16666666666666666) - (x * -0.5))) - (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 <= (-2.5d-110)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.15d-86) then
        tmp = (b * ((x * (-0.16666666666666666d0)) - (x * (-0.5d0)))) - (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 <= -2.5e-110) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.15e-86) {
		tmp = (B * ((x * -0.16666666666666666) - (x * -0.5))) - (x / B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.5e-110:
		tmp = (-1.0 - x) / B
	elif F <= 1.15e-86:
		tmp = (B * ((x * -0.16666666666666666) - (x * -0.5))) - (x / B)
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.5e-110)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.15e-86)
		tmp = Float64(Float64(B * Float64(Float64(x * -0.16666666666666666) - Float64(x * -0.5))) - 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 <= -2.5e-110)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.15e-86)
		tmp = (B * ((x * -0.16666666666666666) - (x * -0.5))) - (x / B);
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-110], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.15e-86], N[(N[(B * N[(N[(x * -0.16666666666666666), $MachinePrecision] - N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-110}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.15 \cdot 10^{-86}:\\
\;\;\;\;B \cdot \left(x \cdot -0.16666666666666666 - x \cdot -0.5\right) - \frac{x}{B}\\

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


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

    1. Initial program 70.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 83.0%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in37.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval37.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-137.8%

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

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

    if -2.5e-110 < F < 1.14999999999999998e-86

    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 27.9%

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

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

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

        \[\leadsto -\color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
    5. Simplified75.6%

      \[\leadsto \color{blue}{-x \cdot \frac{\cos B}{\sin B}} \]
    6. Taylor expanded in B around 0 41.1%

      \[\leadsto -\color{blue}{\left(B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) + \frac{x}{B}\right)} \]

    if 1.14999999999999998e-86 < F

    1. Initial program 75.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 B around 0 56.6%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    4. Taylor expanded in B around 0 48.2%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{-110}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-86}:\\ \;\;\;\;B \cdot \left(x \cdot -0.16666666666666666 - x \cdot -0.5\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 24: 44.0% accurate, 21.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6e-49)
   (+ (/ (- -1.0 x) B) (* B (- (* x 0.3333333333333333) 0.16666666666666666)))
   (if (<= F 8e-69) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6e-49) {
		tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
	} else if (F <= 8e-69) {
		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 <= (-6d-49)) then
        tmp = (((-1.0d0) - x) / b) + (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0))
    else if (f <= 8d-69) 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 <= -6e-49) {
		tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
	} else if (F <= 8e-69) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6e-49:
		tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666))
	elif F <= 8e-69:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6e-49)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666)));
	elseif (F <= 8e-69)
		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 <= -6e-49)
		tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
	elseif (F <= 8e-69)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6e-49], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-69], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-49}:\\
\;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\

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

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


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

    1. Initial program 66.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 91.5%

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

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

    if -6e-49 < F < 7.9999999999999997e-69

    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 29.4%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in13.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval13.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-113.6%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 36.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-neg36.4%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
    8. Simplified36.4%

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

    if 7.9999999999999997e-69 < F

    1. Initial program 74.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 B around 0 56.3%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    4. Taylor expanded in B around 0 48.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 25: 37.3% accurate, 29.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{B}\\ \mathbf{if}\;F \leq -3.5 \cdot 10^{+111}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -950000:\\ \;\;\;\;\frac{-1 + x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-69}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) B)))
   (if (<= F -3.5e+111)
     t_0
     (if (<= F -950000.0)
       (/ (+ -1.0 x) B)
       (if (<= F 5.5e-69) t_0 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
	double t_0 = -x / B;
	double tmp;
	if (F <= -3.5e+111) {
		tmp = t_0;
	} else if (F <= -950000.0) {
		tmp = (-1.0 + x) / B;
	} else if (F <= 5.5e-69) {
		tmp = t_0;
	} 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) :: t_0
    real(8) :: tmp
    t_0 = -x / b
    if (f <= (-3.5d+111)) then
        tmp = t_0
    else if (f <= (-950000.0d0)) then
        tmp = ((-1.0d0) + x) / b
    else if (f <= 5.5d-69) then
        tmp = t_0
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -x / B;
	double tmp;
	if (F <= -3.5e+111) {
		tmp = t_0;
	} else if (F <= -950000.0) {
		tmp = (-1.0 + x) / B;
	} else if (F <= 5.5e-69) {
		tmp = t_0;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / B
	tmp = 0
	if F <= -3.5e+111:
		tmp = t_0
	elif F <= -950000.0:
		tmp = (-1.0 + x) / B
	elif F <= 5.5e-69:
		tmp = t_0
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / B)
	tmp = 0.0
	if (F <= -3.5e+111)
		tmp = t_0;
	elseif (F <= -950000.0)
		tmp = Float64(Float64(-1.0 + x) / B);
	elseif (F <= 5.5e-69)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / B;
	tmp = 0.0;
	if (F <= -3.5e+111)
		tmp = t_0;
	elseif (F <= -950000.0)
		tmp = (-1.0 + x) / B;
	elseif (F <= 5.5e-69)
		tmp = t_0;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[F, -3.5e+111], t$95$0, If[LessEqual[F, -950000.0], N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.5e-69], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{+111}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -950000:\\
\;\;\;\;\frac{-1 + x}{B}\\

\mathbf{elif}\;F \leq 5.5 \cdot 10^{-69}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3.5000000000000002e111 or -9.5e5 < F < 5.50000000000000006e-69

    1. Initial program 81.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 53.5%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in24.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval24.2%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-124.2%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 32.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-neg32.1%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
    8. Simplified32.1%

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

    if -3.5000000000000002e111 < F < -9.5e5

    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. Taylor expanded in F around -inf 98.5%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in50.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval50.2%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-150.2%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u14.7%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-1 + \left(-x\right)}{B}\right)} - 1} \]
      3. +-commutative14.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\left(-x\right) + -1}}{B}\right)} - 1 \]
      4. add-sqr-sqrt0.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}} + -1}{B}\right)} - 1 \]
      5. sqrt-unprod14.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} + -1}{B}\right)} - 1 \]
      6. sqr-neg14.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{x \cdot x}} + -1}{B}\right)} - 1 \]
      7. sqrt-unprod13.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}} + -1}{B}\right)} - 1 \]
      8. add-sqr-sqrt14.3%

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

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

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

        \[\leadsto \color{blue}{\frac{x + -1}{B}} \]
    9. Simplified50.3%

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

    if 5.50000000000000006e-69 < F

    1. Initial program 74.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 B around 0 56.3%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    4. Taylor expanded in B around 0 48.6%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification39.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.5 \cdot 10^{+111}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq -950000:\\ \;\;\;\;\frac{-1 + x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 26: 29.9% accurate, 35.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{+119} \lor \neg \left(F \leq -950000\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 + x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= F -5.2e+119) (not (<= F -950000.0)))
   (/ (- x) B)
   (/ (+ -1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if ((F <= -5.2e+119) || !(F <= -950000.0)) {
		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 <= (-5.2d+119)) .or. (.not. (f <= (-950000.0d0)))) 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 <= -5.2e+119) || !(F <= -950000.0)) {
		tmp = -x / B;
	} else {
		tmp = (-1.0 + x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (F <= -5.2e+119) or not (F <= -950000.0):
		tmp = -x / B
	else:
		tmp = (-1.0 + x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((F <= -5.2e+119) || !(F <= -950000.0))
		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 <= -5.2e+119) || ~((F <= -950000.0)))
		tmp = -x / B;
	else
		tmp = (-1.0 + x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[F, -5.2e+119], N[Not[LessEqual[F, -950000.0]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{+119} \lor \neg \left(F \leq -950000\right):\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1 + x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -5.2e119 or -9.5e5 < F

    1. Initial program 78.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 49.3%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in25.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.1%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.1%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 30.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-neg30.1%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
    8. Simplified30.1%

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

    if -5.2e119 < F < -9.5e5

    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. Taylor expanded in F around -inf 98.5%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in50.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval50.2%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-150.2%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u14.7%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-1 + \left(-x\right)}{B}\right)} - 1} \]
      3. +-commutative14.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\left(-x\right) + -1}}{B}\right)} - 1 \]
      4. add-sqr-sqrt0.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}} + -1}{B}\right)} - 1 \]
      5. sqrt-unprod14.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} + -1}{B}\right)} - 1 \]
      6. sqr-neg14.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{x \cdot x}} + -1}{B}\right)} - 1 \]
      7. sqrt-unprod13.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}} + -1}{B}\right)} - 1 \]
      8. add-sqr-sqrt14.3%

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

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

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

        \[\leadsto \color{blue}{\frac{x + -1}{B}} \]
    9. Simplified50.3%

      \[\leadsto \color{blue}{\frac{x + -1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{+119} \lor \neg \left(F \leq -950000\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 + x}{B}\\ \end{array} \]

Alternative 27: 43.8% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{-110}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.4e-110)
   (/ (- -1.0 x) B)
   (if (<= F 1.35e-68) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.4e-110) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.35e-68) {
		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 <= (-2.4d-110)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.35d-68) 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 <= -2.4e-110) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.35e-68) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.4e-110:
		tmp = (-1.0 - x) / B
	elif F <= 1.35e-68:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.4e-110)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.35e-68)
		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 <= -2.4e-110)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.35e-68)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.4e-110], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.35e-68], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-110}:\\
\;\;\;\;\frac{-1 - x}{B}\\

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

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


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

    1. Initial program 70.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 83.0%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in37.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval37.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-137.8%

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

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

    if -2.40000000000000006e-110 < F < 1.3500000000000001e-68

    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 30.3%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in14.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval14.9%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-114.9%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 41.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-neg41.2%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
    8. Simplified41.2%

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

    if 1.3500000000000001e-68 < F

    1. Initial program 74.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 B around 0 56.3%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    4. Taylor expanded in B around 0 48.6%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{-110}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 28: 30.0% accurate, 39.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+119} \lor \neg \left(F \leq -950000\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= F -3e+119) (not (<= F -950000.0))) (/ (- x) B) (/ -1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((F <= -3e+119) || !(F <= -950000.0)) {
		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 ((f <= (-3d+119)) .or. (.not. (f <= (-950000.0d0)))) 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 ((F <= -3e+119) || !(F <= -950000.0)) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (F <= -3e+119) or not (F <= -950000.0):
		tmp = -x / B
	else:
		tmp = -1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((F <= -3e+119) || !(F <= -950000.0))
		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 ((F <= -3e+119) || ~((F <= -950000.0)))
		tmp = -x / B;
	else
		tmp = -1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[F, -3e+119], N[Not[LessEqual[F, -950000.0]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{+119} \lor \neg \left(F \leq -950000\right):\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -3.00000000000000001e119 or -9.5e5 < F

    1. Initial program 78.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 49.3%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in25.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.1%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.1%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 30.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-neg30.1%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
    8. Simplified30.1%

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

    if -3.00000000000000001e119 < F < -9.5e5

    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. Taylor expanded in F around -inf 98.5%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in50.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval50.2%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-150.2%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around 0 50.1%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+119} \lor \neg \left(F \leq -950000\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]

Alternative 29: 10.3% 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 79.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 53.1%

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

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

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. distribute-lft-in27.0%

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval27.0%

      \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
    4. neg-mul-127.0%

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

    \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
  6. Taylor expanded in x around 0 10.0%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification10.0%

    \[\leadsto \frac{-1}{B} \]

Reproduce

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