VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.6% → 99.6%
Time: 19.6s
Alternatives: 26
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 26 alternatives:

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

Initial Program: 76.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 58.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. expm1-log1p-u51.6%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def51.5%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp40.9%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef40.9%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-140.9%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp34.2%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative34.2%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp40.9%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -5.00000000000000024e25 < F < 2e8

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

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

    if 2e8 < F

    1. Initial program 51.3%

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

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

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

Alternative 2: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 58.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. expm1-log1p-u51.6%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def51.5%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp40.9%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef40.9%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-140.9%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp34.2%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative34.2%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp40.9%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -9.5000000000000001e24 < F < 3.4e8

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

    if 3.4e8 < F

    1. Initial program 51.3%

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

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

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

Alternative 3: 98.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 60.3%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv52.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.5%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.5%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.5%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp35.2%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative35.2%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.5%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -7 < F < 1.3999999999999999

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

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

    if 1.3999999999999999 < F

    1. Initial program 51.9%

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

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

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

Alternative 4: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B}{F} \cdot \sqrt{2 + x \cdot 2}}\\

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


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

    1. Initial program 60.3%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv52.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.5%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.5%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.5%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp35.2%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative35.2%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.5%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -7 < F < 1.44999999999999996

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.44999999999999996 < F

    1. Initial program 51.9%

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

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

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

Alternative 5: 99.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 60.3%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv52.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.5%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.5%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.5%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp35.2%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative35.2%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.5%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -7 < F < 1.3999999999999999

    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. +-commutative99.5%

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 51.9%

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

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

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

Alternative 6: 92.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -3.2 \cdot 10^{-73}:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 60.8%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv52.0%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def52.0%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.0%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.0%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.0%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp34.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative34.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.0%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -6.79999999999999982 < F < -3.19999999999999986e-73 or 2.9999999999999999e-144 < F < 4.2e7

    1. Initial program 99.5%

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

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

    if -3.19999999999999986e-73 < F < 2.9999999999999999e-144

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2e7 < F

    1. Initial program 51.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-73}:\\ \;\;\;\;\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 \cdot 10^{-144}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\frac{B \cdot \sqrt{2}}{F}}\\ \mathbf{elif}\;F \leq 42000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 7: 91.5% accurate, 1.4× speedup?

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

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

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

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

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


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

    1. Initial program 59.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. Step-by-step derivation
      1. expm1-log1p-u53.5%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def53.5%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp42.0%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef42.0%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-142.0%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp35.6%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative35.6%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp42.0%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -1.9e18 < F < 4.6000000000000002e-140

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

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

    if 4.6000000000000002e-140 < F < 4.2e7

    1. Initial program 99.6%

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

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

    if 4.2e7 < F

    1. Initial program 51.3%

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

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

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

Alternative 8: 86.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.55 \cdot 10^{-75}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{F \cdot \sqrt{0.5}}}\\

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

\mathbf{elif}\;F \leq 0.000195:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\

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


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

    1. Initial program 60.8%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv52.0%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def52.0%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.0%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.0%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.0%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp34.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative34.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.0%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -0.0060000000000000001 < F < -1.55000000000000003e-75

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{\sin B}} \]
    6. Step-by-step derivation
      1. associate-/l*83.0%

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified83.0%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    8. Step-by-step derivation
      1. clear-num83.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\sin B}{F}}{\sqrt{0.5}}}} \]
      2. inv-pow83.2%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sin B}{F}}{\sqrt{0.5}}\right)}^{-1}} \]
    9. Applied egg-rr83.2%

      \[\leadsto \color{blue}{{\left(\frac{\frac{\sin B}{F}}{\sqrt{0.5}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-183.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\sin B}{F}}{\sqrt{0.5}}}} \]
      2. associate-/l/83.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{\sin B}{\sqrt{0.5} \cdot F}}} \]
    11. Simplified83.4%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5} \cdot F}}} \]

    if -1.55000000000000003e-75 < F < 4.2000000000000002e-50

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
      4. neg-mul-180.9%

        \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
    8. Simplified80.9%

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

    if 4.2000000000000002e-50 < F < 1.94999999999999996e-4

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in F around inf 92.6%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Taylor expanded in x around 0 92.6%

      \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]

    if 1.94999999999999996e-4 < F

    1. Initial program 51.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.006:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.55 \cdot 10^{-75}:\\ \;\;\;\;\frac{1}{\frac{\sin B}{F \cdot \sqrt{0.5}}}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 0.000195:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 9: 91.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.108:\\
\;\;\;\;t_0 + \frac{1}{\frac{B \cdot \sqrt{2}}{F}}\\

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


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

    1. Initial program 60.3%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv52.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.5%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.5%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.5%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp35.2%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative35.2%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.5%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -7 < F < 0.107999999999999999

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.107999999999999999 < F

    1. Initial program 51.9%

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

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

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

Alternative 10: 72.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -4.8 \cdot 10^{-78}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 60.8%

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

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

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

    if -0.028500000000000001 < F < -4.79999999999999999e-78 or 9.1999999999999995e-58 < F < 3.89999999999999993e-4

    1. Initial program 99.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in F around inf 86.4%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Taylor expanded in x around 0 86.5%

      \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]

    if -4.79999999999999999e-78 < F < 9.1999999999999995e-58

    1. Initial program 99.5%

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

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

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

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

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

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

    if 3.89999999999999993e-4 < F

    1. Initial program 51.9%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0285:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.8 \cdot 10^{-78}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{-\cos B}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 0.00039:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 11: 72.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.95 \cdot 10^{-81}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 60.8%

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

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

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

    if -0.085999999999999993 < F < -1.94999999999999992e-81 or 1.59999999999999993e-56 < F < 0.0570000000000000021

    1. Initial program 99.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in F around inf 86.4%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Taylor expanded in x around 0 86.5%

      \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]

    if -1.94999999999999992e-81 < F < 1.59999999999999993e-56

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
      3. associate-/r/80.8%

        \[\leadsto -\color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      4. distribute-rgt-neg-in80.8%

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

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

    if 0.0570000000000000021 < F

    1. Initial program 51.9%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.086:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.95 \cdot 10^{-81}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-56}:\\ \;\;\;\;x \cdot \left(-\frac{\cos B}{\sin B}\right)\\ \mathbf{elif}\;F \leq 0.057:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 12: 72.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -2.65 \cdot 10^{-80}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 60.8%

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

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

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

    if -0.116000000000000006 < F < -2.65000000000000013e-80 or 2.10000000000000002e-51 < F < 4.55e-4

    1. Initial program 99.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in F around inf 86.4%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Taylor expanded in x around 0 86.5%

      \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]

    if -2.65000000000000013e-80 < F < 2.10000000000000002e-51

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.55e-4 < F

    1. Initial program 51.9%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.116:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.65 \cdot 10^{-80}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-51}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 0.000455:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 13: 72.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -3.2 \cdot 10^{-74}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 60.8%

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

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

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

    if -0.0100000000000000002 < F < -3.1999999999999999e-74 or 2.6500000000000002e-58 < F < 8.49999999999999953e-4

    1. Initial program 99.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in F around inf 86.4%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Taylor expanded in x around 0 86.5%

      \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]

    if -3.1999999999999999e-74 < F < 2.6500000000000002e-58

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
      4. neg-mul-180.9%

        \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
    8. Simplified80.9%

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

    if 8.49999999999999953e-4 < F

    1. Initial program 51.9%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.01:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-74}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 2.65 \cdot 10^{-58}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 0.00085:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 14: 79.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.15 \cdot 10^{-79}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 60.8%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv52.0%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def52.0%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.0%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.0%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.0%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp34.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative34.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.0%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -0.00209999999999999987 < F < -1.15000000000000006e-79 or 1.08000000000000006e-36 < F < 1.49999999999999987e-4

    1. Initial program 99.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in F around inf 86.4%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Taylor expanded in x around 0 86.5%

      \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]

    if -1.15000000000000006e-79 < F < 1.08000000000000006e-36

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
      4. neg-mul-180.9%

        \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
    8. Simplified80.9%

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

    if 1.49999999999999987e-4 < F

    1. Initial program 51.9%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0021:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.15 \cdot 10^{-79}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 1.08 \cdot 10^{-36}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 0.00015:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 15: 79.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.0019:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-77}:\\ \;\;\;\;\frac{1}{\frac{\sin B}{F \cdot \sqrt{0.5}}}\\ \mathbf{elif}\;F \leq 1.66 \cdot 10^{-53}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 0.0004:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -0.0019)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F -1.6e-77)
       (/ 1.0 (/ (sin B) (* F (sqrt 0.5))))
       (if (<= F 1.66e-53)
         (/ (* x (- (cos B))) (sin B))
         (if (<= F 0.0004)
           (* (/ F (sin B)) (sqrt 0.5))
           (- (* F (/ 1.0 (* F B))) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -0.0019) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= -1.6e-77) {
		tmp = 1.0 / (sin(B) / (F * sqrt(0.5)));
	} else if (F <= 1.66e-53) {
		tmp = (x * -cos(B)) / sin(B);
	} else if (F <= 0.0004) {
		tmp = (F / sin(B)) * sqrt(0.5);
	} else {
		tmp = (F * (1.0 / (F * 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.0019d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= (-1.6d-77)) then
        tmp = 1.0d0 / (sin(b) / (f * sqrt(0.5d0)))
    else if (f <= 1.66d-53) then
        tmp = (x * -cos(b)) / sin(b)
    else if (f <= 0.0004d0) then
        tmp = (f / sin(b)) * sqrt(0.5d0)
    else
        tmp = (f * (1.0d0 / (f * 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.0019) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= -1.6e-77) {
		tmp = 1.0 / (Math.sin(B) / (F * Math.sqrt(0.5)));
	} else if (F <= 1.66e-53) {
		tmp = (x * -Math.cos(B)) / Math.sin(B);
	} else if (F <= 0.0004) {
		tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
	} else {
		tmp = (F * (1.0 / (F * B))) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -0.0019:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= -1.6e-77:
		tmp = 1.0 / (math.sin(B) / (F * math.sqrt(0.5)))
	elif F <= 1.66e-53:
		tmp = (x * -math.cos(B)) / math.sin(B)
	elif F <= 0.0004:
		tmp = (F / math.sin(B)) * math.sqrt(0.5)
	else:
		tmp = (F * (1.0 / (F * B))) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -0.0019)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= -1.6e-77)
		tmp = Float64(1.0 / Float64(sin(B) / Float64(F * sqrt(0.5))));
	elseif (F <= 1.66e-53)
		tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B));
	elseif (F <= 0.0004)
		tmp = Float64(Float64(F / sin(B)) * sqrt(0.5));
	else
		tmp = Float64(Float64(F * Float64(1.0 / Float64(F * 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.0019)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= -1.6e-77)
		tmp = 1.0 / (sin(B) / (F * sqrt(0.5)));
	elseif (F <= 1.66e-53)
		tmp = (x * -cos(B)) / sin(B);
	elseif (F <= 0.0004)
		tmp = (F / sin(B)) * sqrt(0.5);
	else
		tmp = (F * (1.0 / (F * 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.0019], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.6e-77], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.66e-53], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0004], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.6 \cdot 10^{-77}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{F \cdot \sqrt{0.5}}}\\

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

\mathbf{elif}\;F \leq 0.0004:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\

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


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

    1. Initial program 60.8%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv52.0%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def52.0%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.0%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.0%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.0%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp34.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative34.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.0%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.9%

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

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

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

    if -0.0019 < F < -1.6e-77

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{\sin B}} \]
    6. Step-by-step derivation
      1. associate-/l*83.0%

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified83.0%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    8. Step-by-step derivation
      1. clear-num83.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\sin B}{F}}{\sqrt{0.5}}}} \]
      2. inv-pow83.2%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sin B}{F}}{\sqrt{0.5}}\right)}^{-1}} \]
    9. Applied egg-rr83.2%

      \[\leadsto \color{blue}{{\left(\frac{\frac{\sin B}{F}}{\sqrt{0.5}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-183.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\sin B}{F}}{\sqrt{0.5}}}} \]
      2. associate-/l/83.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{\sin B}{\sqrt{0.5} \cdot F}}} \]
    11. Simplified83.4%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5} \cdot F}}} \]

    if -1.6e-77 < F < 1.66e-53

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
      4. neg-mul-180.9%

        \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
    8. Simplified80.9%

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

    if 1.66e-53 < F < 4.00000000000000019e-4

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in F around inf 92.6%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Taylor expanded in x around 0 92.6%

      \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]

    if 4.00000000000000019e-4 < F

    1. Initial program 51.9%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0019:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-77}:\\ \;\;\;\;\frac{1}{\frac{\sin B}{F \cdot \sqrt{0.5}}}\\ \mathbf{elif}\;F \leq 1.66 \cdot 10^{-53}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 0.0004:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 16: 63.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.25 \cdot 10^{-82}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\

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

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

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


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

    1. Initial program 60.8%

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

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

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

    if -0.00305000000000000019 < F < -1.25e-82

    1. Initial program 99.1%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in F around inf 83.0%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Taylor expanded in x around 0 83.0%

      \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]

    if -1.25e-82 < F < -1.45e-307

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

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

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

    if -1.45e-307 < F < 4.00000000000000011e-161

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000011e-161 < F

    1. Initial program 63.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative86.1%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 70.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00305:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.25 \cdot 10^{-82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{-307}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-161}:\\ \;\;\;\;\frac{1}{\sqrt{2 + x \cdot 2} \cdot \frac{B}{F}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 17: 62.2% accurate, 2.7× speedup?

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

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

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

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

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


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

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

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

    if -1.9e18 < F < -1.62e-307

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

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

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

    if -1.62e-307 < F < 9.4999999999999996e-161

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.4999999999999996e-161 < F

    1. Initial program 63.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative86.1%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 70.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.62 \cdot 10^{-307}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-161}:\\ \;\;\;\;\frac{1}{\sqrt{2 + x \cdot 2} \cdot \frac{B}{F}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 18: 62.1% accurate, 2.7× speedup?

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

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

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

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

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


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

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

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

    if -2.7e18 < F < -1.7500000000000001e-307

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

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

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

    if -1.7500000000000001e-307 < F < 3.0999999999999999e-162

    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. +-commutative99.5%

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

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

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

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

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

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

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

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

    if 3.0999999999999999e-162 < F

    1. Initial program 63.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative86.1%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 70.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.75 \cdot 10^{-307}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-162}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 19: 61.5% accurate, 2.8× speedup?

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

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

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

\mathbf{elif}\;F \leq 6.4 \cdot 10^{-164}:\\
\;\;\;\;\frac{-x}{\sin B}\\

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


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

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

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

    if -2.5e18 < F < -2.05000000000000016e-307

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

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

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

    if -2.05000000000000016e-307 < F < 6.4000000000000001e-164

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

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

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

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

    if 6.4000000000000001e-164 < F

    1. Initial program 63.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative86.1%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 70.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.05 \cdot 10^{-307}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{-164}:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 20: 57.2% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{-46} \lor \neg \left(x \leq 1.1 \cdot 10^{-30}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.2000000000000004e-46 or 1.09999999999999992e-30 < x

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

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

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

    if -5.2000000000000004e-46 < x < 1.09999999999999992e-30

    1. Initial program 67.3%

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

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

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

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

Alternative 21: 45.5% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 63.7%

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

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

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

    if -6.50000000000000006e-55 < F

    1. Initial program 79.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-55}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\sin B}\\ \end{array} \]

Alternative 22: 38.1% accurate, 3.1× speedup?

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

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

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


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub46.4%

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

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

    if -4.20000000000000012e-56 < F

    1. Initial program 79.6%

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

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

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

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

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

Alternative 23: 36.1% accurate, 26.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      4. distribute-neg-frac44.7%

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub44.7%

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

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

    if -3.7999999999999999e-126 < F

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(\frac{x}{B} + \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    5. Step-by-step derivation
      1. *-commutative32.8%

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}\right) \]
      2. distribute-rgt-out--32.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-126}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \end{array} \]

Alternative 24: 31.2% accurate, 39.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-134} \lor \neg \left(x \leq 2.5 \cdot 10^{-123}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.10000000000000006e-134 or 2.50000000000000015e-123 < x

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000006e-134 < x < 2.50000000000000015e-123

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-134} \lor \neg \left(x \leq 2.5 \cdot 10^{-123}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]

Alternative 25: 36.4% accurate, 45.9× speedup?

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

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

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


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

    1. Initial program 64.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub46.0%

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

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

    if -3.1999999999999999e-74 < F

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 20.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/20.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in20.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval20.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-120.4%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified20.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 32.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/32.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-132.3%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified32.3%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-74}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 26: 10.1% 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 74.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 58.0%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  3. Taylor expanded in B around 0 28.8%

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  4. Step-by-step derivation
    1. associate-*r/28.8%

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. distribute-lft-in28.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval28.8%

      \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
    4. neg-mul-128.8%

      \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
  5. Simplified28.8%

    \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
  6. Taylor expanded in x around 0 9.5%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification9.5%

    \[\leadsto \frac{-1}{B} \]

Reproduce

?
herbie shell --seed 2023242 
(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))))))