VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.3% → 99.6%
Time: 27.4s
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: 77.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.35 \cdot 10^{+43}:\\ \;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \mathbf{elif}\;F \leq 20000:\\ \;\;\;\;\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 -2.35e+43)
     (- (/ -1.0 (sin B)) (* (cos B) (/ x (sin B))))
     (if (<= F 20000.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 <= -2.35e+43) {
		tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	} else if (F <= 20000.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 <= (-2.35d+43)) then
        tmp = ((-1.0d0) / sin(b)) - (cos(b) * (x / sin(b)))
    else if (f <= 20000.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 <= -2.35e+43) {
		tmp = (-1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
	} else if (F <= 20000.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 <= -2.35e+43:
		tmp = (-1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B)))
	elif F <= 20000.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 <= -2.35e+43)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	elseif (F <= 20000.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 <= -2.35e+43)
		tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	elseif (F <= 20000.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, -2.35e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 20000.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.35 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\

\mathbf{elif}\;F \leq 20000:\\
\;\;\;\;\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 < -2.34999999999999999e43

    1. Initial program 60.7%

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

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

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

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

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

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

    if -2.34999999999999999e43 < F < 2e4

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt23.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-unprod12.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \left(\left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{-1}{\sin B} \cdot \frac{-1}{\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.35 \cdot 10^{+43}:\\ \;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \mathbf{elif}\;F \leq 20000:\\ \;\;\;\;\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: 98.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.98:\\ \;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{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.98)
   (- (/ -1.0 (sin B)) (* (cos B) (/ x (sin B))))
   (if (<= F 3.4e-6)
     (+
      (* x (/ -1.0 (tan B)))
      (* (/ F (sin B)) (sqrt (/ 1.0 (+ 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.98) {
		tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	} else if (F <= 3.4e-6) {
		tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / (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.98d0)) then
        tmp = ((-1.0d0) / sin(b)) - (cos(b) * (x / sin(b)))
    else if (f <= 3.4d-6) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * sqrt((1.0d0 / (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.98) {
		tmp = (-1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
	} else if (F <= 3.4e-6) {
		tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.98:
		tmp = (-1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B)))
	elif F <= 3.4e-6:
		tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))
	else:
		tmp = (1.0 / math.sin(B)) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.98)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	elseif (F <= 3.4e-6)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.98)
		tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	elseif (F <= 3.4e-6)
		tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / (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.98], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e-6], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

    if -1.98 < F < 3.40000000000000006e-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 F around 0 98.8%

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

    if 3.40000000000000006e-6 < F

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

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

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

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

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

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

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

        \[\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. add-sqr-sqrt0.8%

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

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

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

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

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

        \[\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-unprod18.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-times18.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-eval18.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-eval18.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) \]
      17. frac-times18.3%

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

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

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

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

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

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

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

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

Alternative 3: 98.8% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 3.4 \cdot 10^{-6}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - x \cdot \frac{1}{\tan 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.32000000000000006

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

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

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

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

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

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

    if -1.32000000000000006 < F < 3.40000000000000006e-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. Step-by-step derivation
      1. associate-*l/99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.40000000000000006e-6 < F

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

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

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

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

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

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

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

        \[\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. add-sqr-sqrt0.8%

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

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

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

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

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

        \[\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-unprod18.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-times18.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-eval18.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-eval18.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) \]
      17. frac-times18.3%

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

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

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

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

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

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

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

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

Alternative 4: 92.1% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq -7 \cdot 10^{-120}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 3.4 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t_0 \cdot \frac{F}{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 < -700

    1. Initial program 66.0%

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

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

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

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

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

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

    if -700 < F < -7e-120

    1. Initial program 99.4%

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

      \[\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 -7e-120 < F < 3.40000000000000006e-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 79.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)} \]

    if 3.40000000000000006e-6 < F

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

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

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

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

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

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

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

        \[\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. add-sqr-sqrt0.8%

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

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

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

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

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

        \[\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-unprod18.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-times18.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-eval18.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-eval18.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) \]
      17. frac-times18.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -700:\\ \;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \mathbf{elif}\;F \leq -7 \cdot 10^{-120}:\\ \;\;\;\;\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 3.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 5: 92.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -6.2 \cdot 10^{-120}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 3.4 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t_0 \cdot \frac{F}{B}\\

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


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

    1. Initial program 66.0%

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

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

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

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

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

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

    if -600 < F < -6.20000000000000038e-120

    1. Initial program 99.4%

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

      \[\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 -6.20000000000000038e-120 < F < 3.40000000000000006e-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 79.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)} \]

    if 3.40000000000000006e-6 < F

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

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

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

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

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

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

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

        \[\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. add-sqr-sqrt0.8%

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

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

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

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

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

        \[\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-unprod18.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-times18.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-eval18.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-eval18.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) \]
      17. frac-times18.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -600:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-120}:\\ \;\;\;\;\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 3.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 6: 89.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -7.2 \cdot 10^{-175}:\\
\;\;\;\;t_0\\

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

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

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


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

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

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

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

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

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

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

    if -0.034000000000000002 < F < -7.2e-175 or 2.8500000000000001e-196 < F < 3.40000000000000006e-6

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.2e-175 < F < 2.8500000000000001e-196

    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 F around -inf 41.9%

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

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

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

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

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

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

    if 3.40000000000000006e-6 < F

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

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

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

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

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

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

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

        \[\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. add-sqr-sqrt0.8%

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

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

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

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

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

        \[\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-unprod18.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-times18.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-eval18.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-eval18.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) \]
      17. frac-times18.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.034:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-175}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.85 \cdot 10^{-196}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 7: 92.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -7.6 \cdot 10^{-120}:\\
\;\;\;\;\frac{F \cdot t_0}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 3.4 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t_0 \cdot \frac{F}{B}\\

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


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

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

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

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

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

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

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

    if -0.17999999999999999 < F < -7.5999999999999995e-120

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5999999999999995e-120 < F < 3.40000000000000006e-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 79.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 F around 0 79.1%

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

    if 3.40000000000000006e-6 < F

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

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

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

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

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

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

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

        \[\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. add-sqr-sqrt0.8%

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

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

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

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

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

        \[\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-unprod18.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-times18.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-eval18.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-eval18.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) \]
      17. frac-times18.3%

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

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

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

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

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

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

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

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

Alternative 8: 92.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -720:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq -7 \cdot 10^{-120}:\\ \;\;\;\;\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 3.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \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 -720.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F -7e-120)
       (- (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) (/ x B))
       (if (<= F 3.4e-6)
         (+
          (* x (/ -1.0 (tan B)))
          (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -720.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= -7e-120) {
		tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
	} else if (F <= 3.4e-6) {
		tmp = (x * (-1.0 / tan(B))) + (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B));
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-720.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= (-7d-120)) then
        tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
    else if (f <= 3.4d-6) then
        tmp = (x * ((-1.0d0) / tan(b))) + (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b))
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -720.0) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= -7e-120) {
		tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
	} else if (F <= 3.4e-6) {
		tmp = (x * (-1.0 / Math.tan(B))) + (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B));
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -720.0:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= -7e-120:
		tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B)
	elif F <= 3.4e-6:
		tmp = (x * (-1.0 / math.tan(B))) + (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B))
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -720.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= -7e-120)
		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 <= 3.4e-6)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -720.0)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= -7e-120)
		tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / B);
	elseif (F <= 3.4e-6)
		tmp = (x * (-1.0 / tan(B))) + (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B));
	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, -720.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -7e-120], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e-6], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 66.0%

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

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

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

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

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

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

    if -720 < F < -7e-120

    1. Initial program 99.4%

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

      \[\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 -7e-120 < F < 3.40000000000000006e-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 79.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 F around 0 79.1%

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

    if 3.40000000000000006e-6 < F

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

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

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

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

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

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

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

        \[\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. add-sqr-sqrt0.8%

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

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

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

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

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

        \[\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-unprod18.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-times18.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-eval18.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-eval18.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) \]
      17. frac-times18.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -720:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7 \cdot 10^{-120}:\\ \;\;\;\;\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 3.4 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 9: 70.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -2.8 \cdot 10^{+237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -2.2 \cdot 10^{+130}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.22 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -8.5:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -5.2 \cdot 10^{-125}:\\ \;\;\;\;{\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{elif}\;F \leq 4.6 \cdot 10^{-69}:\\ \;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))) (t_1 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= F -2.8e+237)
     t_1
     (if (<= F -2.2e+130)
       t_0
       (if (<= F -1.22e+27)
         t_1
         (if (<= F -8.5)
           t_0
           (if (<= F -5.2e-125)
             (+
              (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
              (* x (- (/ -1.0 B) (* B -0.3333333333333333))))
             (if (<= F 4.6e-69)
               (- (/ (* (cos B) x) (sin B)))
               (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / tan(B));
	double t_1 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -2.8e+237) {
		tmp = t_1;
	} else if (F <= -2.2e+130) {
		tmp = t_0;
	} else if (F <= -1.22e+27) {
		tmp = t_1;
	} else if (F <= -8.5) {
		tmp = t_0;
	} else if (F <= -5.2e-125) {
		tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	} else if (F <= 4.6e-69) {
		tmp = -((cos(B) * x) / sin(B));
	} else {
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((-1.0d0) / b) - (x / tan(b))
    t_1 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-2.8d+237)) then
        tmp = t_1
    else if (f <= (-2.2d+130)) then
        tmp = t_0
    else if (f <= (-1.22d+27)) then
        tmp = t_1
    else if (f <= (-8.5d0)) then
        tmp = t_0
    else if (f <= (-5.2d-125)) then
        tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
    else if (f <= 4.6d-69) then
        tmp = -((cos(b) * x) / sin(b))
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / Math.tan(B));
	double t_1 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -2.8e+237) {
		tmp = t_1;
	} else if (F <= -2.2e+130) {
		tmp = t_0;
	} else if (F <= -1.22e+27) {
		tmp = t_1;
	} else if (F <= -8.5) {
		tmp = t_0;
	} else if (F <= -5.2e-125) {
		tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	} else if (F <= 4.6e-69) {
		tmp = -((Math.cos(B) * x) / Math.sin(B));
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / B) - (x / math.tan(B))
	t_1 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -2.8e+237:
		tmp = t_1
	elif F <= -2.2e+130:
		tmp = t_0
	elif F <= -1.22e+27:
		tmp = t_1
	elif F <= -8.5:
		tmp = t_0
	elif F <= -5.2e-125:
		tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)))
	elif F <= 4.6e-69:
		tmp = -((math.cos(B) * x) / math.sin(B))
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -2.8e+237)
		tmp = t_1;
	elseif (F <= -2.2e+130)
		tmp = t_0;
	elseif (F <= -1.22e+27)
		tmp = t_1;
	elseif (F <= -8.5)
		tmp = t_0;
	elseif (F <= -5.2e-125)
		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))));
	elseif (F <= 4.6e-69)
		tmp = Float64(-Float64(Float64(cos(B) * x) / sin(B)));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 / B) - (x / tan(B));
	t_1 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -2.8e+237)
		tmp = t_1;
	elseif (F <= -2.2e+130)
		tmp = t_0;
	elseif (F <= -1.22e+27)
		tmp = t_1;
	elseif (F <= -8.5)
		tmp = t_0;
	elseif (F <= -5.2e-125)
		tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	elseif (F <= 4.6e-69)
		tmp = -((cos(B) * x) / sin(B));
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.8e+237], t$95$1, If[LessEqual[F, -2.2e+130], t$95$0, If[LessEqual[F, -1.22e+27], t$95$1, If[LessEqual[F, -8.5], t$95$0, If[LessEqual[F, -5.2e-125], 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], If[LessEqual[F, 4.6e-69], (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -2.2 \cdot 10^{+130}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq -8.5:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -5.2 \cdot 10^{-125}:\\
\;\;\;\;{\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{elif}\;F \leq 4.6 \cdot 10^{-69}:\\
\;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -2.79999999999999983e237 or -2.19999999999999993e130 < F < -1.2200000000000001e27

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

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

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

    if -2.79999999999999983e237 < F < -2.19999999999999993e130 or -1.2200000000000001e27 < F < -8.5

    1. Initial program 68.7%

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr80.9%

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

    if -8.5 < F < -5.20000000000000011e-125

    1. Initial program 99.4%

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

      \[\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 -5.20000000000000011e-125 < F < 4.6000000000000001e-69

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

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

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

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

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

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

    if 4.6000000000000001e-69 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.2 \cdot 10^{+130}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.22 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -8.5:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5.2 \cdot 10^{-125}:\\ \;\;\;\;{\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{elif}\;F \leq 4.6 \cdot 10^{-69}:\\ \;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 10: 70.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -2.8 \cdot 10^{+237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -4.9 \cdot 10^{+129}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.25 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -340:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -2.9 \cdot 10^{-121}:\\ \;\;\;\;{\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{elif}\;F \leq 3.95 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))) (t_1 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= F -2.8e+237)
     t_1
     (if (<= F -4.9e+129)
       t_0
       (if (<= F -1.25e+27)
         t_1
         (if (<= F -340.0)
           t_0
           (if (<= F -2.9e-121)
             (+
              (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
              (* x (- (/ -1.0 B) (* B -0.3333333333333333))))
             (if (<= F 3.95e-69)
               (/ (- x) (/ (sin B) (cos B)))
               (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / tan(B));
	double t_1 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -2.8e+237) {
		tmp = t_1;
	} else if (F <= -4.9e+129) {
		tmp = t_0;
	} else if (F <= -1.25e+27) {
		tmp = t_1;
	} else if (F <= -340.0) {
		tmp = t_0;
	} else if (F <= -2.9e-121) {
		tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	} else if (F <= 3.95e-69) {
		tmp = -x / (sin(B) / cos(B));
	} else {
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((-1.0d0) / b) - (x / tan(b))
    t_1 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-2.8d+237)) then
        tmp = t_1
    else if (f <= (-4.9d+129)) then
        tmp = t_0
    else if (f <= (-1.25d+27)) then
        tmp = t_1
    else if (f <= (-340.0d0)) then
        tmp = t_0
    else if (f <= (-2.9d-121)) then
        tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
    else if (f <= 3.95d-69) then
        tmp = -x / (sin(b) / cos(b))
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / Math.tan(B));
	double t_1 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -2.8e+237) {
		tmp = t_1;
	} else if (F <= -4.9e+129) {
		tmp = t_0;
	} else if (F <= -1.25e+27) {
		tmp = t_1;
	} else if (F <= -340.0) {
		tmp = t_0;
	} else if (F <= -2.9e-121) {
		tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	} else if (F <= 3.95e-69) {
		tmp = -x / (Math.sin(B) / Math.cos(B));
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / B) - (x / math.tan(B))
	t_1 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -2.8e+237:
		tmp = t_1
	elif F <= -4.9e+129:
		tmp = t_0
	elif F <= -1.25e+27:
		tmp = t_1
	elif F <= -340.0:
		tmp = t_0
	elif F <= -2.9e-121:
		tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)))
	elif F <= 3.95e-69:
		tmp = -x / (math.sin(B) / math.cos(B))
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -2.8e+237)
		tmp = t_1;
	elseif (F <= -4.9e+129)
		tmp = t_0;
	elseif (F <= -1.25e+27)
		tmp = t_1;
	elseif (F <= -340.0)
		tmp = t_0;
	elseif (F <= -2.9e-121)
		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))));
	elseif (F <= 3.95e-69)
		tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B)));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 / B) - (x / tan(B));
	t_1 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -2.8e+237)
		tmp = t_1;
	elseif (F <= -4.9e+129)
		tmp = t_0;
	elseif (F <= -1.25e+27)
		tmp = t_1;
	elseif (F <= -340.0)
		tmp = t_0;
	elseif (F <= -2.9e-121)
		tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	elseif (F <= 3.95e-69)
		tmp = -x / (sin(B) / cos(B));
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.8e+237], t$95$1, If[LessEqual[F, -4.9e+129], t$95$0, If[LessEqual[F, -1.25e+27], t$95$1, If[LessEqual[F, -340.0], t$95$0, If[LessEqual[F, -2.9e-121], 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], If[LessEqual[F, 3.95e-69], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -4.9 \cdot 10^{+129}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -1.25 \cdot 10^{+27}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -340:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -2.9 \cdot 10^{-121}:\\
\;\;\;\;{\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{elif}\;F \leq 3.95 \cdot 10^{-69}:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -2.79999999999999983e237 or -4.9e129 < F < -1.24999999999999995e27

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

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

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

    if -2.79999999999999983e237 < F < -4.9e129 or -1.24999999999999995e27 < F < -340

    1. Initial program 68.7%

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr80.9%

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

    if -340 < F < -2.9e-121

    1. Initial program 99.4%

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

      \[\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 -2.9e-121 < F < 3.9500000000000001e-69

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

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

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

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

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

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

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

    if 3.9500000000000001e-69 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.9 \cdot 10^{+129}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.25 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -340:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.9 \cdot 10^{-121}:\\ \;\;\;\;{\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{elif}\;F \leq 3.95 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 11: 84.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.058:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq -5.6 \cdot 10^{-122}:\\ \;\;\;\;{\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{elif}\;F \leq 4.8 \cdot 10^{-66}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \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 -0.058)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F -5.6e-122)
       (+
        (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
        (* x (- (/ -1.0 B) (* B -0.3333333333333333))))
       (if (<= F 4.8e-66)
         (/ (- x) (/ (sin B) (cos B)))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -0.058) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= -5.6e-122) {
		tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	} else if (F <= 4.8e-66) {
		tmp = -x / (sin(B) / cos(B));
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-0.058d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= (-5.6d-122)) then
        tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
    else if (f <= 4.8d-66) then
        tmp = -x / (sin(b) / cos(b))
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -0.058) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= -5.6e-122) {
		tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	} else if (F <= 4.8e-66) {
		tmp = -x / (Math.sin(B) / Math.cos(B));
	} 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 <= -0.058:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= -5.6e-122:
		tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)))
	elif F <= 4.8e-66:
		tmp = -x / (math.sin(B) / math.cos(B))
	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 <= -0.058)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= -5.6e-122)
		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))));
	elseif (F <= 4.8e-66)
		tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -0.058)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= -5.6e-122)
		tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	elseif (F <= 4.8e-66)
		tmp = -x / (sin(B) / cos(B));
	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, -0.058], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -5.6e-122], 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], If[LessEqual[F, 4.8e-66], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -5.6 \cdot 10^{-122}:\\
\;\;\;\;{\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{elif}\;F \leq 4.8 \cdot 10^{-66}:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\

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


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

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

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

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

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

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

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

    if -0.0580000000000000029 < F < -5.5999999999999998e-122

    1. Initial program 99.4%

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

    if -5.5999999999999998e-122 < F < 4.80000000000000052e-66

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

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

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

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

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

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

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

    if 4.80000000000000052e-66 < F

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

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

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

        \[\leadsto \color{blue}{0 - \left(x \cdot \frac{1}{\tan B} - \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt21.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-unprod11.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-neg11.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.4%

        \[\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. add-sqr-sqrt0.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.058:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5.6 \cdot 10^{-122}:\\ \;\;\;\;{\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{elif}\;F \leq 4.8 \cdot 10^{-66}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 12: 77.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.7 \cdot 10^{-123}:\\
\;\;\;\;{\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{elif}\;F \leq 4.2 \cdot 10^{-67}:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\

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


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

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

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

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

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

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

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

    if -0.48999999999999999 < F < -1.7e-123

    1. Initial program 99.4%

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

    if -1.7e-123 < F < 4.2000000000000003e-67

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

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

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

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

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

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

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

    if 4.2000000000000003e-67 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.49:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-123}:\\ \;\;\;\;{\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{elif}\;F \leq 4.2 \cdot 10^{-67}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 13: 64.3% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_2 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -4 \cdot 10^{+237}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -1.36 \cdot 10^{+130}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -270:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-174}:\\ \;\;\;\;{\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{elif}\;F \leq 8.8 \cdot 10^{-195}:\\ \;\;\;\;t_0 + \frac{\frac{-1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-71}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B))))
        (t_1 (- (/ -1.0 B) (/ x (tan B))))
        (t_2 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= F -4e+237)
     t_2
     (if (<= F -1.36e+130)
       t_1
       (if (<= F -1.08e+27)
         t_2
         (if (<= F -270.0)
           t_1
           (if (<= F -1.6e-174)
             (+
              (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
              (* x (- (/ -1.0 B) (* B -0.3333333333333333))))
             (if (<= F 8.8e-195)
               (+ t_0 (/ (/ -1.0 F) (/ B F)))
               (if (<= F 5.8e-71)
                 (- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)) (/ x B))
                 (+ t_0 (/ 1.0 B)))))))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double t_1 = (-1.0 / B) - (x / tan(B));
	double t_2 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -4e+237) {
		tmp = t_2;
	} else if (F <= -1.36e+130) {
		tmp = t_1;
	} else if (F <= -1.08e+27) {
		tmp = t_2;
	} else if (F <= -270.0) {
		tmp = t_1;
	} else if (F <= -1.6e-174) {
		tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	} else if (F <= 8.8e-195) {
		tmp = t_0 + ((-1.0 / F) / (B / F));
	} else if (F <= 5.8e-71) {
		tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	} else {
		tmp = t_0 + (1.0 / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: 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) - (x / tan(b))
    t_2 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-4d+237)) then
        tmp = t_2
    else if (f <= (-1.36d+130)) then
        tmp = t_1
    else if (f <= (-1.08d+27)) then
        tmp = t_2
    else if (f <= (-270.0d0)) then
        tmp = t_1
    else if (f <= (-1.6d-174)) then
        tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
    else if (f <= 8.8d-195) then
        tmp = t_0 + (((-1.0d0) / f) / (b / f))
    else if (f <= 5.8d-71) then
        tmp = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b)) - (x / b)
    else
        tmp = t_0 + (1.0d0 / 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) - (x / Math.tan(B));
	double t_2 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -4e+237) {
		tmp = t_2;
	} else if (F <= -1.36e+130) {
		tmp = t_1;
	} else if (F <= -1.08e+27) {
		tmp = t_2;
	} else if (F <= -270.0) {
		tmp = t_1;
	} else if (F <= -1.6e-174) {
		tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	} else if (F <= 8.8e-195) {
		tmp = t_0 + ((-1.0 / F) / (B / F));
	} else if (F <= 5.8e-71) {
		tmp = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	} else {
		tmp = t_0 + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	t_1 = (-1.0 / B) - (x / math.tan(B))
	t_2 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -4e+237:
		tmp = t_2
	elif F <= -1.36e+130:
		tmp = t_1
	elif F <= -1.08e+27:
		tmp = t_2
	elif F <= -270.0:
		tmp = t_1
	elif F <= -1.6e-174:
		tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)))
	elif F <= 8.8e-195:
		tmp = t_0 + ((-1.0 / F) / (B / F))
	elif F <= 5.8e-71:
		tmp = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B)
	else:
		tmp = t_0 + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	t_1 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_2 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -4e+237)
		tmp = t_2;
	elseif (F <= -1.36e+130)
		tmp = t_1;
	elseif (F <= -1.08e+27)
		tmp = t_2;
	elseif (F <= -270.0)
		tmp = t_1;
	elseif (F <= -1.6e-174)
		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))));
	elseif (F <= 8.8e-195)
		tmp = Float64(t_0 + Float64(Float64(-1.0 / F) / Float64(B / F)));
	elseif (F <= 5.8e-71)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)) - Float64(x / B));
	else
		tmp = Float64(t_0 + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	t_1 = (-1.0 / B) - (x / tan(B));
	t_2 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -4e+237)
		tmp = t_2;
	elseif (F <= -1.36e+130)
		tmp = t_1;
	elseif (F <= -1.08e+27)
		tmp = t_2;
	elseif (F <= -270.0)
		tmp = t_1;
	elseif (F <= -1.6e-174)
		tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
	elseif (F <= 8.8e-195)
		tmp = t_0 + ((-1.0 / F) / (B / F));
	elseif (F <= 5.8e-71)
		tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	else
		tmp = t_0 + (1.0 / 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] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+237], t$95$2, If[LessEqual[F, -1.36e+130], t$95$1, If[LessEqual[F, -1.08e+27], t$95$2, If[LessEqual[F, -270.0], t$95$1, If[LessEqual[F, -1.6e-174], 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], If[LessEqual[F, 8.8e-195], N[(t$95$0 + N[(N[(-1.0 / F), $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.8e-71], 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], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.36 \cdot 10^{+130}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq -270:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -1.6 \cdot 10^{-174}:\\
\;\;\;\;{\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{elif}\;F \leq 8.8 \cdot 10^{-195}:\\
\;\;\;\;t_0 + \frac{\frac{-1}{F}}{\frac{B}{F}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -3.99999999999999976e237 or -1.36000000000000007e130 < F < -1.08e27

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

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

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

    if -3.99999999999999976e237 < F < -1.36000000000000007e130 or -1.08e27 < F < -270

    1. Initial program 68.7%

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr80.9%

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

    if -270 < F < -1.6e-174

    1. Initial program 99.4%

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

      \[\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 -1.6e-174 < F < 8.80000000000000022e-195

    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. Step-by-step derivation
      1. clear-num99.7%

        \[\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-*l/99.7%

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

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

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

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

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

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

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

      \[\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}}{\frac{\sin B}{F}}} \]
    4. Taylor expanded in F around -inf 41.0%

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

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

    if 8.80000000000000022e-195 < F < 5.7999999999999997e-71

    1. Initial program 99.2%

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

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

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

    if 5.7999999999999997e-71 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.36 \cdot 10^{+130}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -270:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-174}:\\ \;\;\;\;{\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{elif}\;F \leq 8.8 \cdot 10^{-195}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{-1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-71}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 14: 64.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\ t_1 := x \cdot \frac{-1}{\tan B}\\ t_2 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_3 := \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{if}\;F \leq -2.7 \cdot 10^{+237}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{+129}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -6:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq -4.3 \cdot 10^{-213}:\\ \;\;\;\;\frac{F \cdot t_3 - x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-194}:\\ \;\;\;\;t_1 + \frac{\frac{-1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-68}:\\ \;\;\;\;t_3 \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_1 + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 (sin B)) (/ x B)))
        (t_1 (* x (/ -1.0 (tan B))))
        (t_2 (- (/ -1.0 B) (/ x (tan B))))
        (t_3 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
   (if (<= F -2.7e+237)
     t_0
     (if (<= F -7.5e+129)
       t_2
       (if (<= F -1.08e+27)
         t_0
         (if (<= F -6.0)
           t_2
           (if (<= F -4.3e-213)
             (/ (- (* F t_3) x) B)
             (if (<= F 2.5e-194)
               (+ t_1 (/ (/ -1.0 F) (/ B F)))
               (if (<= F 1.6e-68)
                 (- (* t_3 (/ F B)) (/ x B))
                 (+ t_1 (/ 1.0 B)))))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / sin(B)) - (x / B);
	double t_1 = x * (-1.0 / tan(B));
	double t_2 = (-1.0 / B) - (x / tan(B));
	double t_3 = sqrt((1.0 / (2.0 + (x * 2.0))));
	double tmp;
	if (F <= -2.7e+237) {
		tmp = t_0;
	} else if (F <= -7.5e+129) {
		tmp = t_2;
	} else if (F <= -1.08e+27) {
		tmp = t_0;
	} else if (F <= -6.0) {
		tmp = t_2;
	} else if (F <= -4.3e-213) {
		tmp = ((F * t_3) - x) / B;
	} else if (F <= 2.5e-194) {
		tmp = t_1 + ((-1.0 / F) / (B / F));
	} else if (F <= 1.6e-68) {
		tmp = (t_3 * (F / B)) - (x / B);
	} else {
		tmp = t_1 + (1.0 / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = ((-1.0d0) / sin(b)) - (x / b)
    t_1 = x * ((-1.0d0) / tan(b))
    t_2 = ((-1.0d0) / b) - (x / tan(b))
    t_3 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
    if (f <= (-2.7d+237)) then
        tmp = t_0
    else if (f <= (-7.5d+129)) then
        tmp = t_2
    else if (f <= (-1.08d+27)) then
        tmp = t_0
    else if (f <= (-6.0d0)) then
        tmp = t_2
    else if (f <= (-4.3d-213)) then
        tmp = ((f * t_3) - x) / b
    else if (f <= 2.5d-194) then
        tmp = t_1 + (((-1.0d0) / f) / (b / f))
    else if (f <= 1.6d-68) then
        tmp = (t_3 * (f / b)) - (x / b)
    else
        tmp = t_1 + (1.0d0 / 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)) - (x / B);
	double t_1 = x * (-1.0 / Math.tan(B));
	double t_2 = (-1.0 / B) - (x / Math.tan(B));
	double t_3 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
	double tmp;
	if (F <= -2.7e+237) {
		tmp = t_0;
	} else if (F <= -7.5e+129) {
		tmp = t_2;
	} else if (F <= -1.08e+27) {
		tmp = t_0;
	} else if (F <= -6.0) {
		tmp = t_2;
	} else if (F <= -4.3e-213) {
		tmp = ((F * t_3) - x) / B;
	} else if (F <= 2.5e-194) {
		tmp = t_1 + ((-1.0 / F) / (B / F));
	} else if (F <= 1.6e-68) {
		tmp = (t_3 * (F / B)) - (x / B);
	} else {
		tmp = t_1 + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / math.sin(B)) - (x / B)
	t_1 = x * (-1.0 / math.tan(B))
	t_2 = (-1.0 / B) - (x / math.tan(B))
	t_3 = math.sqrt((1.0 / (2.0 + (x * 2.0))))
	tmp = 0
	if F <= -2.7e+237:
		tmp = t_0
	elif F <= -7.5e+129:
		tmp = t_2
	elif F <= -1.08e+27:
		tmp = t_0
	elif F <= -6.0:
		tmp = t_2
	elif F <= -4.3e-213:
		tmp = ((F * t_3) - x) / B
	elif F <= 2.5e-194:
		tmp = t_1 + ((-1.0 / F) / (B / F))
	elif F <= 1.6e-68:
		tmp = (t_3 * (F / B)) - (x / B)
	else:
		tmp = t_1 + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	t_1 = Float64(x * Float64(-1.0 / tan(B)))
	t_2 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_3 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))
	tmp = 0.0
	if (F <= -2.7e+237)
		tmp = t_0;
	elseif (F <= -7.5e+129)
		tmp = t_2;
	elseif (F <= -1.08e+27)
		tmp = t_0;
	elseif (F <= -6.0)
		tmp = t_2;
	elseif (F <= -4.3e-213)
		tmp = Float64(Float64(Float64(F * t_3) - x) / B);
	elseif (F <= 2.5e-194)
		tmp = Float64(t_1 + Float64(Float64(-1.0 / F) / Float64(B / F)));
	elseif (F <= 1.6e-68)
		tmp = Float64(Float64(t_3 * Float64(F / B)) - Float64(x / B));
	else
		tmp = Float64(t_1 + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 / sin(B)) - (x / B);
	t_1 = x * (-1.0 / tan(B));
	t_2 = (-1.0 / B) - (x / tan(B));
	t_3 = sqrt((1.0 / (2.0 + (x * 2.0))));
	tmp = 0.0;
	if (F <= -2.7e+237)
		tmp = t_0;
	elseif (F <= -7.5e+129)
		tmp = t_2;
	elseif (F <= -1.08e+27)
		tmp = t_0;
	elseif (F <= -6.0)
		tmp = t_2;
	elseif (F <= -4.3e-213)
		tmp = ((F * t_3) - x) / B;
	elseif (F <= 2.5e-194)
		tmp = t_1 + ((-1.0 / F) / (B / F));
	elseif (F <= 1.6e-68)
		tmp = (t_3 * (F / B)) - (x / B);
	else
		tmp = t_1 + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / N[Sin[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] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -2.7e+237], t$95$0, If[LessEqual[F, -7.5e+129], t$95$2, If[LessEqual[F, -1.08e+27], t$95$0, If[LessEqual[F, -6.0], t$95$2, If[LessEqual[F, -4.3e-213], N[(N[(N[(F * t$95$3), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e-194], N[(t$95$1 + N[(N[(-1.0 / F), $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e-68], N[(N[(t$95$3 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -7.5 \cdot 10^{+129}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -6:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq -4.3 \cdot 10^{-213}:\\
\;\;\;\;\frac{F \cdot t_3 - x}{B}\\

\mathbf{elif}\;F \leq 2.5 \cdot 10^{-194}:\\
\;\;\;\;t_1 + \frac{\frac{-1}{F}}{\frac{B}{F}}\\

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

\mathbf{else}:\\
\;\;\;\;t_1 + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -2.6999999999999999e237 or -7.4999999999999998e129 < F < -1.08e27

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

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

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

    if -2.6999999999999999e237 < F < -7.4999999999999998e129 or -1.08e27 < F < -6

    1. Initial program 68.7%

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr80.9%

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

    if -6 < F < -4.3000000000000003e-213

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.3000000000000003e-213 < F < 2.5000000000000001e-194

    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. Step-by-step derivation
      1. clear-num99.7%

        \[\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-*l/99.7%

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

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

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

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

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

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

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

      \[\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}}{\frac{\sin B}{F}}} \]
    4. Taylor expanded in F around -inf 44.8%

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

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

    if 2.5000000000000001e-194 < F < 1.5999999999999999e-68

    1. Initial program 99.2%

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

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

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

    if 1.5999999999999999e-68 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{+129}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.3 \cdot 10^{-213}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-194}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{-1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-68}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 15: 64.6% accurate, 2.5× speedup?

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

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

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

\mathbf{elif}\;F \leq -1.2 \cdot 10^{+27}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -0.63:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 1.8 \cdot 10^{-194}:\\
\;\;\;\;t_2 + \frac{\frac{-1}{F}}{\frac{B}{F}}\\

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

\mathbf{else}:\\
\;\;\;\;t_2 + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -2.9000000000000001e237 or -3.0499999999999999e130 < F < -1.19999999999999999e27

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

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

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

    if -2.9000000000000001e237 < F < -3.0499999999999999e130 or -1.19999999999999999e27 < F < -0.630000000000000004

    1. Initial program 69.7%

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

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

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

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

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

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

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

    if -0.630000000000000004 < F < -4.7e-213

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

    if -4.7e-213 < F < 1.8e-194

    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. Step-by-step derivation
      1. clear-num99.7%

        \[\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-*l/99.7%

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

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

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

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

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

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

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

      \[\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}}{\frac{\sin B}{F}}} \]
    4. Taylor expanded in F around -inf 44.8%

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

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

    if 1.8e-194 < F < 1.8e-71

    1. Initial program 99.2%

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

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

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

    if 1.8e-71 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.05 \cdot 10^{+130}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.2 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -0.63:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.7 \cdot 10^{-213}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-194}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{-1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-71}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 16: 63.3% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\ t_2 := x \cdot \frac{-1}{\tan B}\\ t_3 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{if}\;F \leq -3 \cdot 10^{+237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{+130}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -6:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-213}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-193}:\\ \;\;\;\;t_2 + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-72}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 B) (/ x (tan B))))
        (t_1 (- (/ -1.0 (sin B)) (/ x B)))
        (t_2 (* x (/ -1.0 (tan B))))
        (t_3 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)))
   (if (<= F -3e+237)
     t_1
     (if (<= F -2.5e+130)
       t_0
       (if (<= F -1.08e+27)
         t_1
         (if (<= F -6.0)
           t_0
           (if (<= F -1.7e-213)
             t_3
             (if (<= F 1.8e-193)
               (+ t_2 (/ -1.0 B))
               (if (<= F 2.6e-72) t_3 (+ t_2 (/ 1.0 B)))))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / tan(B));
	double t_1 = (-1.0 / sin(B)) - (x / B);
	double t_2 = x * (-1.0 / tan(B));
	double t_3 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -3e+237) {
		tmp = t_1;
	} else if (F <= -2.5e+130) {
		tmp = t_0;
	} else if (F <= -1.08e+27) {
		tmp = t_1;
	} else if (F <= -6.0) {
		tmp = t_0;
	} else if (F <= -1.7e-213) {
		tmp = t_3;
	} else if (F <= 1.8e-193) {
		tmp = t_2 + (-1.0 / B);
	} else if (F <= 2.6e-72) {
		tmp = t_3;
	} else {
		tmp = t_2 + (1.0 / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = ((-1.0d0) / b) - (x / tan(b))
    t_1 = ((-1.0d0) / sin(b)) - (x / b)
    t_2 = x * ((-1.0d0) / tan(b))
    t_3 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    if (f <= (-3d+237)) then
        tmp = t_1
    else if (f <= (-2.5d+130)) then
        tmp = t_0
    else if (f <= (-1.08d+27)) then
        tmp = t_1
    else if (f <= (-6.0d0)) then
        tmp = t_0
    else if (f <= (-1.7d-213)) then
        tmp = t_3
    else if (f <= 1.8d-193) then
        tmp = t_2 + ((-1.0d0) / b)
    else if (f <= 2.6d-72) then
        tmp = t_3
    else
        tmp = t_2 + (1.0d0 / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / Math.tan(B));
	double t_1 = (-1.0 / Math.sin(B)) - (x / B);
	double t_2 = x * (-1.0 / Math.tan(B));
	double t_3 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -3e+237) {
		tmp = t_1;
	} else if (F <= -2.5e+130) {
		tmp = t_0;
	} else if (F <= -1.08e+27) {
		tmp = t_1;
	} else if (F <= -6.0) {
		tmp = t_0;
	} else if (F <= -1.7e-213) {
		tmp = t_3;
	} else if (F <= 1.8e-193) {
		tmp = t_2 + (-1.0 / B);
	} else if (F <= 2.6e-72) {
		tmp = t_3;
	} else {
		tmp = t_2 + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / B) - (x / math.tan(B))
	t_1 = (-1.0 / math.sin(B)) - (x / B)
	t_2 = x * (-1.0 / math.tan(B))
	t_3 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	tmp = 0
	if F <= -3e+237:
		tmp = t_1
	elif F <= -2.5e+130:
		tmp = t_0
	elif F <= -1.08e+27:
		tmp = t_1
	elif F <= -6.0:
		tmp = t_0
	elif F <= -1.7e-213:
		tmp = t_3
	elif F <= 1.8e-193:
		tmp = t_2 + (-1.0 / B)
	elif F <= 2.6e-72:
		tmp = t_3
	else:
		tmp = t_2 + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	t_2 = Float64(x * Float64(-1.0 / tan(B)))
	t_3 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B)
	tmp = 0.0
	if (F <= -3e+237)
		tmp = t_1;
	elseif (F <= -2.5e+130)
		tmp = t_0;
	elseif (F <= -1.08e+27)
		tmp = t_1;
	elseif (F <= -6.0)
		tmp = t_0;
	elseif (F <= -1.7e-213)
		tmp = t_3;
	elseif (F <= 1.8e-193)
		tmp = Float64(t_2 + Float64(-1.0 / B));
	elseif (F <= 2.6e-72)
		tmp = t_3;
	else
		tmp = Float64(t_2 + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 / B) - (x / tan(B));
	t_1 = (-1.0 / sin(B)) - (x / B);
	t_2 = x * (-1.0 / tan(B));
	t_3 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	tmp = 0.0;
	if (F <= -3e+237)
		tmp = t_1;
	elseif (F <= -2.5e+130)
		tmp = t_0;
	elseif (F <= -1.08e+27)
		tmp = t_1;
	elseif (F <= -6.0)
		tmp = t_0;
	elseif (F <= -1.7e-213)
		tmp = t_3;
	elseif (F <= 1.8e-193)
		tmp = t_2 + (-1.0 / B);
	elseif (F <= 2.6e-72)
		tmp = t_3;
	else
		tmp = t_2 + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -3e+237], t$95$1, If[LessEqual[F, -2.5e+130], t$95$0, If[LessEqual[F, -1.08e+27], t$95$1, If[LessEqual[F, -6.0], t$95$0, If[LessEqual[F, -1.7e-213], t$95$3, If[LessEqual[F, 1.8e-193], N[(t$95$2 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.6e-72], t$95$3, N[(t$95$2 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -2.5 \cdot 10^{+130}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -6:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -1.7 \cdot 10^{-213}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;F \leq 1.8 \cdot 10^{-193}:\\
\;\;\;\;t_2 + \frac{-1}{B}\\

\mathbf{elif}\;F \leq 2.6 \cdot 10^{-72}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2 + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -3e237 or -2.4999999999999998e130 < F < -1.08e27

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

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

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

    if -3e237 < F < -2.4999999999999998e130 or -1.08e27 < F < -6

    1. Initial program 68.7%

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr80.9%

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

    if -6 < F < -1.7000000000000001e-213 or 1.7999999999999999e-193 < F < 2.59999999999999996e-72

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7000000000000001e-213 < F < 1.7999999999999999e-193

    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 F around -inf 44.8%

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

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

    if 2.59999999999999996e-72 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{+130}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-213}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-193}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-72}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 17: 64.3% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\ t_2 := x \cdot \frac{-1}{\tan B}\\ t_3 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{if}\;F \leq -3.1 \cdot 10^{+237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -6 \cdot 10^{+129}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.2 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -6:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-213}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-194}:\\ \;\;\;\;t_2 + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 1.62 \cdot 10^{-69}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 B) (/ x (tan B))))
        (t_1 (- (/ -1.0 (sin B)) (/ x B)))
        (t_2 (* x (/ -1.0 (tan B))))
        (t_3 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)))
   (if (<= F -3.1e+237)
     t_1
     (if (<= F -6e+129)
       t_0
       (if (<= F -1.2e+27)
         t_1
         (if (<= F -6.0)
           t_0
           (if (<= F -3.5e-213)
             t_3
             (if (<= F 6.5e-194)
               (+ t_2 (* (/ F B) (/ -1.0 F)))
               (if (<= F 1.62e-69) t_3 (+ t_2 (/ 1.0 B)))))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / tan(B));
	double t_1 = (-1.0 / sin(B)) - (x / B);
	double t_2 = x * (-1.0 / tan(B));
	double t_3 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -3.1e+237) {
		tmp = t_1;
	} else if (F <= -6e+129) {
		tmp = t_0;
	} else if (F <= -1.2e+27) {
		tmp = t_1;
	} else if (F <= -6.0) {
		tmp = t_0;
	} else if (F <= -3.5e-213) {
		tmp = t_3;
	} else if (F <= 6.5e-194) {
		tmp = t_2 + ((F / B) * (-1.0 / F));
	} else if (F <= 1.62e-69) {
		tmp = t_3;
	} else {
		tmp = t_2 + (1.0 / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = ((-1.0d0) / b) - (x / tan(b))
    t_1 = ((-1.0d0) / sin(b)) - (x / b)
    t_2 = x * ((-1.0d0) / tan(b))
    t_3 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    if (f <= (-3.1d+237)) then
        tmp = t_1
    else if (f <= (-6d+129)) then
        tmp = t_0
    else if (f <= (-1.2d+27)) then
        tmp = t_1
    else if (f <= (-6.0d0)) then
        tmp = t_0
    else if (f <= (-3.5d-213)) then
        tmp = t_3
    else if (f <= 6.5d-194) then
        tmp = t_2 + ((f / b) * ((-1.0d0) / f))
    else if (f <= 1.62d-69) then
        tmp = t_3
    else
        tmp = t_2 + (1.0d0 / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / Math.tan(B));
	double t_1 = (-1.0 / Math.sin(B)) - (x / B);
	double t_2 = x * (-1.0 / Math.tan(B));
	double t_3 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -3.1e+237) {
		tmp = t_1;
	} else if (F <= -6e+129) {
		tmp = t_0;
	} else if (F <= -1.2e+27) {
		tmp = t_1;
	} else if (F <= -6.0) {
		tmp = t_0;
	} else if (F <= -3.5e-213) {
		tmp = t_3;
	} else if (F <= 6.5e-194) {
		tmp = t_2 + ((F / B) * (-1.0 / F));
	} else if (F <= 1.62e-69) {
		tmp = t_3;
	} else {
		tmp = t_2 + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / B) - (x / math.tan(B))
	t_1 = (-1.0 / math.sin(B)) - (x / B)
	t_2 = x * (-1.0 / math.tan(B))
	t_3 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	tmp = 0
	if F <= -3.1e+237:
		tmp = t_1
	elif F <= -6e+129:
		tmp = t_0
	elif F <= -1.2e+27:
		tmp = t_1
	elif F <= -6.0:
		tmp = t_0
	elif F <= -3.5e-213:
		tmp = t_3
	elif F <= 6.5e-194:
		tmp = t_2 + ((F / B) * (-1.0 / F))
	elif F <= 1.62e-69:
		tmp = t_3
	else:
		tmp = t_2 + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	t_2 = Float64(x * Float64(-1.0 / tan(B)))
	t_3 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B)
	tmp = 0.0
	if (F <= -3.1e+237)
		tmp = t_1;
	elseif (F <= -6e+129)
		tmp = t_0;
	elseif (F <= -1.2e+27)
		tmp = t_1;
	elseif (F <= -6.0)
		tmp = t_0;
	elseif (F <= -3.5e-213)
		tmp = t_3;
	elseif (F <= 6.5e-194)
		tmp = Float64(t_2 + Float64(Float64(F / B) * Float64(-1.0 / F)));
	elseif (F <= 1.62e-69)
		tmp = t_3;
	else
		tmp = Float64(t_2 + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 / B) - (x / tan(B));
	t_1 = (-1.0 / sin(B)) - (x / B);
	t_2 = x * (-1.0 / tan(B));
	t_3 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	tmp = 0.0;
	if (F <= -3.1e+237)
		tmp = t_1;
	elseif (F <= -6e+129)
		tmp = t_0;
	elseif (F <= -1.2e+27)
		tmp = t_1;
	elseif (F <= -6.0)
		tmp = t_0;
	elseif (F <= -3.5e-213)
		tmp = t_3;
	elseif (F <= 6.5e-194)
		tmp = t_2 + ((F / B) * (-1.0 / F));
	elseif (F <= 1.62e-69)
		tmp = t_3;
	else
		tmp = t_2 + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -3.1e+237], t$95$1, If[LessEqual[F, -6e+129], t$95$0, If[LessEqual[F, -1.2e+27], t$95$1, If[LessEqual[F, -6.0], t$95$0, If[LessEqual[F, -3.5e-213], t$95$3, If[LessEqual[F, 6.5e-194], N[(t$95$2 + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.62e-69], t$95$3, N[(t$95$2 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq -1.2 \cdot 10^{+27}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -6:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -3.5 \cdot 10^{-213}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;F \leq 6.5 \cdot 10^{-194}:\\
\;\;\;\;t_2 + \frac{F}{B} \cdot \frac{-1}{F}\\

\mathbf{elif}\;F \leq 1.62 \cdot 10^{-69}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2 + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -3.09999999999999991e237 or -6.0000000000000006e129 < F < -1.19999999999999999e27

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

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

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

    if -3.09999999999999991e237 < F < -6.0000000000000006e129 or -1.19999999999999999e27 < F < -6

    1. Initial program 68.7%

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr80.9%

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

    if -6 < F < -3.50000000000000017e-213 or 6.50000000000000019e-194 < F < 1.62e-69

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.50000000000000017e-213 < F < 6.50000000000000019e-194

    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 89.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 F around -inf 70.5%

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

    if 1.62e-69 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{+129}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.2 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-213}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-194}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 1.62 \cdot 10^{-69}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 18: 64.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\ t_2 := x \cdot \frac{-1}{\tan B}\\ t_3 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{if}\;F \leq -3.5 \cdot 10^{+237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.48 \cdot 10^{+130}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.55 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -6:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-213}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-194}:\\ \;\;\;\;t_2 + \frac{\frac{-1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 1.85 \cdot 10^{-68}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 B) (/ x (tan B))))
        (t_1 (- (/ -1.0 (sin B)) (/ x B)))
        (t_2 (* x (/ -1.0 (tan B))))
        (t_3 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)))
   (if (<= F -3.5e+237)
     t_1
     (if (<= F -1.48e+130)
       t_0
       (if (<= F -1.55e+28)
         t_1
         (if (<= F -6.0)
           t_0
           (if (<= F -3.7e-213)
             t_3
             (if (<= F 3.2e-194)
               (+ t_2 (/ (/ -1.0 F) (/ B F)))
               (if (<= F 1.85e-68) t_3 (+ t_2 (/ 1.0 B)))))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / tan(B));
	double t_1 = (-1.0 / sin(B)) - (x / B);
	double t_2 = x * (-1.0 / tan(B));
	double t_3 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -3.5e+237) {
		tmp = t_1;
	} else if (F <= -1.48e+130) {
		tmp = t_0;
	} else if (F <= -1.55e+28) {
		tmp = t_1;
	} else if (F <= -6.0) {
		tmp = t_0;
	} else if (F <= -3.7e-213) {
		tmp = t_3;
	} else if (F <= 3.2e-194) {
		tmp = t_2 + ((-1.0 / F) / (B / F));
	} else if (F <= 1.85e-68) {
		tmp = t_3;
	} else {
		tmp = t_2 + (1.0 / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = ((-1.0d0) / b) - (x / tan(b))
    t_1 = ((-1.0d0) / sin(b)) - (x / b)
    t_2 = x * ((-1.0d0) / tan(b))
    t_3 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    if (f <= (-3.5d+237)) then
        tmp = t_1
    else if (f <= (-1.48d+130)) then
        tmp = t_0
    else if (f <= (-1.55d+28)) then
        tmp = t_1
    else if (f <= (-6.0d0)) then
        tmp = t_0
    else if (f <= (-3.7d-213)) then
        tmp = t_3
    else if (f <= 3.2d-194) then
        tmp = t_2 + (((-1.0d0) / f) / (b / f))
    else if (f <= 1.85d-68) then
        tmp = t_3
    else
        tmp = t_2 + (1.0d0 / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / Math.tan(B));
	double t_1 = (-1.0 / Math.sin(B)) - (x / B);
	double t_2 = x * (-1.0 / Math.tan(B));
	double t_3 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double tmp;
	if (F <= -3.5e+237) {
		tmp = t_1;
	} else if (F <= -1.48e+130) {
		tmp = t_0;
	} else if (F <= -1.55e+28) {
		tmp = t_1;
	} else if (F <= -6.0) {
		tmp = t_0;
	} else if (F <= -3.7e-213) {
		tmp = t_3;
	} else if (F <= 3.2e-194) {
		tmp = t_2 + ((-1.0 / F) / (B / F));
	} else if (F <= 1.85e-68) {
		tmp = t_3;
	} else {
		tmp = t_2 + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / B) - (x / math.tan(B))
	t_1 = (-1.0 / math.sin(B)) - (x / B)
	t_2 = x * (-1.0 / math.tan(B))
	t_3 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	tmp = 0
	if F <= -3.5e+237:
		tmp = t_1
	elif F <= -1.48e+130:
		tmp = t_0
	elif F <= -1.55e+28:
		tmp = t_1
	elif F <= -6.0:
		tmp = t_0
	elif F <= -3.7e-213:
		tmp = t_3
	elif F <= 3.2e-194:
		tmp = t_2 + ((-1.0 / F) / (B / F))
	elif F <= 1.85e-68:
		tmp = t_3
	else:
		tmp = t_2 + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	t_2 = Float64(x * Float64(-1.0 / tan(B)))
	t_3 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B)
	tmp = 0.0
	if (F <= -3.5e+237)
		tmp = t_1;
	elseif (F <= -1.48e+130)
		tmp = t_0;
	elseif (F <= -1.55e+28)
		tmp = t_1;
	elseif (F <= -6.0)
		tmp = t_0;
	elseif (F <= -3.7e-213)
		tmp = t_3;
	elseif (F <= 3.2e-194)
		tmp = Float64(t_2 + Float64(Float64(-1.0 / F) / Float64(B / F)));
	elseif (F <= 1.85e-68)
		tmp = t_3;
	else
		tmp = Float64(t_2 + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 / B) - (x / tan(B));
	t_1 = (-1.0 / sin(B)) - (x / B);
	t_2 = x * (-1.0 / tan(B));
	t_3 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	tmp = 0.0;
	if (F <= -3.5e+237)
		tmp = t_1;
	elseif (F <= -1.48e+130)
		tmp = t_0;
	elseif (F <= -1.55e+28)
		tmp = t_1;
	elseif (F <= -6.0)
		tmp = t_0;
	elseif (F <= -3.7e-213)
		tmp = t_3;
	elseif (F <= 3.2e-194)
		tmp = t_2 + ((-1.0 / F) / (B / F));
	elseif (F <= 1.85e-68)
		tmp = t_3;
	else
		tmp = t_2 + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -3.5e+237], t$95$1, If[LessEqual[F, -1.48e+130], t$95$0, If[LessEqual[F, -1.55e+28], t$95$1, If[LessEqual[F, -6.0], t$95$0, If[LessEqual[F, -3.7e-213], t$95$3, If[LessEqual[F, 3.2e-194], N[(t$95$2 + N[(N[(-1.0 / F), $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e-68], t$95$3, N[(t$95$2 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.48 \cdot 10^{+130}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -1.55 \cdot 10^{+28}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -6:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -3.7 \cdot 10^{-213}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;F \leq 1.85 \cdot 10^{-68}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2 + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -3.49999999999999988e237 or -1.47999999999999991e130 < F < -1.55e28

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

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

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

    if -3.49999999999999988e237 < F < -1.47999999999999991e130 or -1.55e28 < F < -6

    1. Initial program 68.7%

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr80.9%

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

    if -6 < F < -3.70000000000000003e-213 or 3.2000000000000003e-194 < F < 1.85000000000000001e-68

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.70000000000000003e-213 < F < 3.2000000000000003e-194

    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. Step-by-step derivation
      1. clear-num99.7%

        \[\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-*l/99.7%

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

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

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

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

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

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

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

      \[\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}}{\frac{\sin B}{F}}} \]
    4. Taylor expanded in F around -inf 44.8%

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

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

    if 1.85000000000000001e-68 < F

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.5 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.48 \cdot 10^{+130}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.55 \cdot 10^{+28}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-213}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-194}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{-1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 1.85 \cdot 10^{-68}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 19: 52.5% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{B} - \frac{x}{B}\\ t_1 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_2 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-101}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-125}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-211}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-87}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-23}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ 1.0 B) (/ x B)))
        (t_1 (- (/ -1.0 B) (/ x (tan B))))
        (t_2 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= x -1.05e+50)
     t_1
     (if (<= x -7.2e-101)
       (/ (- x) B)
       (if (<= x -3.3e-125)
         t_0
         (if (<= x 2.1e-211)
           t_2
           (if (<= x 4.8e-87) t_0 (if (<= x 5e-23) t_2 t_1))))))))
double code(double F, double B, double x) {
	double t_0 = (1.0 / B) - (x / B);
	double t_1 = (-1.0 / B) - (x / tan(B));
	double t_2 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (x <= -1.05e+50) {
		tmp = t_1;
	} else if (x <= -7.2e-101) {
		tmp = -x / B;
	} else if (x <= -3.3e-125) {
		tmp = t_0;
	} else if (x <= 2.1e-211) {
		tmp = t_2;
	} else if (x <= 4.8e-87) {
		tmp = t_0;
	} else if (x <= 5e-23) {
		tmp = t_2;
	} 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 = (1.0d0 / b) - (x / b)
    t_1 = ((-1.0d0) / b) - (x / tan(b))
    t_2 = ((-1.0d0) / sin(b)) - (x / b)
    if (x <= (-1.05d+50)) then
        tmp = t_1
    else if (x <= (-7.2d-101)) then
        tmp = -x / b
    else if (x <= (-3.3d-125)) then
        tmp = t_0
    else if (x <= 2.1d-211) then
        tmp = t_2
    else if (x <= 4.8d-87) then
        tmp = t_0
    else if (x <= 5d-23) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (1.0 / B) - (x / B);
	double t_1 = (-1.0 / B) - (x / Math.tan(B));
	double t_2 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (x <= -1.05e+50) {
		tmp = t_1;
	} else if (x <= -7.2e-101) {
		tmp = -x / B;
	} else if (x <= -3.3e-125) {
		tmp = t_0;
	} else if (x <= 2.1e-211) {
		tmp = t_2;
	} else if (x <= 4.8e-87) {
		tmp = t_0;
	} else if (x <= 5e-23) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (1.0 / B) - (x / B)
	t_1 = (-1.0 / B) - (x / math.tan(B))
	t_2 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if x <= -1.05e+50:
		tmp = t_1
	elif x <= -7.2e-101:
		tmp = -x / B
	elif x <= -3.3e-125:
		tmp = t_0
	elif x <= 2.1e-211:
		tmp = t_2
	elif x <= 4.8e-87:
		tmp = t_0
	elif x <= 5e-23:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(1.0 / B) - Float64(x / B))
	t_1 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_2 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (x <= -1.05e+50)
		tmp = t_1;
	elseif (x <= -7.2e-101)
		tmp = Float64(Float64(-x) / B);
	elseif (x <= -3.3e-125)
		tmp = t_0;
	elseif (x <= 2.1e-211)
		tmp = t_2;
	elseif (x <= 4.8e-87)
		tmp = t_0;
	elseif (x <= 5e-23)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (1.0 / B) - (x / B);
	t_1 = (-1.0 / B) - (x / tan(B));
	t_2 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (x <= -1.05e+50)
		tmp = t_1;
	elseif (x <= -7.2e-101)
		tmp = -x / B;
	elseif (x <= -3.3e-125)
		tmp = t_0;
	elseif (x <= 2.1e-211)
		tmp = t_2;
	elseif (x <= 4.8e-87)
		tmp = t_0;
	elseif (x <= 5e-23)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+50], t$95$1, If[LessEqual[x, -7.2e-101], N[((-x) / B), $MachinePrecision], If[LessEqual[x, -3.3e-125], t$95$0, If[LessEqual[x, 2.1e-211], t$95$2, If[LessEqual[x, 4.8e-87], t$95$0, If[LessEqual[x, 5e-23], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -3.3 \cdot 10^{-125}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 2.1 \cdot 10^{-211}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-87}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 5 \cdot 10^{-23}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.05e50 or 5.0000000000000002e-23 < x

    1. Initial program 89.7%

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

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

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

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

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

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

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

    if -1.05e50 < x < -7.19999999999999999e-101

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999999e-101 < x < -3.3000000000000001e-125 or 2.10000000000000008e-211 < x < 4.7999999999999999e-87

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

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

    if -3.3000000000000001e-125 < x < 2.10000000000000008e-211 or 4.7999999999999999e-87 < x < 5.0000000000000002e-23

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{+50}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-101}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-125}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-211}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-87}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-23}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 20: 61.0% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq -7.3 \cdot 10^{+129}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 2.5 \cdot 10^{-32}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.09999999999999979e237 or -7.30000000000000051e129 < F < -2.99999999999999976e27

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

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

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

    if -5.09999999999999979e237 < F < -7.30000000000000051e129 or -2.99999999999999976e27 < F < 2.5e-32

    1. Initial program 93.3%

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

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

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr48.8%

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

    if 2.5e-32 < F

    1. Initial program 66.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.1 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.3 \cdot 10^{+129}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 21: 53.9% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 165000000 \lor \neg \left(F \leq 2 \cdot 10^{+140}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.65e8 or 2.00000000000000012e140 < F

    1. Initial program 80.5%

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

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

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

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

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

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr53.6%

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

    if 1.65e8 < F < 2.00000000000000012e140

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

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

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

Alternative 22: 43.6% accurate, 24.8× speedup?

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

\mathbf{elif}\;F \leq 5.6 \cdot 10^{-67}:\\
\;\;\;\;\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 < -8.39999999999999954e-48

    1. Initial program 71.4%

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

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

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

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

    if -8.39999999999999954e-48 < F < 5.60000000000000021e-67

    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 F around -inf 33.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg33.8%

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

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

    if 5.60000000000000021e-67 < F

    1. Initial program 69.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 53.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 26.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 45.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.4 \cdot 10^{-48}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 5.6 \cdot 10^{-67}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 23: 43.5% accurate, 29.1× speedup?

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

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

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

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


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

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      9. div-sub31.0%

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

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

    if -2.3000000000000001e-53 < F < 6.4999999999999997e-68

    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 F around -inf 34.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg34.1%

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

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

    if 6.4999999999999997e-68 < F

    1. Initial program 69.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 53.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 26.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 45.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-53}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 24: 36.4% accurate, 45.9× speedup?

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

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

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


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

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      9. div-sub31.0%

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

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

    if -1.2999999999999999e-52 < F

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg30.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 25: 29.3% accurate, 53.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.15 \cdot 10^{+237}:\\
\;\;\;\;\frac{-1}{B}\\

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


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

    1. Initial program 23.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}} \]
    3. Taylor expanded in B around 0 34.8%

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

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

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

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

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

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

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

    if -1.14999999999999998e237 < F

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg28.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 26: 10.3% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

Reproduce

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