VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.1% → 99.5%
Time: 26.0s
Alternatives: 22
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 22 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.1% accurate, 1.0× speedup?

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

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Alternative 1: 99.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+25}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x \cdot \cos B}{\sin 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 -1.5e+36)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 1.55e+25)
     (-
      (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
      (/ (* x (cos B)) (sin B)))
     (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.5e+36) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 1.55e+25) {
		tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x * cos(B)) / sin(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 <= (-1.5d+36)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 1.55d+25) then
        tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - ((x * cos(b)) / sin(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 <= -1.5e+36) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 1.55e+25) {
		tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x * Math.cos(B)) / Math.sin(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 <= -1.5e+36:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 1.55e+25:
		tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x * math.cos(B)) / math.sin(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 <= -1.5e+36)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 1.55e+25)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(Float64(x * cos(B)) / sin(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 <= -1.5e+36)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 1.55e+25)
		tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - ((x * cos(B)) / sin(B));
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.5e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.55e+25], 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[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[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 -1.5 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 1.55 \cdot 10^{+25}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x \cdot \cos B}{\sin 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 < -1.5e36

    1. Initial program 54.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 99.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.5e36 < F < 1.5499999999999999e25

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

      \[\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)} \]

    if 1.5499999999999999e25 < F

    1. Initial program 50.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around inf 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.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+25}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x \cdot \cos B}{\sin 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 -1.1 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+25}:\\ \;\;\;\;\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 -1.1e+36)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 2e+25)
       (- (* (/ 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 <= -1.1e+36) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 2e+25) {
		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 <= (-1.1d+36)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 2d+25) 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 <= -1.1e+36) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 2e+25) {
		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 <= -1.1e+36:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 2e+25:
		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 <= -1.1e+36)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 2e+25)
		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 <= -1.1e+36)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 2e+25)
		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, -1.1e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2e+25], 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 -1.1 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\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.1e36

    1. Initial program 54.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 99.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.1e36 < F < 2.00000000000000018e25

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. expm1-log1p-u73.7%

        \[\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-udef57.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-inv57.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-rr57.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-def73.7%

        \[\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 2.00000000000000018e25 < F

    1. Initial program 50.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around inf 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.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.1 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+25}:\\ \;\;\;\;\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.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x \cdot \frac{1}{\tan 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 -1.4)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 1.7e-10)
     (-
      (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
      (* x (/ 1.0 (tan B))))
     (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 1.7e-10) {
		tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x * (1.0 / tan(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 <= (-1.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 1.7d-10) then
        tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x * (1.0d0 / tan(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 <= -1.4) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 1.7e-10) {
		tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x * (1.0 / Math.tan(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 <= -1.4:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 1.7e-10:
		tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x * (1.0 / math.tan(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 <= -1.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 1.7e-10)
		tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x * Float64(1.0 / tan(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 <= -1.4)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 1.7e-10)
		tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x * (1.0 / tan(B)));
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-10], 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 * N[(1.0 / N[Tan[B], $MachinePrecision]), $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 -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x \cdot \frac{1}{\tan 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 < -1.3999999999999999

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.70000000000000007e-10

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around 0 99.4%

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

    if 1.70000000000000007e-10 < F

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

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

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

Alternative 4: 98.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -1.95:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\ \;\;\;\;t_0 + \frac{1}{\frac{\sin B}{F} \cdot \sqrt{2 + x \cdot 2}}\\ \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 -1.95)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F 1.7e-10)
       (+ t_0 (/ 1.0 (* (/ (sin B) F) (sqrt (+ 2.0 (* x 2.0))))))
       (+ 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 <= -1.95) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 1.7e-10) {
		tmp = t_0 + (1.0 / ((sin(B) / F) * sqrt((2.0 + (x * 2.0)))));
	} 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 <= (-1.95d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 1.7d-10) then
        tmp = t_0 + (1.0d0 / ((sin(b) / f) * sqrt((2.0d0 + (x * 2.0d0)))))
    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 <= -1.95) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 1.7e-10) {
		tmp = t_0 + (1.0 / ((Math.sin(B) / F) * Math.sqrt((2.0 + (x * 2.0)))));
	} 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 <= -1.95:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 1.7e-10:
		tmp = t_0 + (1.0 / ((math.sin(B) / F) * math.sqrt((2.0 + (x * 2.0)))))
	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 <= -1.95)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 1.7e-10)
		tmp = Float64(t_0 + Float64(1.0 / Float64(Float64(sin(B) / F) * sqrt(Float64(2.0 + Float64(x * 2.0))))));
	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 <= -1.95)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 1.7e-10)
		tmp = t_0 + (1.0 / ((sin(B) / F) * sqrt((2.0 + (x * 2.0)))));
	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, -1.95], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-10], N[(t$95$0 + N[(1.0 / N[(N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $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 -1.95:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

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

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


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

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

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

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

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

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

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

    if -1.94999999999999996 < F < 1.70000000000000007e-10

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.70000000000000007e-10 < F

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

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

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

Alternative 5: 87.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\frac{\sin B}{F}} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{if}\;F \leq -0.96:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1 \cdot 10^{-93}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 2.75 \cdot 10^{-132}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\ \;\;\;\;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
         (-
          (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ (sin B) F))
          (+ (/ x B) (* -0.3333333333333333 (* B x))))))
   (if (<= F -0.96)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F -1e-93)
       t_0
       (if (<= F 2.75e-132)
         (/ (* x (cos B)) (- (sin B)))
         (if (<= F 1.7e-10)
           t_0
           (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
	double t_0 = (sqrt((1.0 / (2.0 + (x * 2.0)))) / (sin(B) / F)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	double tmp;
	if (F <= -0.96) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -1e-93) {
		tmp = t_0;
	} else if (F <= 2.75e-132) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 1.7e-10) {
		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 = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / (sin(b) / f)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
    if (f <= (-0.96d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-1d-93)) then
        tmp = t_0
    else if (f <= 2.75d-132) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 1.7d-10) 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 = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / (Math.sin(B) / F)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	double tmp;
	if (F <= -0.96) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -1e-93) {
		tmp = t_0;
	} else if (F <= 2.75e-132) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 1.7e-10) {
		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 = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / (math.sin(B) / F)) - ((x / B) + (-0.3333333333333333 * (B * x)))
	tmp = 0
	if F <= -0.96:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -1e-93:
		tmp = t_0
	elif F <= 2.75e-132:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 1.7e-10:
		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(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / Float64(sin(B) / F)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x))))
	tmp = 0.0
	if (F <= -0.96)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -1e-93)
		tmp = t_0;
	elseif (F <= 2.75e-132)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 1.7e-10)
		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 = (sqrt((1.0 / (2.0 + (x * 2.0)))) / (sin(B) / F)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	tmp = 0.0;
	if (F <= -0.96)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -1e-93)
		tmp = t_0;
	elseif (F <= 2.75e-132)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 1.7e-10)
		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[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.96], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1e-93], t$95$0, If[LessEqual[F, 2.75e-132], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.7e-10], 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{\sqrt{\frac{1}{2 + x \cdot 2}}}{\frac{\sin B}{F}} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\mathbf{if}\;F \leq -0.96:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -1 \cdot 10^{-93}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\
\;\;\;\;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 < -0.95999999999999996

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

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

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

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

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

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

    if -0.95999999999999996 < F < -9.999999999999999e-94 or 2.75e-132 < F < 1.70000000000000007e-10

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 85.4%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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. *-commutative85.4%

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

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\right) + {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} \]
      3. un-div-inv85.4%

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

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

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

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

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

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}}{\frac{\sin B}{F}} \]
    4. Applied egg-rr85.4%

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

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

    if -9.999999999999999e-94 < F < 2.75e-132

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 37.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/76.3%

        \[\leadsto \color{blue}{\frac{-x}{\sin B} \cdot \cos B} \]
      6. *-commutative76.3%

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

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    6. Step-by-step derivation
      1. *-commutative76.3%

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

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\sin B}} \cdot \cos B \]
      3. associate-*l/76.4%

        \[\leadsto \color{blue}{\frac{\left(-\left(-x\right)\right) \cdot \cos B}{-\sin B}} \]
      4. remove-double-neg76.4%

        \[\leadsto \frac{\color{blue}{x} \cdot \cos B}{-\sin B} \]
    7. Applied egg-rr76.4%

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

    if 1.70000000000000007e-10 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.96:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1 \cdot 10^{-93}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\frac{\sin B}{F}} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 2.75 \cdot 10^{-132}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\frac{\sin B}{F}} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 6: 90.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{if}\;F \leq -3.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.4 \cdot 10^{-134}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-136}:\\ \;\;\;\;\frac{x}{\frac{-\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+25}:\\ \;\;\;\;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)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
          (/ x B))))
   (if (<= F -3.6e+14)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F -2.4e-134)
       t_0
       (if (<= F 8.5e-136)
         (/ x (/ (- (sin B)) (cos B)))
         (if (<= F 1.55e+25)
           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)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
	double tmp;
	if (F <= -3.6e+14) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -2.4e-134) {
		tmp = t_0;
	} else if (F <= 8.5e-136) {
		tmp = x / (-sin(B) / cos(B));
	} else if (F <= 1.55e+25) {
		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)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
    if (f <= (-3.6d+14)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-2.4d-134)) then
        tmp = t_0
    else if (f <= 8.5d-136) then
        tmp = x / (-sin(b) / cos(b))
    else if (f <= 1.55d+25) 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.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
	double tmp;
	if (F <= -3.6e+14) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -2.4e-134) {
		tmp = t_0;
	} else if (F <= 8.5e-136) {
		tmp = x / (-Math.sin(B) / Math.cos(B));
	} else if (F <= 1.55e+25) {
		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.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B)
	tmp = 0
	if F <= -3.6e+14:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -2.4e-134:
		tmp = t_0
	elif F <= 8.5e-136:
		tmp = x / (-math.sin(B) / math.cos(B))
	elif F <= 1.55e+25:
		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)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B))
	tmp = 0.0
	if (F <= -3.6e+14)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -2.4e-134)
		tmp = t_0;
	elseif (F <= 8.5e-136)
		tmp = Float64(x / Float64(Float64(-sin(B)) / cos(B)));
	elseif (F <= 1.55e+25)
		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)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / B);
	tmp = 0.0;
	if (F <= -3.6e+14)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -2.4e-134)
		tmp = t_0;
	elseif (F <= 8.5e-136)
		tmp = x / (-sin(B) / cos(B));
	elseif (F <= 1.55e+25)
		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[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]}, If[LessEqual[F, -3.6e+14], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.4e-134], t$95$0, If[LessEqual[F, 8.5e-136], N[(x / N[((-N[Sin[B], $MachinePrecision]) / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.55e+25], 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 {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{if}\;F \leq -3.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -2.4 \cdot 10^{-134}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 1.55 \cdot 10^{+25}:\\
\;\;\;\;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 < -3.6e14

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

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

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

        \[\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 -3.6e14 < F < -2.4000000000000001e-134 or 8.49999999999999973e-136 < F < 1.5499999999999999e25

    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 91.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)} \]

    if -2.4000000000000001e-134 < F < 8.49999999999999973e-136

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 37.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/78.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\sin B}} \cdot \cos B \]
      3. associate-*l/78.2%

        \[\leadsto \color{blue}{\frac{\left(-\left(-x\right)\right) \cdot \cos B}{-\sin B}} \]
      4. remove-double-neg78.2%

        \[\leadsto \frac{\color{blue}{x} \cdot \cos B}{-\sin B} \]
    7. Applied egg-rr78.2%

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

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

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

    if 1.5499999999999999e25 < F

    1. Initial program 50.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around inf 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 simplification92.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.4 \cdot 10^{-134}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-136}:\\ \;\;\;\;\frac{x}{\frac{-\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+25}:\\ \;\;\;\;\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 7: 92.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{if}\;F \leq -3.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.3 \cdot 10^{-71}:\\ \;\;\;\;\frac{F}{\sin B} \cdot t_1 - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\ \;\;\;\;t_0 + t_1 \cdot \frac{F}{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))))
        (t_1 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)))
   (if (<= F -3.6e+14)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F -1.3e-71)
       (- (* (/ F (sin B)) t_1) (/ x B))
       (if (<= F 1.7e-10) (+ t_0 (* t_1 (/ F B))) (+ t_0 (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double t_1 = pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double tmp;
	if (F <= -3.6e+14) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -1.3e-71) {
		tmp = ((F / sin(B)) * t_1) - (x / B);
	} else if (F <= 1.7e-10) {
		tmp = t_0 + (t_1 * (F / 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) :: t_1
    real(8) :: tmp
    t_0 = x * ((-1.0d0) / tan(b))
    t_1 = (((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)
    if (f <= (-3.6d+14)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-1.3d-71)) then
        tmp = ((f / sin(b)) * t_1) - (x / b)
    else if (f <= 1.7d-10) then
        tmp = t_0 + (t_1 * (f / 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 t_1 = Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double tmp;
	if (F <= -3.6e+14) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -1.3e-71) {
		tmp = ((F / Math.sin(B)) * t_1) - (x / B);
	} else if (F <= 1.7e-10) {
		tmp = t_0 + (t_1 * (F / 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))
	t_1 = math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)
	tmp = 0
	if F <= -3.6e+14:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -1.3e-71:
		tmp = ((F / math.sin(B)) * t_1) - (x / B)
	elif F <= 1.7e-10:
		tmp = t_0 + (t_1 * (F / 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)))
	t_1 = Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5
	tmp = 0.0
	if (F <= -3.6e+14)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -1.3e-71)
		tmp = Float64(Float64(Float64(F / sin(B)) * t_1) - Float64(x / B));
	elseif (F <= 1.7e-10)
		tmp = Float64(t_0 + Float64(t_1 * Float64(F / 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));
	t_1 = (((F * F) + 2.0) + (x * 2.0)) ^ -0.5;
	tmp = 0.0;
	if (F <= -3.6e+14)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -1.3e-71)
		tmp = ((F / sin(B)) * t_1) - (x / B);
	elseif (F <= 1.7e-10)
		tmp = t_0 + (t_1 * (F / 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]}, Block[{t$95$1 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[F, -3.6e+14], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-71], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-10], N[(t$95$0 + N[(t$95$1 * N[(F / 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}\\
t_1 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{if}\;F \leq -3.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -1.3 \cdot 10^{-71}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_1 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\
\;\;\;\;t_0 + t_1 \cdot \frac{F}{B}\\

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


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

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

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

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

        \[\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 -3.6e14 < F < -1.2999999999999999e-71

    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 99.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)} \]

    if -1.2999999999999999e-71 < F < 1.70000000000000007e-10

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 82.9%

      \[\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 1.70000000000000007e-10 < F

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

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

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

Alternative 8: 85.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}\\ t_1 := \frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{if}\;F \leq -1350:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-94}:\\ \;\;\;\;t_0 \cdot \left(F \cdot \frac{1}{B}\right) - t_1\\ \mathbf{elif}\;F \leq 1.06 \cdot 10^{-135}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\ \;\;\;\;t_0 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - t_1\\ \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))
        (t_1 (+ (/ x B) (* -0.3333333333333333 (* B x)))))
   (if (<= F -1350.0)
     (- (/ -1.0 (sin B)) (/ x (tan B)))
     (if (<= F -9.5e-94)
       (- (* t_0 (* F (/ 1.0 B))) t_1)
       (if (<= F 1.06e-135)
         (/ (* x (cos B)) (- (sin B)))
         (if (<= F 1.7e-10)
           (- (* t_0 (+ (/ F B) (* 0.16666666666666666 (* F B)))) t_1)
           (+ (* 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 t_1 = (x / B) + (-0.3333333333333333 * (B * x));
	double tmp;
	if (F <= -1350.0) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -9.5e-94) {
		tmp = (t_0 * (F * (1.0 / B))) - t_1;
	} else if (F <= 1.06e-135) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 1.7e-10) {
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_0 = (((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)
    t_1 = (x / b) + ((-0.3333333333333333d0) * (b * x))
    if (f <= (-1350.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-9.5d-94)) then
        tmp = (t_0 * (f * (1.0d0 / b))) - t_1
    else if (f <= 1.06d-135) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 1.7d-10) then
        tmp = (t_0 * ((f / b) + (0.16666666666666666d0 * (f * b)))) - t_1
    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 t_1 = (x / B) + (-0.3333333333333333 * (B * x));
	double tmp;
	if (F <= -1350.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -9.5e-94) {
		tmp = (t_0 * (F * (1.0 / B))) - t_1;
	} else if (F <= 1.06e-135) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 1.7e-10) {
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - t_1;
	} 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)
	t_1 = (x / B) + (-0.3333333333333333 * (B * x))
	tmp = 0
	if F <= -1350.0:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -9.5e-94:
		tmp = (t_0 * (F * (1.0 / B))) - t_1
	elif F <= 1.06e-135:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 1.7e-10:
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - t_1
	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
	t_1 = Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))
	tmp = 0.0
	if (F <= -1350.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -9.5e-94)
		tmp = Float64(Float64(t_0 * Float64(F * Float64(1.0 / B))) - t_1);
	elseif (F <= 1.06e-135)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 1.7e-10)
		tmp = Float64(Float64(t_0 * Float64(Float64(F / B) + Float64(0.16666666666666666 * Float64(F * B)))) - t_1);
	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;
	t_1 = (x / B) + (-0.3333333333333333 * (B * x));
	tmp = 0.0;
	if (F <= -1350.0)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -9.5e-94)
		tmp = (t_0 * (F * (1.0 / B))) - t_1;
	elseif (F <= 1.06e-135)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 1.7e-10)
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - t_1;
	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]}, Block[{t$95$1 = N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1350.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.5e-94], N[(N[(t$95$0 * N[(F * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.06e-135], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.7e-10], N[(N[(t$95$0 * N[(N[(F / B), $MachinePrecision] + N[(0.16666666666666666 * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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}\\
t_1 := \frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\mathbf{if}\;F \leq -1350:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

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

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

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

\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 < -1350

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

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

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

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

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

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

    if -1350 < F < -9.4999999999999997e-94

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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-inv91.5%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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. *-commutative91.5%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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-rr91.5%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 76.0%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 -9.4999999999999997e-94 < F < 1.06000000000000004e-135

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 37.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/76.3%

        \[\leadsto \color{blue}{\frac{-x}{\sin B} \cdot \cos B} \]
      6. *-commutative76.3%

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

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    6. Step-by-step derivation
      1. *-commutative76.3%

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

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\sin B}} \cdot \cos B \]
      3. associate-*l/76.4%

        \[\leadsto \color{blue}{\frac{\left(-\left(-x\right)\right) \cdot \cos B}{-\sin B}} \]
      4. remove-double-neg76.4%

        \[\leadsto \frac{\color{blue}{x} \cdot \cos B}{-\sin B} \]
    7. Applied egg-rr76.4%

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

    if 1.06000000000000004e-135 < F < 1.70000000000000007e-10

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 75.3%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 1.70000000000000007e-10 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1350:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-94}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 1.06 \cdot 10^{-135}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-10}:\\ \;\;\;\;{\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) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 9: 66.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := \cos B \cdot \frac{-x}{\sin B}\\
t_1 := \frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\\
t_2 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - t_1\\
\mathbf{if}\;F \leq -5200:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -8.6 \cdot 10^{-94}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 8 \cdot 10^{-135}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.06 \cdot 10^{+71}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 6.8 \cdot 10^{+212}:\\
\;\;\;\;t_0\\

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


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

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

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

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

    if -5200 < F < -8.5999999999999997e-94 or 8.0000000000000003e-135 < F < 1.06e71

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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-inv83.9%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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. *-commutative83.9%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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-rr83.9%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 75.3%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 -8.5999999999999997e-94 < F < 8.0000000000000003e-135 or 1.06e71 < F < 6.80000000000000073e212

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/73.7%

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

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

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

    if 6.80000000000000073e212 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5200:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -8.6 \cdot 10^{-94}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-135}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{elif}\;F \leq 1.06 \cdot 10^{+71}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{+212}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 10: 66.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -9.2 \cdot 10^{-94}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq 1.22 \cdot 10^{+67}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 7.2 \cdot 10^{+213}:\\
\;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\

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


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

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

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

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

    if -1350 < F < -9.1999999999999997e-94 or 9.9999999999999999e-133 < F < 1.22000000000000004e67

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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-inv83.9%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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. *-commutative83.9%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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-rr83.9%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 75.3%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 -9.1999999999999997e-94 < F < 9.9999999999999999e-133

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 37.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/76.3%

        \[\leadsto \color{blue}{\frac{-x}{\sin B} \cdot \cos B} \]
      6. *-commutative76.3%

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

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    6. Step-by-step derivation
      1. *-commutative76.3%

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

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\sin B}} \cdot \cos B \]
      3. associate-*l/76.4%

        \[\leadsto \color{blue}{\frac{\left(-\left(-x\right)\right) \cdot \cos B}{-\sin B}} \]
      4. remove-double-neg76.4%

        \[\leadsto \frac{\color{blue}{x} \cdot \cos B}{-\sin B} \]
    7. Applied egg-rr76.4%

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

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

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

    if 1.22000000000000004e67 < F < 7.2000000000000002e213

    1. Initial program 69.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 65.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/66.6%

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

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

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

    if 7.2000000000000002e213 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1350:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.2 \cdot 10^{-94}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 10^{-132}:\\ \;\;\;\;\frac{x}{\frac{-\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{+67}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{+213}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 11: 66.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -9.5 \cdot 10^{-94}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq 9 \cdot 10^{+70}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 6.8 \cdot 10^{+212}:\\
\;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\

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


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

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

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

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

    if -3300 < F < -9.4999999999999997e-94 or 1.4e-131 < F < 8.9999999999999999e70

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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-inv83.9%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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. *-commutative83.9%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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-rr83.9%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 75.3%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 -9.4999999999999997e-94 < F < 1.4e-131

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 37.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/76.3%

        \[\leadsto \color{blue}{\frac{-x}{\sin B} \cdot \cos B} \]
      6. *-commutative76.3%

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

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    6. Step-by-step derivation
      1. *-commutative76.3%

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

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\sin B}} \cdot \cos B \]
      3. associate-*l/76.4%

        \[\leadsto \color{blue}{\frac{\left(-\left(-x\right)\right) \cdot \cos B}{-\sin B}} \]
      4. remove-double-neg76.4%

        \[\leadsto \frac{\color{blue}{x} \cdot \cos B}{-\sin B} \]
    7. Applied egg-rr76.4%

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

    if 8.9999999999999999e70 < F < 6.80000000000000073e212

    1. Initial program 69.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 65.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/66.6%

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

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

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

    if 6.80000000000000073e212 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3300:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-94}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-131}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+70}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{+212}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 12: 72.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -7.5 \cdot 10^{-94}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq 2.15 \cdot 10^{+67}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 7.2 \cdot 10^{+213}:\\
\;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\

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


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

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

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

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

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

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

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

    if -1e3 < F < -7.5000000000000003e-94 or 1.79999999999999989e-135 < F < 2.1500000000000001e67

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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-inv83.9%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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. *-commutative83.9%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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-rr83.9%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 75.3%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 -7.5000000000000003e-94 < F < 1.79999999999999989e-135

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 37.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/76.3%

        \[\leadsto \color{blue}{\frac{-x}{\sin B} \cdot \cos B} \]
      6. *-commutative76.3%

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

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    6. Step-by-step derivation
      1. *-commutative76.3%

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

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\sin B}} \cdot \cos B \]
      3. associate-*l/76.4%

        \[\leadsto \color{blue}{\frac{\left(-\left(-x\right)\right) \cdot \cos B}{-\sin B}} \]
      4. remove-double-neg76.4%

        \[\leadsto \frac{\color{blue}{x} \cdot \cos B}{-\sin B} \]
    7. Applied egg-rr76.4%

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

    if 2.1500000000000001e67 < F < 7.2000000000000002e213

    1. Initial program 69.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 65.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      5. associate-*l/66.6%

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

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

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

    if 7.2000000000000002e213 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{-94}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-135}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{+67}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{+213}:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 13: 58.3% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;F \leq -1.5 \cdot 10^{-138}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 5.6 \cdot 10^{-141}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{+68}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 6.8 \cdot 10^{+212}:\\
\;\;\;\;t_0\\

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


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

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

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

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

    if -1650 < F < -1.5e-138 or 5.60000000000000023e-141 < F < 2.3e68

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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-inv78.1%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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. *-commutative78.1%

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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-rr78.1%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 70.9%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\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 -1.5e-138 < F < 5.60000000000000023e-141 or 2.3e68 < F < 6.80000000000000073e212

    1. Initial program 90.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 46.5%

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

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

    if 6.80000000000000073e212 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1650:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.5 \cdot 10^{-138}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 5.6 \cdot 10^{-141}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{+68}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{+212}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 14: 58.3% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ t_1 := \frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\\ t_2 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t_1\\ \mathbf{if}\;F \leq -3900:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.6 \cdot 10^{-140}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-141}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{+71}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{+213}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (+ (* x (/ -1.0 (tan B))) (/ -1.0 B)))
        (t_1 (+ (/ x B) (* -0.3333333333333333 (* B x))))
        (t_2 (- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) t_1)))
   (if (<= F -3900.0)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -3.6e-140)
       t_2
       (if (<= F 4.6e-141)
         t_0
         (if (<= F 3.8e+71)
           t_2
           (if (<= F 7.2e+213) t_0 (- (/ 1.0 (sin B)) t_1))))))))
double code(double F, double B, double x) {
	double t_0 = (x * (-1.0 / tan(B))) + (-1.0 / B);
	double t_1 = (x / B) + (-0.3333333333333333 * (B * x));
	double t_2 = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1;
	double tmp;
	if (F <= -3900.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -3.6e-140) {
		tmp = t_2;
	} else if (F <= 4.6e-141) {
		tmp = t_0;
	} else if (F <= 3.8e+71) {
		tmp = t_2;
	} else if (F <= 7.2e+213) {
		tmp = t_0;
	} else {
		tmp = (1.0 / sin(B)) - 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))) + ((-1.0d0) / b)
    t_1 = (x / b) + ((-0.3333333333333333d0) * (b * x))
    t_2 = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - t_1
    if (f <= (-3900.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-3.6d-140)) then
        tmp = t_2
    else if (f <= 4.6d-141) then
        tmp = t_0
    else if (f <= 3.8d+71) then
        tmp = t_2
    else if (f <= 7.2d+213) then
        tmp = t_0
    else
        tmp = (1.0d0 / sin(b)) - 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))) + (-1.0 / B);
	double t_1 = (x / B) + (-0.3333333333333333 * (B * x));
	double t_2 = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1;
	double tmp;
	if (F <= -3900.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -3.6e-140) {
		tmp = t_2;
	} else if (F <= 4.6e-141) {
		tmp = t_0;
	} else if (F <= 3.8e+71) {
		tmp = t_2;
	} else if (F <= 7.2e+213) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	t_1 = (x / B) + (-0.3333333333333333 * (B * x))
	t_2 = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1
	tmp = 0
	if F <= -3900.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -3.6e-140:
		tmp = t_2
	elif F <= 4.6e-141:
		tmp = t_0
	elif F <= 3.8e+71:
		tmp = t_2
	elif F <= 7.2e+213:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B))
	t_1 = Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))
	t_2 = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - t_1)
	tmp = 0.0
	if (F <= -3900.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -3.6e-140)
		tmp = t_2;
	elseif (F <= 4.6e-141)
		tmp = t_0;
	elseif (F <= 3.8e+71)
		tmp = t_2;
	elseif (F <= 7.2e+213)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_1);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (x * (-1.0 / tan(B))) + (-1.0 / B);
	t_1 = (x / B) + (-0.3333333333333333 * (B * x));
	t_2 = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - t_1;
	tmp = 0.0;
	if (F <= -3900.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -3.6e-140)
		tmp = t_2;
	elseif (F <= 4.6e-141)
		tmp = t_0;
	elseif (F <= 3.8e+71)
		tmp = t_2;
	elseif (F <= 7.2e+213)
		tmp = t_0;
	else
		tmp = (1.0 / sin(B)) - t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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] - t$95$1), $MachinePrecision]}, If[LessEqual[F, -3900.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.6e-140], t$95$2, If[LessEqual[F, 4.6e-141], t$95$0, If[LessEqual[F, 3.8e+71], t$95$2, If[LessEqual[F, 7.2e+213], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -3.6 \cdot 10^{-140}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 4.6 \cdot 10^{-141}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 3.8 \cdot 10^{+71}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 7.2 \cdot 10^{+213}:\\
\;\;\;\;t_0\\

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


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

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

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

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

    if -3900 < F < -3.6e-140 or 4.5999999999999999e-141 < F < 3.8000000000000001e71

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 70.9%

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

    if -3.6e-140 < F < 4.5999999999999999e-141 or 3.8000000000000001e71 < F < 7.2000000000000002e213

    1. Initial program 90.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 46.5%

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

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

    if 7.2000000000000002e213 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3900:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.6 \cdot 10^{-140}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-141}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{+71}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{+213}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 15: 55.1% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq 3.05 \cdot 10^{+212}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\


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

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

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

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

    if -5.8e19 < F < 3.0499999999999999e212 or 7.49999999999999951e265 < F < 8.50000000000000061e290

    1. Initial program 91.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 46.2%

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

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

    if 3.0499999999999999e212 < F < 7.49999999999999951e265

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 61.2%

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

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

    if 8.50000000000000061e290 < F

    1. Initial program 0.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 0.2%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 83.5%

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

      \[\leadsto \color{blue}{\left(B \cdot \left(0.16666666666666666 - -0.3333333333333333 \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate--l+83.9%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 - -0.3333333333333333 \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. cancel-sign-sub-inv83.9%

        \[\leadsto B \cdot \color{blue}{\left(0.16666666666666666 + \left(--0.3333333333333333\right) \cdot x\right)} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. metadata-eval83.9%

        \[\leadsto B \cdot \left(0.16666666666666666 + \color{blue}{0.3333333333333333} \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      4. *-commutative83.9%

        \[\leadsto B \cdot \left(0.16666666666666666 + \color{blue}{x \cdot 0.3333333333333333}\right) + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      5. div-sub83.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{+19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.05 \cdot 10^{+212}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+265}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 16: 55.9% accurate, 2.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\


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

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

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

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

    if -6.2e19 < F < 7.2000000000000002e214

    1. Initial program 94.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 44.7%

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

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

    if 7.2000000000000002e214 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.2 \cdot 10^{+19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{+214}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 17: 43.9% accurate, 2.9× speedup?

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

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

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

\mathbf{elif}\;F \leq 2.5 \cdot 10^{+136}:\\
\;\;\;\;\frac{1}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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

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


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

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

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

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

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

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

    if -2.3e-63 < F < 3.9e-72

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    5. Simplified22.0%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    6. Taylor expanded in x around inf 37.4%

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

    if 3.9e-72 < F < 2.5000000000000001e136

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 63.6%

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

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

    if 2.5000000000000001e136 < F < 3.2000000000000001e270

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 60.9%

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

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

    if 3.2000000000000001e270 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 63.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.9 \cdot 10^{-72}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{+136}:\\ \;\;\;\;\frac{1}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+270}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 18: 50.9% accurate, 2.9× speedup?

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

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

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

\mathbf{elif}\;F \leq 5 \cdot 10^{+136}:\\
\;\;\;\;\frac{1}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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

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


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

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

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

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

    if -3.84999999999999986e-90 < F < 3.9e-72

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    5. Simplified22.6%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    6. Taylor expanded in x around inf 38.5%

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

    if 3.9e-72 < F < 5.0000000000000002e136

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 63.6%

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

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

    if 5.0000000000000002e136 < F < 1.44999999999999995e270

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 60.9%

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

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

    if 1.44999999999999995e270 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 63.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.85 \cdot 10^{-90}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.9 \cdot 10^{-72}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+136}:\\ \;\;\;\;\frac{1}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{+270}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 19: 37.5% accurate, 24.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{B}\\ \mathbf{if}\;F \leq -4 \cdot 10^{+222}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{+70}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -7.6:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-109}:\\ \;\;\;\;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 -4e+222)
     (/ -1.0 B)
     (if (<= F -2.8e+70)
       t_0
       (if (<= F -7.6) (/ -1.0 B) (if (<= F 2.4e-109) t_0 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
	double t_0 = -x / B;
	double tmp;
	if (F <= -4e+222) {
		tmp = -1.0 / B;
	} else if (F <= -2.8e+70) {
		tmp = t_0;
	} else if (F <= -7.6) {
		tmp = -1.0 / B;
	} else if (F <= 2.4e-109) {
		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 <= (-4d+222)) then
        tmp = (-1.0d0) / b
    else if (f <= (-2.8d+70)) then
        tmp = t_0
    else if (f <= (-7.6d0)) then
        tmp = (-1.0d0) / b
    else if (f <= 2.4d-109) 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 <= -4e+222) {
		tmp = -1.0 / B;
	} else if (F <= -2.8e+70) {
		tmp = t_0;
	} else if (F <= -7.6) {
		tmp = -1.0 / B;
	} else if (F <= 2.4e-109) {
		tmp = t_0;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / B
	tmp = 0
	if F <= -4e+222:
		tmp = -1.0 / B
	elif F <= -2.8e+70:
		tmp = t_0
	elif F <= -7.6:
		tmp = -1.0 / B
	elif F <= 2.4e-109:
		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 <= -4e+222)
		tmp = Float64(-1.0 / B);
	elseif (F <= -2.8e+70)
		tmp = t_0;
	elseif (F <= -7.6)
		tmp = Float64(-1.0 / B);
	elseif (F <= 2.4e-109)
		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 <= -4e+222)
		tmp = -1.0 / B;
	elseif (F <= -2.8e+70)
		tmp = t_0;
	elseif (F <= -7.6)
		tmp = -1.0 / B;
	elseif (F <= 2.4e-109)
		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, -4e+222], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, -2.8e+70], t$95$0, If[LessEqual[F, -7.6], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 2.4e-109], 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 -4 \cdot 10^{+222}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{elif}\;F \leq -2.8 \cdot 10^{+70}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -7.6:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-109}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.0000000000000002e222 or -2.7999999999999999e70 < F < -7.5999999999999996

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    5. Simplified54.6%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    6. Taylor expanded in x around 0 44.9%

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

    if -4.0000000000000002e222 < F < -2.7999999999999999e70 or -7.5999999999999996 < F < 2.39999999999999989e-109

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    5. Simplified31.1%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    6. Taylor expanded in x around inf 37.6%

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

    if 2.39999999999999989e-109 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 62.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+222}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{+70}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq -7.6:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-109}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 20: 43.9% accurate, 35.5× speedup?

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

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

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

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


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

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

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

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

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

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

    if -4.1999999999999997e-73 < F < 3.00000000000000021e-109

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    5. Simplified19.0%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    6. Taylor expanded in x around inf 35.5%

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

    if 3.00000000000000021e-109 < F

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

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\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 62.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-73}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-109}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 21: 31.5% accurate, 39.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{-58} \lor \neg \left(x \leq 1.15 \cdot 10^{-120}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -3.6e-58) (not (<= x 1.15e-120))) (/ (- x) B) (/ -1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -3.6e-58) || !(x <= 1.15e-120)) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-3.6d-58)) .or. (.not. (x <= 1.15d-120))) then
        tmp = -x / b
    else
        tmp = (-1.0d0) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -3.6e-58) || !(x <= 1.15e-120)) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -3.6e-58) or not (x <= 1.15e-120):
		tmp = -x / B
	else:
		tmp = -1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -3.6e-58) || !(x <= 1.15e-120))
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(-1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -3.6e-58) || ~((x <= 1.15e-120)))
		tmp = -x / B;
	else
		tmp = -1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -3.6e-58], N[Not[LessEqual[x, 1.15e-120]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-58} \lor \neg \left(x \leq 1.15 \cdot 10^{-120}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.60000000000000009e-58 or 1.14999999999999993e-120 < x

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    5. Simplified47.1%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    6. Taylor expanded in x around inf 52.3%

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

    if -3.60000000000000009e-58 < x < 1.14999999999999993e-120

    1. Initial program 71.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 31.8%

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

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

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

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    6. Taylor expanded in x around 0 21.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{-58} \lor \neg \left(x \leq 1.15 \cdot 10^{-120}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]

Alternative 22: 10.6% 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 76.5%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Taylor expanded in F around -inf 57.9%

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

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

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
  5. Simplified36.0%

    \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
  6. Taylor expanded in x around 0 12.0%

    \[\leadsto -\color{blue}{\frac{1}{B}} \]
  7. Final simplification12.0%

    \[\leadsto \frac{-1}{B} \]

Reproduce

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