VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.5% → 99.7%
Time: 23.2s
Alternatives: 26
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 26 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: 76.5% 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.7% accurate, 1.0× speedup?

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

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

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

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


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

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

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

    if -2e20 < F < 6e7

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. div-inv99.6%

        \[\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)} \]
      2. expm1-log1p-u75.6%

        \[\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)} \]
      3. expm1-udef53.0%

        \[\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)} \]
    3. Applied egg-rr53.0%

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

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

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

      \[\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 6e7 < F

    1. Initial program 64.2%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.3%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod15.7%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg15.7%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\sqrt{\frac{1}{\sin B}} \cdot \sqrt{\frac{1}{\sin B}}}\right) \]
      13. sqrt-unprod17.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\sqrt{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}}\right) \]
      14. frac-times17.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval17.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval17.7%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+99.8%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub099.8%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac99.8%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval99.8%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.8%

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

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

Alternative 2: 99.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.058:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \left(F \cdot t_0\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\

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


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

    1. Initial program 69.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}} \]

    if -1.94999999999999996 < F < 0.0580000000000000029

    1. Initial program 99.5%

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

        \[\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)} \]
      2. associate-/r/99.5%

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

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

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

    if 0.0580000000000000029 < F

    1. Initial program 65.0%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.9%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod16.6%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg16.6%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

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

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval17.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval17.3%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+99.5%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub099.5%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac99.5%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval99.5%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.5%

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

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

Alternative 3: 99.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.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}} \]

    if -1.44999999999999996 < F < 0.0580000000000000029

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 0.0580000000000000029 < F

    1. Initial program 65.0%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.9%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod16.6%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg16.6%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

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

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval17.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval17.3%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+99.5%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub099.5%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac99.5%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval99.5%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.5%

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

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

Alternative 4: 99.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.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}} \]

    if -1.3999999999999999 < F < 0.0580000000000000029

    1. Initial program 99.5%

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

        \[\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. associate-/l*99.4%

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\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{F}{\color{blue}{\sin B \cdot \sqrt{2 + 2 \cdot x}}} \]

    if 0.0580000000000000029 < F

    1. Initial program 65.0%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.9%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod16.6%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg16.6%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

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

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval17.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval17.3%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+99.5%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub099.5%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac99.5%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval99.5%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.5%

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

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

Alternative 5: 88.4% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -3.1 \cdot 10^{-173}:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 72.0%

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

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

    if -6.1999999999999999e-62 < F < -3.10000000000000005e-173 or 9.19999999999999984e-151 < F < 1.29999999999999989e-4

    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. clear-num99.3%

        \[\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)} \]
      2. associate-/r/99.4%

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

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

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

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

    if -3.10000000000000005e-173 < F < 9.19999999999999984e-151

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

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

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

    if 1.29999999999999989e-4 < F

    1. Initial program 65.0%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.9%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod16.6%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg16.6%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

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

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval17.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval17.3%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+99.5%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub099.5%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac99.5%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval99.5%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.2 \cdot 10^{-62}:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -3.1 \cdot 10^{-173}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-151}:\\ \;\;\;\;\frac{-x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.00013:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 6: 88.4% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -9 \cdot 10^{-173}:\\
\;\;\;\;\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 9.2 \cdot 10^{-151}:\\
\;\;\;\;\frac{-x \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 0.015:\\
\;\;\;\;\left(F \cdot t_0\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\

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


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

    1. Initial program 72.0%

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

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

    if -6.1999999999999999e-62 < F < -9.00000000000000037e-173

    1. Initial program 99.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 94.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 -9.00000000000000037e-173 < F < 9.19999999999999984e-151

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

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

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

    if 9.19999999999999984e-151 < F < 0.014999999999999999

    1. Initial program 99.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. clear-num99.0%

        \[\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)} \]
      2. associate-/r/99.2%

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

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

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

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

    if 0.014999999999999999 < F

    1. Initial program 65.0%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.9%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod16.6%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg16.6%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

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

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval17.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval17.3%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+99.5%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub099.5%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac99.5%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval99.5%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.2 \cdot 10^{-62}:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -9 \cdot 10^{-173}:\\ \;\;\;\;\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 9.2 \cdot 10^{-151}:\\ \;\;\;\;\frac{-x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.015:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 7: 91.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 7.6 \cdot 10^{-150}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t_1\\

\mathbf{elif}\;F \leq 0.01:\\
\;\;\;\;\left(F \cdot t_0\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\

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


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

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

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

    if -1.45e-19 < F < 7.5999999999999997e-150

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

      \[\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)} \]
    3. Step-by-step derivation
      1. div-inv99.7%

        \[\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)} \]
      2. expm1-log1p-u69.0%

        \[\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)} \]
      3. expm1-udef42.8%

        \[\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. Applied egg-rr36.2%

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

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

        \[\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)} \]
    6. Simplified92.8%

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

    if 7.5999999999999997e-150 < F < 0.0100000000000000002

    1. Initial program 99.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. clear-num99.0%

        \[\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)} \]
      2. associate-/r/99.2%

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

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

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

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

    if 0.0100000000000000002 < F

    1. Initial program 65.0%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.9%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod16.6%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg16.6%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

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

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval17.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval17.3%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+99.5%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub099.5%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac99.5%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval99.5%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-150}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.01:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 8: 66.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{if}\;F \leq -7.6 \cdot 10^{+222}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -0.027:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-64}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 4 \cdot 10^{+14}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+142}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{+243} \lor \neg \left(F \leq 1.8 \cdot 10^{+273}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (/ (sin B) (cos B)))))
   (if (<= F -7.6e+222)
     (- (/ -1.0 B) (* x (/ 1.0 (tan B))))
     (if (<= F -0.027)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 1.4e-64)
         t_0
         (if (<= F 4e+14)
           (-
            (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (* F (/ 1.0 B)))
            (/ x B))
           (if (<= F 1.8e+40)
             t_0
             (if (<= F 1.1e+142)
               (- (* (* F (/ 1.0 (sin B))) (/ 1.0 F)) (/ x B))
               (if (or (<= F 4.6e+243) (not (<= F 1.8e+273)))
                 t_0
                 (- (/ 1.0 B) (/ x B)))))))))))
double code(double F, double B, double x) {
	double t_0 = -x / (sin(B) / cos(B));
	double tmp;
	if (F <= -7.6e+222) {
		tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
	} else if (F <= -0.027) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 1.4e-64) {
		tmp = t_0;
	} else if (F <= 4e+14) {
		tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B);
	} else if (F <= 1.8e+40) {
		tmp = t_0;
	} else if (F <= 1.1e+142) {
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	} else if ((F <= 4.6e+243) || !(F <= 1.8e+273)) {
		tmp = t_0;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -x / (sin(b) / cos(b))
    if (f <= (-7.6d+222)) then
        tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
    else if (f <= (-0.027d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 1.4d-64) then
        tmp = t_0
    else if (f <= 4d+14) then
        tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f * (1.0d0 / b))) - (x / b)
    else if (f <= 1.8d+40) then
        tmp = t_0
    else if (f <= 1.1d+142) then
        tmp = ((f * (1.0d0 / sin(b))) * (1.0d0 / f)) - (x / b)
    else if ((f <= 4.6d+243) .or. (.not. (f <= 1.8d+273))) then
        tmp = t_0
    else
        tmp = (1.0d0 / b) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -x / (Math.sin(B) / Math.cos(B));
	double tmp;
	if (F <= -7.6e+222) {
		tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
	} else if (F <= -0.027) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 1.4e-64) {
		tmp = t_0;
	} else if (F <= 4e+14) {
		tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B);
	} else if (F <= 1.8e+40) {
		tmp = t_0;
	} else if (F <= 1.1e+142) {
		tmp = ((F * (1.0 / Math.sin(B))) * (1.0 / F)) - (x / B);
	} else if ((F <= 4.6e+243) || !(F <= 1.8e+273)) {
		tmp = t_0;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / (math.sin(B) / math.cos(B))
	tmp = 0
	if F <= -7.6e+222:
		tmp = (-1.0 / B) - (x * (1.0 / math.tan(B)))
	elif F <= -0.027:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 1.4e-64:
		tmp = t_0
	elif F <= 4e+14:
		tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B)
	elif F <= 1.8e+40:
		tmp = t_0
	elif F <= 1.1e+142:
		tmp = ((F * (1.0 / math.sin(B))) * (1.0 / F)) - (x / B)
	elif (F <= 4.6e+243) or not (F <= 1.8e+273):
		tmp = t_0
	else:
		tmp = (1.0 / B) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / Float64(sin(B) / cos(B)))
	tmp = 0.0
	if (F <= -7.6e+222)
		tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	elseif (F <= -0.027)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 1.4e-64)
		tmp = t_0;
	elseif (F <= 4e+14)
		tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F * Float64(1.0 / B))) - Float64(x / B));
	elseif (F <= 1.8e+40)
		tmp = t_0;
	elseif (F <= 1.1e+142)
		tmp = Float64(Float64(Float64(F * Float64(1.0 / sin(B))) * Float64(1.0 / F)) - Float64(x / B));
	elseif ((F <= 4.6e+243) || !(F <= 1.8e+273))
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / (sin(B) / cos(B));
	tmp = 0.0;
	if (F <= -7.6e+222)
		tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
	elseif (F <= -0.027)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 1.4e-64)
		tmp = t_0;
	elseif (F <= 4e+14)
		tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F * (1.0 / B))) - (x / B);
	elseif (F <= 1.8e+40)
		tmp = t_0;
	elseif (F <= 1.1e+142)
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	elseif ((F <= 4.6e+243) || ~((F <= 1.8e+273)))
		tmp = t_0;
	else
		tmp = (1.0 / B) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.6e+222], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -0.027], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-64], t$95$0, If[LessEqual[F, 4e+14], 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] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+40], t$95$0, If[LessEqual[F, 1.1e+142], N[(N[(N[(F * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.6e+243], N[Not[LessEqual[F, 1.8e+273]], $MachinePrecision]], t$95$0, N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -0.027:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-64}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{+142}:\\
\;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 4.6 \cdot 10^{+243} \lor \neg \left(F \leq 1.8 \cdot 10^{+273}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -7.60000000000000035e222

    1. Initial program 64.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. Taylor expanded in B around 0 99.7%

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

    if -7.60000000000000035e222 < F < -0.0269999999999999997

    1. Initial program 71.0%

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

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

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

    if -0.0269999999999999997 < F < 1.40000000000000002e-64 or 4e14 < F < 1.79999999999999998e40 or 1.09999999999999993e142 < F < 4.59999999999999974e243 or 1.80000000000000012e273 < F

    1. Initial program 87.0%

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

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

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

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

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

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

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

    if 1.40000000000000002e-64 < F < 4e14

    1. Initial program 99.3%

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

        \[\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)} \]
      2. associate-/r/99.5%

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

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

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

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

    if 1.79999999999999998e40 < F < 1.09999999999999993e142

    1. Initial program 92.2%

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

        \[\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)} \]
      2. associate-/r/92.3%

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

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

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

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

    if 4.59999999999999974e243 < F < 1.80000000000000012e273

    1. Initial program 1.0%

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

      \[\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)} \]
    3. Taylor expanded in B around 0 0.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{+222}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -0.027:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-64}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{+14}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+142}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{+243} \lor \neg \left(F \leq 1.8 \cdot 10^{+273}\right):\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 9: 66.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{if}\;F \leq -2.8 \cdot 10^{+221}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -55:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{+14}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+144}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.26 \cdot 10^{+243} \lor \neg \left(F \leq 8.2 \cdot 10^{+273}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (/ (sin B) (cos B)))))
   (if (<= F -2.8e+221)
     (- (/ -1.0 B) (* x (/ 1.0 (tan B))))
     (if (<= F -55.0)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 1.4e-60)
         (/ (- (* x (cos B))) (sin B))
         (if (<= F 5.4e+14)
           (-
            (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (* F (/ 1.0 B)))
            (/ x B))
           (if (<= F 1.8e+40)
             t_0
             (if (<= F 2.35e+144)
               (- (* (* F (/ 1.0 (sin B))) (/ 1.0 F)) (/ x B))
               (if (or (<= F 1.26e+243) (not (<= F 8.2e+273)))
                 t_0
                 (- (/ 1.0 B) (/ x B)))))))))))
double code(double F, double B, double x) {
	double t_0 = -x / (sin(B) / cos(B));
	double tmp;
	if (F <= -2.8e+221) {
		tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
	} else if (F <= -55.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 1.4e-60) {
		tmp = -(x * cos(B)) / sin(B);
	} else if (F <= 5.4e+14) {
		tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B);
	} else if (F <= 1.8e+40) {
		tmp = t_0;
	} else if (F <= 2.35e+144) {
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	} else if ((F <= 1.26e+243) || !(F <= 8.2e+273)) {
		tmp = t_0;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -x / (sin(b) / cos(b))
    if (f <= (-2.8d+221)) then
        tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
    else if (f <= (-55.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 1.4d-60) then
        tmp = -(x * cos(b)) / sin(b)
    else if (f <= 5.4d+14) then
        tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f * (1.0d0 / b))) - (x / b)
    else if (f <= 1.8d+40) then
        tmp = t_0
    else if (f <= 2.35d+144) then
        tmp = ((f * (1.0d0 / sin(b))) * (1.0d0 / f)) - (x / b)
    else if ((f <= 1.26d+243) .or. (.not. (f <= 8.2d+273))) then
        tmp = t_0
    else
        tmp = (1.0d0 / b) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -x / (Math.sin(B) / Math.cos(B));
	double tmp;
	if (F <= -2.8e+221) {
		tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
	} else if (F <= -55.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 1.4e-60) {
		tmp = -(x * Math.cos(B)) / Math.sin(B);
	} else if (F <= 5.4e+14) {
		tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B);
	} else if (F <= 1.8e+40) {
		tmp = t_0;
	} else if (F <= 2.35e+144) {
		tmp = ((F * (1.0 / Math.sin(B))) * (1.0 / F)) - (x / B);
	} else if ((F <= 1.26e+243) || !(F <= 8.2e+273)) {
		tmp = t_0;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / (math.sin(B) / math.cos(B))
	tmp = 0
	if F <= -2.8e+221:
		tmp = (-1.0 / B) - (x * (1.0 / math.tan(B)))
	elif F <= -55.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 1.4e-60:
		tmp = -(x * math.cos(B)) / math.sin(B)
	elif F <= 5.4e+14:
		tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B)
	elif F <= 1.8e+40:
		tmp = t_0
	elif F <= 2.35e+144:
		tmp = ((F * (1.0 / math.sin(B))) * (1.0 / F)) - (x / B)
	elif (F <= 1.26e+243) or not (F <= 8.2e+273):
		tmp = t_0
	else:
		tmp = (1.0 / B) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / Float64(sin(B) / cos(B)))
	tmp = 0.0
	if (F <= -2.8e+221)
		tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	elseif (F <= -55.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 1.4e-60)
		tmp = Float64(Float64(-Float64(x * cos(B))) / sin(B));
	elseif (F <= 5.4e+14)
		tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F * Float64(1.0 / B))) - Float64(x / B));
	elseif (F <= 1.8e+40)
		tmp = t_0;
	elseif (F <= 2.35e+144)
		tmp = Float64(Float64(Float64(F * Float64(1.0 / sin(B))) * Float64(1.0 / F)) - Float64(x / B));
	elseif ((F <= 1.26e+243) || !(F <= 8.2e+273))
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / (sin(B) / cos(B));
	tmp = 0.0;
	if (F <= -2.8e+221)
		tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
	elseif (F <= -55.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 1.4e-60)
		tmp = -(x * cos(B)) / sin(B);
	elseif (F <= 5.4e+14)
		tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F * (1.0 / B))) - (x / B);
	elseif (F <= 1.8e+40)
		tmp = t_0;
	elseif (F <= 2.35e+144)
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	elseif ((F <= 1.26e+243) || ~((F <= 8.2e+273)))
		tmp = t_0;
	else
		tmp = (1.0 / B) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.8e+221], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -55.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-60], N[((-N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e+14], 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] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+40], t$95$0, If[LessEqual[F, 2.35e+144], N[(N[(N[(F * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.26e+243], N[Not[LessEqual[F, 8.2e+273]], $MachinePrecision]], t$95$0, N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -55:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

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

\mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 2.35 \cdot 10^{+144}:\\
\;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.26 \cdot 10^{+243} \lor \neg \left(F \leq 8.2 \cdot 10^{+273}\right):\\
\;\;\;\;t_0\\

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


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

    1. Initial program 64.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. Taylor expanded in B around 0 99.7%

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

    if -2.79999999999999989e221 < F < -55

    1. Initial program 71.0%

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

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

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

    if -55 < F < 1.4000000000000001e-60

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

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

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

    if 1.4000000000000001e-60 < F < 5.4e14

    1. Initial program 99.3%

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

        \[\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)} \]
      2. associate-/r/99.5%

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

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

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

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

    if 5.4e14 < F < 1.79999999999999998e40 or 2.3500000000000001e144 < F < 1.26e243 or 8.19999999999999982e273 < F

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

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

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

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

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

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

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

    if 1.79999999999999998e40 < F < 2.3500000000000001e144

    1. Initial program 92.2%

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

        \[\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)} \]
      2. associate-/r/92.3%

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

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

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

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

    if 1.26e243 < F < 8.19999999999999982e273

    1. Initial program 1.0%

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

      \[\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)} \]
    3. Taylor expanded in B around 0 0.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{+221}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -55:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{+14}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+144}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.26 \cdot 10^{+243} \lor \neg \left(F \leq 8.2 \cdot 10^{+273}\right):\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 10: 78.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1250:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

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


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

    1. Initial program 64.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. Taylor expanded in B around 0 99.7%

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

    if -1.5000000000000001e224 < F < -1250

    1. Initial program 71.0%

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

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

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

    if -1250 < F < 1.19999999999999996e-49

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

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

    if 1.19999999999999996e-49 < F

    1. Initial program 66.9%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.5%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod15.8%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg15.8%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\sqrt{\frac{1}{\sin B}} \cdot \sqrt{\frac{1}{\sin B}}}\right) \]
      13. sqrt-unprod16.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\sqrt{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}}\right) \]
      14. frac-times16.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval16.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval16.7%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+95.4%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub095.4%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac95.4%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval95.4%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified95.4%

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

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

Alternative 11: 84.8% accurate, 1.5× speedup?

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

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

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

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


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

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

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

    if -1e-59 < F < 1.74999999999999996e-48

    1. Initial program 99.5%

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

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

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

    if 1.74999999999999996e-48 < F

    1. Initial program 66.9%

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt26.5%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} - \frac{-1}{\sin B}\right) \]
      4. sqrt-unprod15.8%

        \[\leadsto 0 - \left(\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      5. sqr-neg15.8%

        \[\leadsto 0 - \left(\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} - \frac{-1}{\sin B}\right) \]
      6. sqrt-unprod0.3%

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

        \[\leadsto 0 - \left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}} - \color{blue}{-1 \cdot \frac{1}{\sin B}}\right) \]
      8. add-sqr-sqrt0.7%

        \[\leadsto 0 - \left(\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} - -1 \cdot \frac{1}{\sin B}\right) \]
      9. cancel-sign-sub-inv0.7%

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{1} \cdot \frac{1}{\sin B}\right) \]
      11. *-un-lft-identity0.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}}\right) \]
      12. add-sqr-sqrt0.3%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\sqrt{\frac{1}{\sin B}} \cdot \sqrt{\frac{1}{\sin B}}}\right) \]
      13. sqrt-unprod16.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\sqrt{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}}\right) \]
      14. frac-times16.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{\sin B \cdot \sin B}}}\right) \]
      15. metadata-eval16.7%

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      16. metadata-eval16.7%

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

      \[\leadsto \color{blue}{0 - \left(\frac{-1}{\sin B} + \frac{x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. associate--r+95.4%

        \[\leadsto \color{blue}{\left(0 - \frac{-1}{\sin B}\right) - \frac{x}{\tan B}} \]
      2. neg-sub095.4%

        \[\leadsto \color{blue}{\left(-\frac{-1}{\sin B}\right)} - \frac{x}{\tan B} \]
      3. distribute-neg-frac95.4%

        \[\leadsto \color{blue}{\frac{--1}{\sin B}} - \frac{x}{\tan B} \]
      4. metadata-eval95.4%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified95.4%

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

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

Alternative 12: 44.7% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;B \leq 1.45 \cdot 10^{-196}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;B \leq 1.62 \cdot 10^{-170}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 5e-238

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

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

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

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

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

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

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

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

    if 5e-238 < B < 1.44999999999999994e-196

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified76.6%

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

    if 1.44999999999999994e-196 < B < 1.62e-170

    1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg100.0%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \left(-\frac{1}{B}\right) \]
      3. distribute-neg-in100.0%

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

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      6. distribute-neg-frac100.0%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      7. metadata-eval100.0%

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

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

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

    if 1.62e-170 < B < 0.00899999999999999932

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

      \[\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)} \]
    3. Taylor expanded in B around 0 81.3%

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

    if 0.00899999999999999932 < B

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

      \[\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)} \]
    3. Taylor expanded in F around inf 62.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 5 \cdot 10^{-238}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;B \leq 1.45 \cdot 10^{-196}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;B \leq 1.62 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;B \leq 0.009:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} + x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 13: 58.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ t_1 := x \cdot \frac{1}{\tan B}\\ t_2 := \frac{-1}{B} - t_1\\ \mathbf{if}\;F \leq -1.3 \cdot 10^{+224}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.36 \cdot 10^{-173}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.8 \cdot 10^{-290}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - t_1\\ \mathbf{elif}\;F \leq 2.25 \cdot 10^{-236}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-54}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_1\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-6}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{+138}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{+211}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)) (/ x B)))
        (t_1 (* x (/ 1.0 (tan B))))
        (t_2 (- (/ -1.0 B) t_1)))
   (if (<= F -1.3e+224)
     t_2
     (if (<= F -1.45e-19)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -1.36e-173)
         t_0
         (if (<= F -1.8e-290)
           (- (* (/ F B) (/ -1.0 F)) t_1)
           (if (<= F 2.25e-236)
             t_0
             (if (<= F 5e-54)
               (- (* (/ F B) (/ 1.0 F)) t_1)
               (if (<= F 3.6e-6)
                 t_0
                 (if (<= F 1.8e+40)
                   t_2
                   (if (<= F 2.2e+138)
                     (- (* (* F (/ 1.0 (sin B))) (/ 1.0 F)) (/ x B))
                     (if (<= F 1.35e+211) t_2 (- (/ 1.0 B) (/ x B))))))))))))))
double code(double F, double B, double x) {
	double t_0 = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	double t_1 = x * (1.0 / tan(B));
	double t_2 = (-1.0 / B) - t_1;
	double tmp;
	if (F <= -1.3e+224) {
		tmp = t_2;
	} else if (F <= -1.45e-19) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.36e-173) {
		tmp = t_0;
	} else if (F <= -1.8e-290) {
		tmp = ((F / B) * (-1.0 / F)) - t_1;
	} else if (F <= 2.25e-236) {
		tmp = t_0;
	} else if (F <= 5e-54) {
		tmp = ((F / B) * (1.0 / F)) - t_1;
	} else if (F <= 3.6e-6) {
		tmp = t_0;
	} else if (F <= 1.8e+40) {
		tmp = t_2;
	} else if (F <= 2.2e+138) {
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	} else if (F <= 1.35e+211) {
		tmp = t_2;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b)) - (x / b)
    t_1 = x * (1.0d0 / tan(b))
    t_2 = ((-1.0d0) / b) - t_1
    if (f <= (-1.3d+224)) then
        tmp = t_2
    else if (f <= (-1.45d-19)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.36d-173)) then
        tmp = t_0
    else if (f <= (-1.8d-290)) then
        tmp = ((f / b) * ((-1.0d0) / f)) - t_1
    else if (f <= 2.25d-236) then
        tmp = t_0
    else if (f <= 5d-54) then
        tmp = ((f / b) * (1.0d0 / f)) - t_1
    else if (f <= 3.6d-6) then
        tmp = t_0
    else if (f <= 1.8d+40) then
        tmp = t_2
    else if (f <= 2.2d+138) then
        tmp = ((f * (1.0d0 / sin(b))) * (1.0d0 / f)) - (x / b)
    else if (f <= 1.35d+211) then
        tmp = t_2
    else
        tmp = (1.0d0 / b) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	double t_1 = x * (1.0 / Math.tan(B));
	double t_2 = (-1.0 / B) - t_1;
	double tmp;
	if (F <= -1.3e+224) {
		tmp = t_2;
	} else if (F <= -1.45e-19) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.36e-173) {
		tmp = t_0;
	} else if (F <= -1.8e-290) {
		tmp = ((F / B) * (-1.0 / F)) - t_1;
	} else if (F <= 2.25e-236) {
		tmp = t_0;
	} else if (F <= 5e-54) {
		tmp = ((F / B) * (1.0 / F)) - t_1;
	} else if (F <= 3.6e-6) {
		tmp = t_0;
	} else if (F <= 1.8e+40) {
		tmp = t_2;
	} else if (F <= 2.2e+138) {
		tmp = ((F * (1.0 / Math.sin(B))) * (1.0 / F)) - (x / B);
	} else if (F <= 1.35e+211) {
		tmp = t_2;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B)
	t_1 = x * (1.0 / math.tan(B))
	t_2 = (-1.0 / B) - t_1
	tmp = 0
	if F <= -1.3e+224:
		tmp = t_2
	elif F <= -1.45e-19:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.36e-173:
		tmp = t_0
	elif F <= -1.8e-290:
		tmp = ((F / B) * (-1.0 / F)) - t_1
	elif F <= 2.25e-236:
		tmp = t_0
	elif F <= 5e-54:
		tmp = ((F / B) * (1.0 / F)) - t_1
	elif F <= 3.6e-6:
		tmp = t_0
	elif F <= 1.8e+40:
		tmp = t_2
	elif F <= 2.2e+138:
		tmp = ((F * (1.0 / math.sin(B))) * (1.0 / F)) - (x / B)
	elif F <= 1.35e+211:
		tmp = t_2
	else:
		tmp = (1.0 / B) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)) - Float64(x / B))
	t_1 = Float64(x * Float64(1.0 / tan(B)))
	t_2 = Float64(Float64(-1.0 / B) - t_1)
	tmp = 0.0
	if (F <= -1.3e+224)
		tmp = t_2;
	elseif (F <= -1.45e-19)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.36e-173)
		tmp = t_0;
	elseif (F <= -1.8e-290)
		tmp = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - t_1);
	elseif (F <= 2.25e-236)
		tmp = t_0;
	elseif (F <= 5e-54)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - t_1);
	elseif (F <= 3.6e-6)
		tmp = t_0;
	elseif (F <= 1.8e+40)
		tmp = t_2;
	elseif (F <= 2.2e+138)
		tmp = Float64(Float64(Float64(F * Float64(1.0 / sin(B))) * Float64(1.0 / F)) - Float64(x / B));
	elseif (F <= 1.35e+211)
		tmp = t_2;
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	t_1 = x * (1.0 / tan(B));
	t_2 = (-1.0 / B) - t_1;
	tmp = 0.0;
	if (F <= -1.3e+224)
		tmp = t_2;
	elseif (F <= -1.45e-19)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.36e-173)
		tmp = t_0;
	elseif (F <= -1.8e-290)
		tmp = ((F / B) * (-1.0 / F)) - t_1;
	elseif (F <= 2.25e-236)
		tmp = t_0;
	elseif (F <= 5e-54)
		tmp = ((F / B) * (1.0 / F)) - t_1;
	elseif (F <= 3.6e-6)
		tmp = t_0;
	elseif (F <= 1.8e+40)
		tmp = t_2;
	elseif (F <= 2.2e+138)
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	elseif (F <= 1.35e+211)
		tmp = t_2;
	else
		tmp = (1.0 / B) - (x / 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[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[F, -1.3e+224], t$95$2, If[LessEqual[F, -1.45e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.36e-173], t$95$0, If[LessEqual[F, -1.8e-290], N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 2.25e-236], t$95$0, If[LessEqual[F, 5e-54], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 3.6e-6], t$95$0, If[LessEqual[F, 1.8e+40], t$95$2, If[LessEqual[F, 2.2e+138], N[(N[(N[(F * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e+211], t$95$2, N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.45 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.36 \cdot 10^{-173}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -1.8 \cdot 10^{-290}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - t_1\\

\mathbf{elif}\;F \leq 2.25 \cdot 10^{-236}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 5 \cdot 10^{-54}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_1\\

\mathbf{elif}\;F \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 2.2 \cdot 10^{+138}:\\
\;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.35 \cdot 10^{+211}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if F < -1.3e224 or 3.59999999999999984e-6 < F < 1.79999999999999998e40 or 2.2000000000000001e138 < F < 1.35e211

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

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

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

    if -1.3e224 < F < -1.45e-19

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

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

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

    if -1.45e-19 < F < -1.3600000000000001e-173 or -1.7999999999999999e-290 < F < 2.24999999999999999e-236 or 5.00000000000000015e-54 < F < 3.59999999999999984e-6

    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 B around 0 90.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)} \]
    3. Taylor expanded in B around 0 73.9%

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

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

    if -1.3600000000000001e-173 < F < -1.7999999999999999e-290

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

      \[\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)} \]
    3. Taylor expanded in F around -inf 74.6%

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

    if 2.24999999999999999e-236 < F < 5.00000000000000015e-54

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

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

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

    if 1.79999999999999998e40 < F < 2.2000000000000001e138

    1. Initial program 92.2%

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

        \[\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)} \]
      2. associate-/r/92.3%

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

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

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

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

    if 1.35e211 < F

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

      \[\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)} \]
    3. Taylor expanded in B around 0 1.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{+224}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.36 \cdot 10^{-173}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.8 \cdot 10^{-290}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 2.25 \cdot 10^{-236}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-54}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-6}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{+138}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{+211}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 14: 44.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 2.6 \cdot 10^{-237}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{-196}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;B \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;B \leq 0.002:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 2.6e-237)
   (/ (- -1.0 x) B)
   (if (<= B 1.8e-196)
     (/ (- x) B)
     (if (<= B 5e-170)
       (- (/ -1.0 B) (/ x B))
       (if (<= B 0.002)
         (-
          (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (* F (/ 1.0 B)))
          (/ x B))
         (- (* (/ F B) (/ 1.0 F)) (* x (/ 1.0 (tan B)))))))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 2.6e-237) {
		tmp = (-1.0 - x) / B;
	} else if (B <= 1.8e-196) {
		tmp = -x / B;
	} else if (B <= 5e-170) {
		tmp = (-1.0 / B) - (x / B);
	} else if (B <= 0.002) {
		tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B);
	} else {
		tmp = ((F / B) * (1.0 / F)) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (b <= 2.6d-237) then
        tmp = ((-1.0d0) - x) / b
    else if (b <= 1.8d-196) then
        tmp = -x / b
    else if (b <= 5d-170) then
        tmp = ((-1.0d0) / b) - (x / b)
    else if (b <= 0.002d0) then
        tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f * (1.0d0 / b))) - (x / b)
    else
        tmp = ((f / b) * (1.0d0 / f)) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (B <= 2.6e-237) {
		tmp = (-1.0 - x) / B;
	} else if (B <= 1.8e-196) {
		tmp = -x / B;
	} else if (B <= 5e-170) {
		tmp = (-1.0 / B) - (x / B);
	} else if (B <= 0.002) {
		tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B);
	} else {
		tmp = ((F / B) * (1.0 / F)) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 2.6e-237:
		tmp = (-1.0 - x) / B
	elif B <= 1.8e-196:
		tmp = -x / B
	elif B <= 5e-170:
		tmp = (-1.0 / B) - (x / B)
	elif B <= 0.002:
		tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * (1.0 / B))) - (x / B)
	else:
		tmp = ((F / B) * (1.0 / F)) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 2.6e-237)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (B <= 1.8e-196)
		tmp = Float64(Float64(-x) / B);
	elseif (B <= 5e-170)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / B));
	elseif (B <= 0.002)
		tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F * Float64(1.0 / B))) - Float64(x / B));
	else
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (B <= 2.6e-237)
		tmp = (-1.0 - x) / B;
	elseif (B <= 1.8e-196)
		tmp = -x / B;
	elseif (B <= 5e-170)
		tmp = (-1.0 / B) - (x / B);
	elseif (B <= 0.002)
		tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F * (1.0 / B))) - (x / B);
	else
		tmp = ((F / B) * (1.0 / F)) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 2.6e-237], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 1.8e-196], N[((-x) / B), $MachinePrecision], If[LessEqual[B, 5e-170], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 0.002], 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] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.6 \cdot 10^{-237}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;B \leq 1.8 \cdot 10^{-196}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;B \leq 5 \cdot 10^{-170}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 2.6000000000000002e-237

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

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

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

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

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

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

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

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

    if 2.6000000000000002e-237 < B < 1.8e-196

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified76.6%

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

    if 1.8e-196 < B < 5.0000000000000001e-170

    1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg100.0%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \left(-\frac{1}{B}\right) \]
      3. distribute-neg-in100.0%

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

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      6. distribute-neg-frac100.0%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      7. metadata-eval100.0%

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

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

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

    if 5.0000000000000001e-170 < B < 2e-3

    1. Initial program 82.1%

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

        \[\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)} \]
      2. associate-/r/82.2%

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

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

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

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

    if 2e-3 < B

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

      \[\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)} \]
    3. Taylor expanded in F around inf 62.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.6 \cdot 10^{-237}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{-196}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;B \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;B \leq 0.002:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 15: 58.3% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{1}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ t_2 := \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \mathbf{if}\;F \leq -4.1 \cdot 10^{+222}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-238}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right) + t_2\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\ \mathbf{elif}\;F \leq 0.00031:\\ \;\;\;\;t_2 - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{+141}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+216}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ 1.0 (tan B))))
        (t_1 (- (/ -1.0 B) t_0))
        (t_2 (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B))))
   (if (<= F -4.1e+222)
     t_1
     (if (<= F -1.45e-19)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 5.2e-238)
         (+ (* x (- (/ -1.0 B) (* B -0.3333333333333333))) t_2)
         (if (<= F 3.5e-54)
           (- (* (/ F B) (/ 1.0 F)) t_0)
           (if (<= F 0.00031)
             (- t_2 (/ x B))
             (if (<= F 1.8e+40)
               t_1
               (if (<= F 2.15e+141)
                 (- (* (* F (/ 1.0 (sin B))) (/ 1.0 F)) (/ x B))
                 (if (<= F 1.1e+216) t_1 (- (/ 1.0 B) (/ x B))))))))))))
double code(double F, double B, double x) {
	double t_0 = x * (1.0 / tan(B));
	double t_1 = (-1.0 / B) - t_0;
	double t_2 = sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B);
	double tmp;
	if (F <= -4.1e+222) {
		tmp = t_1;
	} else if (F <= -1.45e-19) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 5.2e-238) {
		tmp = (x * ((-1.0 / B) - (B * -0.3333333333333333))) + t_2;
	} else if (F <= 3.5e-54) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else if (F <= 0.00031) {
		tmp = t_2 - (x / B);
	} else if (F <= 1.8e+40) {
		tmp = t_1;
	} else if (F <= 2.15e+141) {
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	} else if (F <= 1.1e+216) {
		tmp = t_1;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x * (1.0d0 / tan(b))
    t_1 = ((-1.0d0) / b) - t_0
    t_2 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b)
    if (f <= (-4.1d+222)) then
        tmp = t_1
    else if (f <= (-1.45d-19)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 5.2d-238) then
        tmp = (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0)))) + t_2
    else if (f <= 3.5d-54) then
        tmp = ((f / b) * (1.0d0 / f)) - t_0
    else if (f <= 0.00031d0) then
        tmp = t_2 - (x / b)
    else if (f <= 1.8d+40) then
        tmp = t_1
    else if (f <= 2.15d+141) then
        tmp = ((f * (1.0d0 / sin(b))) * (1.0d0 / f)) - (x / b)
    else if (f <= 1.1d+216) then
        tmp = t_1
    else
        tmp = (1.0d0 / b) - (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));
	double t_1 = (-1.0 / B) - t_0;
	double t_2 = Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B);
	double tmp;
	if (F <= -4.1e+222) {
		tmp = t_1;
	} else if (F <= -1.45e-19) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 5.2e-238) {
		tmp = (x * ((-1.0 / B) - (B * -0.3333333333333333))) + t_2;
	} else if (F <= 3.5e-54) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else if (F <= 0.00031) {
		tmp = t_2 - (x / B);
	} else if (F <= 1.8e+40) {
		tmp = t_1;
	} else if (F <= 2.15e+141) {
		tmp = ((F * (1.0 / Math.sin(B))) * (1.0 / F)) - (x / B);
	} else if (F <= 1.1e+216) {
		tmp = t_1;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (1.0 / math.tan(B))
	t_1 = (-1.0 / B) - t_0
	t_2 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)
	tmp = 0
	if F <= -4.1e+222:
		tmp = t_1
	elif F <= -1.45e-19:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 5.2e-238:
		tmp = (x * ((-1.0 / B) - (B * -0.3333333333333333))) + t_2
	elif F <= 3.5e-54:
		tmp = ((F / B) * (1.0 / F)) - t_0
	elif F <= 0.00031:
		tmp = t_2 - (x / B)
	elif F <= 1.8e+40:
		tmp = t_1
	elif F <= 2.15e+141:
		tmp = ((F * (1.0 / math.sin(B))) * (1.0 / F)) - (x / B)
	elif F <= 1.1e+216:
		tmp = t_1
	else:
		tmp = (1.0 / B) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(1.0 / tan(B)))
	t_1 = Float64(Float64(-1.0 / B) - t_0)
	t_2 = Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B))
	tmp = 0.0
	if (F <= -4.1e+222)
		tmp = t_1;
	elseif (F <= -1.45e-19)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 5.2e-238)
		tmp = Float64(Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333))) + t_2);
	elseif (F <= 3.5e-54)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - t_0);
	elseif (F <= 0.00031)
		tmp = Float64(t_2 - Float64(x / B));
	elseif (F <= 1.8e+40)
		tmp = t_1;
	elseif (F <= 2.15e+141)
		tmp = Float64(Float64(Float64(F * Float64(1.0 / sin(B))) * Float64(1.0 / F)) - Float64(x / B));
	elseif (F <= 1.1e+216)
		tmp = t_1;
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (1.0 / tan(B));
	t_1 = (-1.0 / B) - t_0;
	t_2 = sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B);
	tmp = 0.0;
	if (F <= -4.1e+222)
		tmp = t_1;
	elseif (F <= -1.45e-19)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 5.2e-238)
		tmp = (x * ((-1.0 / B) - (B * -0.3333333333333333))) + t_2;
	elseif (F <= 3.5e-54)
		tmp = ((F / B) * (1.0 / F)) - t_0;
	elseif (F <= 0.00031)
		tmp = t_2 - (x / B);
	elseif (F <= 1.8e+40)
		tmp = t_1;
	elseif (F <= 2.15e+141)
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	elseif (F <= 1.1e+216)
		tmp = t_1;
	else
		tmp = (1.0 / B) - (x / 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[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.1e+222], t$95$1, If[LessEqual[F, -1.45e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e-238], N[(N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[F, 3.5e-54], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.00031], N[(t$95$2 - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+40], t$95$1, If[LessEqual[F, 2.15e+141], N[(N[(N[(F * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e+216], t$95$1, N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.45 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

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

\mathbf{elif}\;F \leq 0.00031:\\
\;\;\;\;t_2 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 2.15 \cdot 10^{+141}:\\
\;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{+216}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if F < -4.09999999999999987e222 or 3.1e-4 < F < 1.79999999999999998e40 or 2.1499999999999999e141 < F < 1.1e216

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

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

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

    if -4.09999999999999987e222 < F < -1.45e-19

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

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

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

    if -1.45e-19 < F < 5.2000000000000002e-238

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

      \[\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)} \]
    3. Taylor expanded in B around 0 67.9%

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

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

    if 5.2000000000000002e-238 < F < 3.49999999999999982e-54

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

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

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

    if 3.49999999999999982e-54 < F < 3.1e-4

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

      \[\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)} \]
    3. Taylor expanded in B around 0 86.0%

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

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

    if 1.79999999999999998e40 < F < 2.1499999999999999e141

    1. Initial program 92.2%

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

        \[\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)} \]
      2. associate-/r/92.3%

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

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

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

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

    if 1.1e216 < F

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

      \[\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)} \]
    3. Taylor expanded in B around 0 1.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.1 \cdot 10^{+222}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-238}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right) + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 0.00031:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+40}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{+141}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+216}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 16: 44.7% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.2 \cdot 10^{-237}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;B \leq 1.95 \cdot 10^{-196}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;B \leq 2 \cdot 10^{-170}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.2e-237

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

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

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

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

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

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

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

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

    if 1.2e-237 < B < 1.95000000000000008e-196

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified76.6%

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

    if 1.95000000000000008e-196 < B < 1.99999999999999997e-170

    1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg100.0%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \left(-\frac{1}{B}\right) \]
      3. distribute-neg-in100.0%

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

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      6. distribute-neg-frac100.0%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      7. metadata-eval100.0%

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

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

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

    if 1.99999999999999997e-170 < B < 2e-3

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

      \[\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)} \]
    3. Taylor expanded in B around 0 80.7%

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

    if 2e-3 < B

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

      \[\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)} \]
    3. Taylor expanded in F around inf 62.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.2 \cdot 10^{-237}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;B \leq 1.95 \cdot 10^{-196}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;B \leq 2 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;B \leq 0.002:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 17: 56.4% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{1}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ t_2 := \frac{F}{B} \cdot \frac{-1}{F} - t_0\\ \mathbf{if}\;F \leq -7.2 \cdot 10^{+221}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.9:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4 \cdot 10^{-282}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+36}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{+146} \lor \neg \left(F \leq 1.9 \cdot 10^{+213}\right) \land F \leq 7.6 \cdot 10^{+273}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ 1.0 (tan B))))
        (t_1 (- (/ -1.0 B) t_0))
        (t_2 (- (* (/ F B) (/ -1.0 F)) t_0)))
   (if (<= F -7.2e+221)
     t_1
     (if (<= F -1.9)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -4e-282)
         t_2
         (if (<= F 7.2e-297)
           (/ (- x) B)
           (if (<= F 1.55e+36)
             t_2
             (if (or (<= F 9.5e+146)
                     (and (not (<= F 1.9e+213)) (<= F 7.6e+273)))
               (- (/ 1.0 B) (/ x B))
               t_1))))))))
double code(double F, double B, double x) {
	double t_0 = x * (1.0 / tan(B));
	double t_1 = (-1.0 / B) - t_0;
	double t_2 = ((F / B) * (-1.0 / F)) - t_0;
	double tmp;
	if (F <= -7.2e+221) {
		tmp = t_1;
	} else if (F <= -1.9) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -4e-282) {
		tmp = t_2;
	} else if (F <= 7.2e-297) {
		tmp = -x / B;
	} else if (F <= 1.55e+36) {
		tmp = t_2;
	} else if ((F <= 9.5e+146) || (!(F <= 1.9e+213) && (F <= 7.6e+273))) {
		tmp = (1.0 / B) - (x / B);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x * (1.0d0 / tan(b))
    t_1 = ((-1.0d0) / b) - t_0
    t_2 = ((f / b) * ((-1.0d0) / f)) - t_0
    if (f <= (-7.2d+221)) then
        tmp = t_1
    else if (f <= (-1.9d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-4d-282)) then
        tmp = t_2
    else if (f <= 7.2d-297) then
        tmp = -x / b
    else if (f <= 1.55d+36) then
        tmp = t_2
    else if ((f <= 9.5d+146) .or. (.not. (f <= 1.9d+213)) .and. (f <= 7.6d+273)) then
        tmp = (1.0d0 / b) - (x / b)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (1.0 / Math.tan(B));
	double t_1 = (-1.0 / B) - t_0;
	double t_2 = ((F / B) * (-1.0 / F)) - t_0;
	double tmp;
	if (F <= -7.2e+221) {
		tmp = t_1;
	} else if (F <= -1.9) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -4e-282) {
		tmp = t_2;
	} else if (F <= 7.2e-297) {
		tmp = -x / B;
	} else if (F <= 1.55e+36) {
		tmp = t_2;
	} else if ((F <= 9.5e+146) || (!(F <= 1.9e+213) && (F <= 7.6e+273))) {
		tmp = (1.0 / B) - (x / B);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (1.0 / math.tan(B))
	t_1 = (-1.0 / B) - t_0
	t_2 = ((F / B) * (-1.0 / F)) - t_0
	tmp = 0
	if F <= -7.2e+221:
		tmp = t_1
	elif F <= -1.9:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -4e-282:
		tmp = t_2
	elif F <= 7.2e-297:
		tmp = -x / B
	elif F <= 1.55e+36:
		tmp = t_2
	elif (F <= 9.5e+146) or (not (F <= 1.9e+213) and (F <= 7.6e+273)):
		tmp = (1.0 / B) - (x / B)
	else:
		tmp = t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(1.0 / tan(B)))
	t_1 = Float64(Float64(-1.0 / B) - t_0)
	t_2 = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - t_0)
	tmp = 0.0
	if (F <= -7.2e+221)
		tmp = t_1;
	elseif (F <= -1.9)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -4e-282)
		tmp = t_2;
	elseif (F <= 7.2e-297)
		tmp = Float64(Float64(-x) / B);
	elseif (F <= 1.55e+36)
		tmp = t_2;
	elseif ((F <= 9.5e+146) || (!(F <= 1.9e+213) && (F <= 7.6e+273)))
		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (1.0 / tan(B));
	t_1 = (-1.0 / B) - t_0;
	t_2 = ((F / B) * (-1.0 / F)) - t_0;
	tmp = 0.0;
	if (F <= -7.2e+221)
		tmp = t_1;
	elseif (F <= -1.9)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -4e-282)
		tmp = t_2;
	elseif (F <= 7.2e-297)
		tmp = -x / B;
	elseif (F <= 1.55e+36)
		tmp = t_2;
	elseif ((F <= 9.5e+146) || (~((F <= 1.9e+213)) && (F <= 7.6e+273)))
		tmp = (1.0 / B) - (x / B);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -7.2e+221], t$95$1, If[LessEqual[F, -1.9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4e-282], t$95$2, If[LessEqual[F, 7.2e-297], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 1.55e+36], t$95$2, If[Or[LessEqual[F, 9.5e+146], And[N[Not[LessEqual[F, 1.9e+213]], $MachinePrecision], LessEqual[F, 7.6e+273]]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
t_1 := \frac{-1}{B} - t_0\\
t_2 := \frac{F}{B} \cdot \frac{-1}{F} - t_0\\
\mathbf{if}\;F \leq -7.2 \cdot 10^{+221}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -1.9:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -4 \cdot 10^{-282}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;F \leq 1.55 \cdot 10^{+36}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 9.5 \cdot 10^{+146} \lor \neg \left(F \leq 1.9 \cdot 10^{+213}\right) \land F \leq 7.6 \cdot 10^{+273}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -7.20000000000000018e221 or 9.49999999999999926e146 < F < 1.8999999999999999e213 or 7.6e273 < F

    1. Initial program 64.8%

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

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

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

    if -7.20000000000000018e221 < F < -1.8999999999999999

    1. Initial program 71.0%

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

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

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

    if -1.8999999999999999 < F < -4.0000000000000001e-282 or 7.19999999999999988e-297 < F < 1.55e36

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

      \[\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)} \]
    3. Taylor expanded in F around -inf 57.3%

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

    if -4.0000000000000001e-282 < F < 7.19999999999999988e-297

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified88.7%

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

    if 1.55e36 < F < 9.49999999999999926e146 or 1.8999999999999999e213 < F < 7.6e273

    1. Initial program 61.0%

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

      \[\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)} \]
    3. Taylor expanded in B around 0 26.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.2 \cdot 10^{+221}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -1.9:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4 \cdot 10^{-282}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+36}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{+146} \lor \neg \left(F \leq 1.9 \cdot 10^{+213}\right) \land F \leq 7.6 \cdot 10^{+273}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 18: 58.4% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{1}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ \mathbf{if}\;F \leq -8.2 \cdot 10^{+222}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -850:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{-280}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - t_0\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-297}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+76}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{+137}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{+212}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ 1.0 (tan B)))) (t_1 (- (/ -1.0 B) t_0)))
   (if (<= F -8.2e+222)
     t_1
     (if (<= F -850.0)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -1.05e-280)
         (- (* (/ F B) (/ -1.0 F)) t_0)
         (if (<= F 7.5e-297)
           (/ (- x) B)
           (if (<= F 3.2e+76)
             (- (* (/ F B) (/ 1.0 F)) t_0)
             (if (<= F 2.1e+137)
               (- (* (* F (/ 1.0 (sin B))) (/ 1.0 F)) (/ x B))
               (if (<= F 6.6e+212) t_1 (- (/ 1.0 B) (/ x B)))))))))))
double code(double F, double B, double x) {
	double t_0 = x * (1.0 / tan(B));
	double t_1 = (-1.0 / B) - t_0;
	double tmp;
	if (F <= -8.2e+222) {
		tmp = t_1;
	} else if (F <= -850.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.05e-280) {
		tmp = ((F / B) * (-1.0 / F)) - t_0;
	} else if (F <= 7.5e-297) {
		tmp = -x / B;
	} else if (F <= 3.2e+76) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else if (F <= 2.1e+137) {
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	} else if (F <= 6.6e+212) {
		tmp = t_1;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x * (1.0d0 / tan(b))
    t_1 = ((-1.0d0) / b) - t_0
    if (f <= (-8.2d+222)) then
        tmp = t_1
    else if (f <= (-850.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.05d-280)) then
        tmp = ((f / b) * ((-1.0d0) / f)) - t_0
    else if (f <= 7.5d-297) then
        tmp = -x / b
    else if (f <= 3.2d+76) then
        tmp = ((f / b) * (1.0d0 / f)) - t_0
    else if (f <= 2.1d+137) then
        tmp = ((f * (1.0d0 / sin(b))) * (1.0d0 / f)) - (x / b)
    else if (f <= 6.6d+212) then
        tmp = t_1
    else
        tmp = (1.0d0 / b) - (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));
	double t_1 = (-1.0 / B) - t_0;
	double tmp;
	if (F <= -8.2e+222) {
		tmp = t_1;
	} else if (F <= -850.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.05e-280) {
		tmp = ((F / B) * (-1.0 / F)) - t_0;
	} else if (F <= 7.5e-297) {
		tmp = -x / B;
	} else if (F <= 3.2e+76) {
		tmp = ((F / B) * (1.0 / F)) - t_0;
	} else if (F <= 2.1e+137) {
		tmp = ((F * (1.0 / Math.sin(B))) * (1.0 / F)) - (x / B);
	} else if (F <= 6.6e+212) {
		tmp = t_1;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (1.0 / math.tan(B))
	t_1 = (-1.0 / B) - t_0
	tmp = 0
	if F <= -8.2e+222:
		tmp = t_1
	elif F <= -850.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.05e-280:
		tmp = ((F / B) * (-1.0 / F)) - t_0
	elif F <= 7.5e-297:
		tmp = -x / B
	elif F <= 3.2e+76:
		tmp = ((F / B) * (1.0 / F)) - t_0
	elif F <= 2.1e+137:
		tmp = ((F * (1.0 / math.sin(B))) * (1.0 / F)) - (x / B)
	elif F <= 6.6e+212:
		tmp = t_1
	else:
		tmp = (1.0 / B) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(1.0 / tan(B)))
	t_1 = Float64(Float64(-1.0 / B) - t_0)
	tmp = 0.0
	if (F <= -8.2e+222)
		tmp = t_1;
	elseif (F <= -850.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.05e-280)
		tmp = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - t_0);
	elseif (F <= 7.5e-297)
		tmp = Float64(Float64(-x) / B);
	elseif (F <= 3.2e+76)
		tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - t_0);
	elseif (F <= 2.1e+137)
		tmp = Float64(Float64(Float64(F * Float64(1.0 / sin(B))) * Float64(1.0 / F)) - Float64(x / B));
	elseif (F <= 6.6e+212)
		tmp = t_1;
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (1.0 / tan(B));
	t_1 = (-1.0 / B) - t_0;
	tmp = 0.0;
	if (F <= -8.2e+222)
		tmp = t_1;
	elseif (F <= -850.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.05e-280)
		tmp = ((F / B) * (-1.0 / F)) - t_0;
	elseif (F <= 7.5e-297)
		tmp = -x / B;
	elseif (F <= 3.2e+76)
		tmp = ((F / B) * (1.0 / F)) - t_0;
	elseif (F <= 2.1e+137)
		tmp = ((F * (1.0 / sin(B))) * (1.0 / F)) - (x / B);
	elseif (F <= 6.6e+212)
		tmp = t_1;
	else
		tmp = (1.0 / B) - (x / 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[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -8.2e+222], t$95$1, If[LessEqual[F, -850.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.05e-280], N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.5e-297], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 3.2e+76], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.1e+137], N[(N[(N[(F * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.6e+212], t$95$1, N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -850:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

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

\mathbf{elif}\;F \leq 3.2 \cdot 10^{+76}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\

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

\mathbf{elif}\;F \leq 6.6 \cdot 10^{+212}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if F < -8.19999999999999974e222 or 2.0999999999999999e137 < F < 6.6e212

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

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

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

    if -8.19999999999999974e222 < F < -850

    1. Initial program 71.0%

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

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

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

    if -850 < F < -1.05e-280

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

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

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

    if -1.05e-280 < F < 7.4999999999999994e-297

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified88.7%

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

    if 7.4999999999999994e-297 < F < 3.19999999999999976e76

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

      \[\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)} \]
    3. Taylor expanded in F around inf 57.4%

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

    if 3.19999999999999976e76 < F < 2.0999999999999999e137

    1. Initial program 86.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. clear-num86.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)} \]
      2. associate-/r/86.6%

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

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

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

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

    if 6.6e212 < F

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

      \[\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)} \]
    3. Taylor expanded in B around 0 1.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.2 \cdot 10^{+222}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -850:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{-280}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-297}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+76}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{+137}:\\ \;\;\;\;\left(F \cdot \frac{1}{\sin B}\right) \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{+212}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 19: 58.5% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \leq -122:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

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

\mathbf{elif}\;F \leq 7.5 \cdot 10^{+210}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -3.0000000000000001e224

    1. Initial program 64.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. Taylor expanded in B around 0 99.7%

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

    if -3.0000000000000001e224 < F < -122

    1. Initial program 71.0%

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

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

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

    if -122 < F < -5.9999999999999998e-294

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

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

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

    if -5.9999999999999998e-294 < F < 7.19999999999999988e-297

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified88.7%

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

    if 7.19999999999999988e-297 < F < 7.5e210

    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 B around 0 69.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)} \]
    3. Taylor expanded in F around inf 58.9%

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

    if 7.5e210 < F

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

      \[\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)} \]
    3. Taylor expanded in B around 0 1.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+224}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -122:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-294}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+210}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 20: 55.3% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -4.5 \cdot 10^{+223}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -3900:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-276}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{-238}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+212} \lor \neg \left(F \leq 1.8 \cdot 10^{+273}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 B) (* x (/ 1.0 (tan B))))))
   (if (<= F -4.5e+223)
     t_0
     (if (<= F -3900.0)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -2.5e-276)
         t_0
         (if (<= F 5.4e-238)
           (/ (- x) B)
           (if (or (<= F 3.2e+212) (not (<= F 1.8e+273)))
             t_0
             (- (/ 1.0 B) (/ x B)))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x * (1.0 / tan(B)));
	double tmp;
	if (F <= -4.5e+223) {
		tmp = t_0;
	} else if (F <= -3900.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -2.5e-276) {
		tmp = t_0;
	} else if (F <= 5.4e-238) {
		tmp = -x / B;
	} else if ((F <= 3.2e+212) || !(F <= 1.8e+273)) {
		tmp = t_0;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
    if (f <= (-4.5d+223)) then
        tmp = t_0
    else if (f <= (-3900.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-2.5d-276)) then
        tmp = t_0
    else if (f <= 5.4d-238) then
        tmp = -x / b
    else if ((f <= 3.2d+212) .or. (.not. (f <= 1.8d+273))) then
        tmp = t_0
    else
        tmp = (1.0d0 / b) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
	double tmp;
	if (F <= -4.5e+223) {
		tmp = t_0;
	} else if (F <= -3900.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -2.5e-276) {
		tmp = t_0;
	} else if (F <= 5.4e-238) {
		tmp = -x / B;
	} else if ((F <= 3.2e+212) || !(F <= 1.8e+273)) {
		tmp = t_0;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / B) - (x * (1.0 / math.tan(B)))
	tmp = 0
	if F <= -4.5e+223:
		tmp = t_0
	elif F <= -3900.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -2.5e-276:
		tmp = t_0
	elif F <= 5.4e-238:
		tmp = -x / B
	elif (F <= 3.2e+212) or not (F <= 1.8e+273):
		tmp = t_0
	else:
		tmp = (1.0 / B) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B))))
	tmp = 0.0
	if (F <= -4.5e+223)
		tmp = t_0;
	elseif (F <= -3900.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -2.5e-276)
		tmp = t_0;
	elseif (F <= 5.4e-238)
		tmp = Float64(Float64(-x) / B);
	elseif ((F <= 3.2e+212) || !(F <= 1.8e+273))
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 / B) - (x * (1.0 / tan(B)));
	tmp = 0.0;
	if (F <= -4.5e+223)
		tmp = t_0;
	elseif (F <= -3900.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -2.5e-276)
		tmp = t_0;
	elseif (F <= 5.4e-238)
		tmp = -x / B;
	elseif ((F <= 3.2e+212) || ~((F <= 1.8e+273)))
		tmp = t_0;
	else
		tmp = (1.0 / B) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.5e+223], t$95$0, If[LessEqual[F, -3900.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.5e-276], t$95$0, If[LessEqual[F, 5.4e-238], N[((-x) / B), $MachinePrecision], If[Or[LessEqual[F, 3.2e+212], N[Not[LessEqual[F, 1.8e+273]], $MachinePrecision]], t$95$0, N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -3900:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.5 \cdot 10^{-276}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 3.2 \cdot 10^{+212} \lor \neg \left(F \leq 1.8 \cdot 10^{+273}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -4.5e223 or -3900 < F < -2.49999999999999984e-276 or 5.39999999999999981e-238 < F < 3.1999999999999999e212 or 1.80000000000000012e273 < F

    1. Initial program 87.2%

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

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

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

    if -4.5e223 < F < -3900

    1. Initial program 71.0%

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

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

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

    if -2.49999999999999984e-276 < F < 5.39999999999999981e-238

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified70.3%

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

    if 3.1999999999999999e212 < F < 1.80000000000000012e273

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

      \[\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)} \]
    3. Taylor expanded in B around 0 0.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{+223}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -3900:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-276}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{-238}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+212} \lor \neg \left(F \leq 1.8 \cdot 10^{+273}\right):\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 21: 51.7% accurate, 3.0× speedup?

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

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

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

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


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

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

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

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

    if -1.22e-60 < F < 2.9000000000000001e-43

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified45.6%

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

    if 2.9000000000000001e-43 < F

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

      \[\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)} \]
    3. Taylor expanded in B around 0 29.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.22 \cdot 10^{-60}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.9 \cdot 10^{-43}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 22: 44.4% accurate, 29.1× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg57.9%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \left(-\frac{1}{B}\right) \]
      3. distribute-neg-in57.9%

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

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      6. distribute-neg-frac57.9%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      7. metadata-eval57.9%

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

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

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

    if -9.0999999999999997e-60 < F < 1.55999999999999996e-40

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified45.6%

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

    if 1.55999999999999996e-40 < F

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

      \[\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)} \]
    3. Taylor expanded in B around 0 29.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.1 \cdot 10^{-60}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.56 \cdot 10^{-40}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 23: 37.4% accurate, 35.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -1.16e-59

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg57.9%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \left(-\frac{1}{B}\right) \]
      3. distribute-neg-in57.9%

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

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      6. distribute-neg-frac57.9%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      7. metadata-eval57.9%

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

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

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

    if -1.16e-59 < F

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.16 \cdot 10^{-59}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 24: 37.4% accurate, 45.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -9.2000000000000005e-60

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

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

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

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

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

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

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

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

    if -9.2000000000000005e-60 < F

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.2 \cdot 10^{-60}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 25: 30.2% accurate, 81.0× speedup?

\[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
	return -x / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -x / b
end function
public static double code(double F, double B, double x) {
	return -x / B;
}
def code(F, B, x):
	return -x / B
function code(F, B, x)
	return Float64(Float64(-x) / B)
end
function tmp = code(F, B, x)
	tmp = -x / B;
end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-x}{B}
\end{array}
Derivation
  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 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 26: 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 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 59.9%

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

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

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

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

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

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

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

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

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

Reproduce

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