VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.8% → 99.5%
Time: 18.9s
Alternatives: 25
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 25 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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 55.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. Step-by-step derivation
      1. +-commutative55.8%

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

        \[\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/67.3%

        \[\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/67.3%

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

        \[\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. Simplified67.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 x around 0 67.4%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity67.4%

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

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

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

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

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

    if -1.9999999999999999e45 < F < 48

    1. Initial program 99.4%

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

      \[\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)} \]
    3. Step-by-step derivation
      1. associate-*r/99.6%

        \[\leadsto \left(-\color{blue}{\cos B \cdot \frac{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)} \]
    4. Simplified99.6%

      \[\leadsto \left(-\color{blue}{\cos B \cdot \frac{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 48 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/80.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/80.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. *-commutative80.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. Simplified80.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 x around 0 80.6%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity80.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef80.5%

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

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

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

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

Alternative 2: 99.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.2 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -2.2e+154)
     (- (/ -1.0 (sin B)) (* (cos B) (/ x (sin B))))
     (if (<= F 200000000.0)
       (- (/ F (* (sin B) (sqrt (fma F F 2.0)))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -2.2e+154) {
		tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
	} else if (F <= 200000000.0) {
		tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -2.2e+154)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B))));
	elseif (F <= 200000000.0)
		tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.2e+154], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 200000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t_0\\

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


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

    1. Initial program 30.3%

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

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

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

        \[\leadsto \left(-\color{blue}{\cos B \cdot \frac{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)} \]
    5. Simplified99.7%

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

    if -2.2000000000000001e154 < F < 2e8

    1. Initial program 98.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. Step-by-step derivation
      1. +-commutative98.0%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.5%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u81.8%

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval65.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv65.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr65.8%

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

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

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/99.6%

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

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

    if 2e8 < F

    1. Initial program 64.1%

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

        \[\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/79.9%

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

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

      \[\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 x around 0 80.1%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity80.0%

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

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

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

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

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

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

Alternative 3: 99.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 48:\\
\;\;\;\;\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}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\


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

    1. Initial program 55.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. Step-by-step derivation
      1. +-commutative55.8%

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

        \[\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/67.3%

        \[\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/67.3%

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

        \[\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. Simplified67.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 x around 0 67.4%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity67.4%

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

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

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

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

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

    if -1.0000000000000001e44 < F < 48

    1. Initial program 99.4%

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

    if 48 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/80.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/80.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. *-commutative80.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. Simplified80.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 x around 0 80.6%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity80.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef80.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+44}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 48:\\ \;\;\;\;\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}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 4: 99.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.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. +-commutative54.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-neg54.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/66.0%

        \[\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/66.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. *-commutative66.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. Simplified66.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 x around 0 66.1%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity66.1%

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

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

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

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

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

    if -3.00000000000000002e66 < F < 48

    1. Initial program 99.4%

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

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

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

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

    if 48 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/80.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/80.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. *-commutative80.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. Simplified80.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 x around 0 80.6%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity80.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef80.5%

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

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

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

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

Alternative 5: 99.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.8%

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

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

        \[\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/70.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/70.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. *-commutative70.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. Simplified70.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 x around 0 70.2%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.3%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u55.0%

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval54.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv54.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr54.9%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p70.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/70.4%

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

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

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

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

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

    if -0.900000000000000022 < F < 1.3999999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.5%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u87.9%

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv65.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr65.1%

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

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

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/99.6%

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/80.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/80.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. *-commutative80.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. Simplified80.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 x around 0 80.6%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity80.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef80.5%

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

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

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

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

Alternative 6: 99.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.8%

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

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

        \[\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/70.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/70.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. *-commutative70.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. Simplified70.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 x around 0 70.2%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.3%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u55.0%

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval54.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv54.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr54.9%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p70.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/70.4%

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

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

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

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

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

    if -0.92000000000000004 < F < 1.3999999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.5%

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/80.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/80.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. *-commutative80.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. Simplified80.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 x around 0 80.6%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity80.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef80.5%

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

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

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

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

Alternative 7: 87.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -7 \cdot 10^{-274}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 6.6 \cdot 10^{-23}:\\
\;\;\;\;\frac{F}{\sin B \cdot t_1} - t_2\\

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

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


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

    1. Initial program 58.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. Step-by-step derivation
      1. +-commutative58.8%

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

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

        \[\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.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. *-commutative69.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. Simplified69.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 x around 0 69.6%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity69.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef69.6%

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

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

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

    if -6.8e5 < F < -6.99999999999999963e-274 or 6.60000000000000041e-23 < F < 1.37999999999999995e-8

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

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

    if -6.99999999999999963e-274 < F < 6.60000000000000041e-23

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.5%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u97.7%

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. sqrt-div79.3%

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv79.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr79.3%

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

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

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/99.6%

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

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

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

    if 1.37999999999999995e-8 < F

    1. Initial program 66.0%

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

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

        \[\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/81.0%

        \[\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/81.0%

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

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

      \[\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 x around 0 81.1%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity81.0%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/81.1%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr81.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -680000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7 \cdot 10^{-274}:\\ \;\;\;\;\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 6.6 \cdot 10^{-23}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.38 \cdot 10^{-8}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 8: 87.1% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -7 \cdot 10^{-274}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq 1.38 \cdot 10^{-8}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 59.8%

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

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

        \[\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/70.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/70.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. *-commutative70.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. Simplified70.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 x around 0 70.2%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.3%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u55.0%

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval54.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv54.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr54.9%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p70.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/70.4%

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

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

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

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

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

    if -0.016500000000000001 < F < -6.99999999999999963e-274 or 6.99999999999999987e-23 < F < 1.37999999999999995e-8

    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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} \]
      2. +-commutative99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.99999999999999963e-274 < F < 6.99999999999999987e-23

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.5%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u97.7%

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. sqrt-div79.3%

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv79.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr79.3%

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

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

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/99.6%

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

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

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

    if 1.37999999999999995e-8 < F

    1. Initial program 66.0%

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

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

        \[\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/81.0%

        \[\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/81.0%

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

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

      \[\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 x around 0 81.1%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity81.0%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/81.1%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr81.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0165:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(\frac{-1}{F} - F\right)} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7 \cdot 10^{-274}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\frac{\sin B}{F}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-23}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.38 \cdot 10^{-8}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\frac{\sin B}{F}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 9: 84.8% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 64.2%

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

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

        \[\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/73.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/73.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. *-commutative73.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. Simplified73.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 x around 0 73.5%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity73.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef73.5%

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

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

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

    if -2.7000000000000002e-80 < F

    1. Initial program 83.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. Step-by-step derivation
      1. +-commutative83.8%

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

        \[\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/90.8%

        \[\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/90.7%

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

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

      \[\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 x around 0 90.9%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity90.9%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef90.9%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u74.7%

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv63.7%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/90.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    10. Simplified90.9%

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

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

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

Alternative 10: 84.9% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 64.2%

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

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

        \[\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/73.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/73.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. *-commutative73.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. Simplified73.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 x around 0 73.5%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity73.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef73.5%

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

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

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

    if -2.7000000000000002e-80 < F

    1. Initial program 83.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. Step-by-step derivation
      1. +-commutative83.8%

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

        \[\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/90.8%

        \[\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/90.7%

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

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

      \[\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 x around 0 90.9%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity90.9%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef90.9%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/90.9%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv90.9%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr90.9%

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

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

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

Alternative 11: 85.4% accurate, 1.5× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. +-commutative64.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-neg64.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/74.0%

        \[\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/74.0%

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

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

      \[\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 x around 0 74.0%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity74.0%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u55.6%

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval49.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv49.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr49.9%

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

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

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      3. associate-/l/74.1%

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

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

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

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

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

    if -3.00000000000000026e-116 < F

    1. Initial program 83.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. +-commutative83.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-neg83.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/90.7%

        \[\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/90.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. *-commutative90.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. Simplified90.8%

      \[\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 x around 0 90.8%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity90.8%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef90.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/90.8%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv90.8%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr90.8%

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

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

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

Alternative 12: 69.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -6.2 \cdot 10^{+110}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq -1.22 \cdot 10^{-57}:\\
\;\;\;\;t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.9000000000000001e156 or -6.20000000000000035e110 < F < -1.2200000000000001e-57

    1. Initial program 59.8%

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

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

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

    if -2.9000000000000001e156 < F < -6.20000000000000035e110

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\cos B \cdot x\right) \cdot \frac{1}{\sin B}} \]
      2. distribute-rgt-neg-in86.1%

        \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr86.1%

      \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right) \cdot \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. un-div-inv86.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
      6. distribute-lft-neg-in86.1%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      7. neg-sub086.1%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    9. Applied egg-rr86.4%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Step-by-step derivation
      1. neg-sub086.4%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac86.4%

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

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

    if -1.2200000000000001e-57 < F < 2.4999999999999998e-94

    1. Initial program 99.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr75.9%

      \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right) \cdot \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. un-div-inv76.2%

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

        \[\leadsto \color{blue}{\frac{-\cos B \cdot \left(-x\right)}{-\sin B}} \]
      3. *-rgt-identity76.2%

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

        \[\leadsto \frac{-\color{blue}{\cos B \cdot \left(-x\right)}}{-\sin B} \]
      5. add-sqr-sqrt20.4%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)}}{-\sin B} \]
      6. sqrt-unprod17.6%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\sin B} \]
      7. sqr-neg17.6%

        \[\leadsto \frac{-\cos B \cdot \sqrt{\color{blue}{x \cdot x}}}{-\sin B} \]
      8. sqrt-unprod1.0%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{-\sin B} \]
      9. add-sqr-sqrt2.2%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{x}}{-\sin B} \]
      10. distribute-rgt-neg-out2.2%

        \[\leadsto \frac{\color{blue}{\cos B \cdot \left(-x\right)}}{-\sin B} \]
      11. add-sqr-sqrt1.2%

        \[\leadsto \frac{\cos B \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)}}{-\sin B} \]
      12. sqrt-unprod40.7%

        \[\leadsto \frac{\cos B \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\sin B} \]
      13. sqr-neg40.7%

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

        \[\leadsto \frac{\cos B \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{-\sin B} \]
      15. add-sqr-sqrt76.2%

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

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

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

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

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

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

    if 2.4999999999999998e-94 < F

    1. Initial program 71.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{+156}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{+110}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -1.22 \cdot 10^{-57}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-94}:\\ \;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 13: 84.7% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 64.2%

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

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

        \[\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/73.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/73.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. *-commutative73.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. Simplified73.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 x around 0 73.5%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity73.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef73.5%

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

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

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

    if -2.7000000000000002e-80 < F < 8.00000000000000045e-32

    1. Initial program 99.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\cos B \cdot x\right) \cdot \frac{1}{\sin B}} \]
      2. distribute-rgt-neg-in77.7%

        \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr77.7%

      \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right) \cdot \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. un-div-inv78.0%

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

        \[\leadsto \color{blue}{\frac{-\cos B \cdot \left(-x\right)}{-\sin B}} \]
      3. *-rgt-identity78.0%

        \[\leadsto \frac{-\color{blue}{\left(\cos B \cdot \left(-x\right)\right) \cdot 1}}{-\sin B} \]
      4. *-rgt-identity78.0%

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

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

        \[\leadsto \frac{-\cos B \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\sin B} \]
      7. sqr-neg19.8%

        \[\leadsto \frac{-\cos B \cdot \sqrt{\color{blue}{x \cdot x}}}{-\sin B} \]
      8. sqrt-unprod1.0%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{-\sin B} \]
      9. add-sqr-sqrt1.9%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{x}}{-\sin B} \]
      10. distribute-rgt-neg-out1.9%

        \[\leadsto \frac{\color{blue}{\cos B \cdot \left(-x\right)}}{-\sin B} \]
      11. add-sqr-sqrt0.9%

        \[\leadsto \frac{\cos B \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)}}{-\sin B} \]
      12. sqrt-unprod39.7%

        \[\leadsto \frac{\cos B \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\sin B} \]
      13. sqr-neg39.7%

        \[\leadsto \frac{\cos B \cdot \sqrt{\color{blue}{x \cdot x}}}{-\sin B} \]
      14. sqrt-unprod55.3%

        \[\leadsto \frac{\cos B \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{-\sin B} \]
      15. add-sqr-sqrt78.0%

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

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

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

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

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

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

    if 8.00000000000000045e-32 < F

    1. Initial program 69.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. +-commutative69.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-neg69.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/82.9%

        \[\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/82.8%

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

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

      \[\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 x around 0 82.9%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity82.8%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef82.8%

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

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

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

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

Alternative 14: 77.2% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 64.2%

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

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

        \[\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/73.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/73.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. *-commutative73.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. Simplified73.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 x around 0 73.5%

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity73.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef73.5%

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

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

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

    if -2.7000000000000002e-80 < F < 6.6999999999999999e-99

    1. Initial program 99.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\cos B \cdot x\right) \cdot \frac{1}{\sin B}} \]
      2. distribute-rgt-neg-in77.6%

        \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr77.6%

      \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right) \cdot \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. un-div-inv77.9%

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

        \[\leadsto \color{blue}{\frac{-\cos B \cdot \left(-x\right)}{-\sin B}} \]
      3. *-rgt-identity77.9%

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

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

        \[\leadsto \frac{-\cos B \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)}}{-\sin B} \]
      6. sqrt-unprod18.3%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\sin B} \]
      7. sqr-neg18.3%

        \[\leadsto \frac{-\cos B \cdot \sqrt{\color{blue}{x \cdot x}}}{-\sin B} \]
      8. sqrt-unprod1.0%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{-\sin B} \]
      9. add-sqr-sqrt1.9%

        \[\leadsto \frac{-\cos B \cdot \color{blue}{x}}{-\sin B} \]
      10. distribute-rgt-neg-out1.9%

        \[\leadsto \frac{\color{blue}{\cos B \cdot \left(-x\right)}}{-\sin B} \]
      11. add-sqr-sqrt0.9%

        \[\leadsto \frac{\cos B \cdot \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)}}{-\sin B} \]
      12. sqrt-unprod40.7%

        \[\leadsto \frac{\cos B \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\sin B} \]
      13. sqr-neg40.7%

        \[\leadsto \frac{\cos B \cdot \sqrt{\color{blue}{x \cdot x}}}{-\sin B} \]
      14. sqrt-unprod56.3%

        \[\leadsto \frac{\cos B \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{-\sin B} \]
      15. add-sqr-sqrt77.9%

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

        \[\leadsto \frac{\color{blue}{x \cdot \cos B}}{-\sin B} \]
    9. Applied egg-rr77.9%

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

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

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

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

    if 6.6999999999999999e-99 < F

    1. Initial program 71.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.7 \cdot 10^{-99}:\\ \;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 15: 69.4% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq -5.9 \cdot 10^{+110}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 1.05 \cdot 10^{-60}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.5000000000000003e156 or -5.8999999999999997e110 < F < -1.2200000000000001e-57

    1. Initial program 59.8%

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

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

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

    if -5.5000000000000003e156 < F < -5.8999999999999997e110 or -1.2200000000000001e-57 < F < 1.04999999999999996e-60

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\cos B \cdot x\right)}{\sin B}} \]
      2. mul-1-neg78.3%

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

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

        \[\leadsto \color{blue}{\left(-\cos B \cdot x\right) \cdot \frac{1}{\sin B}} \]
      2. distribute-rgt-neg-in78.1%

        \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr78.1%

      \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right) \cdot \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. un-div-inv78.3%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
      6. distribute-lft-neg-in78.1%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      7. neg-sub078.1%

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

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

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Step-by-step derivation
      1. neg-sub078.4%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac78.4%

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

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

    if 1.04999999999999996e-60 < F

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{+156}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.9 \cdot 10^{+110}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -1.22 \cdot 10^{-57}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-60}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 16: 62.5% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -5.5 \cdot 10^{+156}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{+110}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.22 \cdot 10^{-57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 3600 \lor \neg \left(F \leq 1.75 \cdot 10^{+90}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B))) (t_1 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= F -5.5e+156)
     t_1
     (if (<= F -6.2e+110)
       t_0
       (if (<= F -1.22e-57)
         t_1
         (if (or (<= F 3600.0) (not (<= F 1.75e+90))) t_0 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double t_1 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -5.5e+156) {
		tmp = t_1;
	} else if (F <= -6.2e+110) {
		tmp = t_0;
	} else if (F <= -1.22e-57) {
		tmp = t_1;
	} else if ((F <= 3600.0) || !(F <= 1.75e+90)) {
		tmp = t_0;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = -x / tan(b)
    t_1 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-5.5d+156)) then
        tmp = t_1
    else if (f <= (-6.2d+110)) then
        tmp = t_0
    else if (f <= (-1.22d-57)) then
        tmp = t_1
    else if ((f <= 3600.0d0) .or. (.not. (f <= 1.75d+90))) then
        tmp = t_0
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -x / Math.tan(B);
	double t_1 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -5.5e+156) {
		tmp = t_1;
	} else if (F <= -6.2e+110) {
		tmp = t_0;
	} else if (F <= -1.22e-57) {
		tmp = t_1;
	} else if ((F <= 3600.0) || !(F <= 1.75e+90)) {
		tmp = t_0;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / math.tan(B)
	t_1 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -5.5e+156:
		tmp = t_1
	elif F <= -6.2e+110:
		tmp = t_0
	elif F <= -1.22e-57:
		tmp = t_1
	elif (F <= 3600.0) or not (F <= 1.75e+90):
		tmp = t_0
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -5.5e+156)
		tmp = t_1;
	elseif (F <= -6.2e+110)
		tmp = t_0;
	elseif (F <= -1.22e-57)
		tmp = t_1;
	elseif ((F <= 3600.0) || !(F <= 1.75e+90))
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / tan(B);
	t_1 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -5.5e+156)
		tmp = t_1;
	elseif (F <= -6.2e+110)
		tmp = t_0;
	elseif (F <= -1.22e-57)
		tmp = t_1;
	elseif ((F <= 3600.0) || ~((F <= 1.75e+90)))
		tmp = t_0;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.5e+156], t$95$1, If[LessEqual[F, -6.2e+110], t$95$0, If[LessEqual[F, -1.22e-57], t$95$1, If[Or[LessEqual[F, 3600.0], N[Not[LessEqual[F, 1.75e+90]], $MachinePrecision]], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -6.2 \cdot 10^{+110}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 3600 \lor \neg \left(F \leq 1.75 \cdot 10^{+90}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.5000000000000003e156 or -6.20000000000000035e110 < F < -1.2200000000000001e-57

    1. Initial program 59.8%

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

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

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

    if -5.5000000000000003e156 < F < -6.20000000000000035e110 or -1.2200000000000001e-57 < F < 3600 or 1.7499999999999999e90 < F

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\cos B \cdot x\right) \cdot \frac{1}{\sin B}} \]
      2. distribute-rgt-neg-in70.6%

        \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr70.6%

      \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right) \cdot \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. un-div-inv70.8%

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

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

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
      4. tan-quot70.8%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      5. un-div-inv70.7%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
      6. distribute-lft-neg-in70.7%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      7. neg-sub070.7%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    9. Applied egg-rr70.8%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Step-by-step derivation
      1. neg-sub070.8%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac70.8%

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

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

    if 3600 < F < 1.7499999999999999e90

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{+156}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{+110}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -1.22 \cdot 10^{-57}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3600 \lor \neg \left(F \leq 1.75 \cdot 10^{+90}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 17: 56.5% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;F \leq 6600000 \lor \neg \left(F \leq 4.5 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

    1. Initial program 30.1%

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

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

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

    if -4.50000000000000031e156 < F < 6.6e6 or 4.50000000000000007e85 < F

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\cos B \cdot x\right)}{\sin B}} \]
      2. mul-1-neg65.5%

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\left(\cos B \cdot \left(-x\right)\right) \cdot \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. un-div-inv65.5%

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

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

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

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      5. un-div-inv65.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
      6. distribute-lft-neg-in65.5%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      7. neg-sub065.5%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    9. Applied egg-rr65.6%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Step-by-step derivation
      1. neg-sub065.6%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac65.6%

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

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

    if 6.6e6 < F < 4.50000000000000007e85

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{+156}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6600000 \lor \neg \left(F \leq 4.5 \cdot 10^{+85}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 18: 45.3% accurate, 3.0× speedup?

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

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-18}:\\
\;\;\;\;\frac{-x}{\sin B}\\

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


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

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

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

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

    if -1.90000000000000007e-47 < F < 2.3000000000000001e-18

    1. Initial program 99.3%

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

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

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

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

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

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

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

    if 2.3000000000000001e-18 < F

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt30.8%

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

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}}\right) \]
      5. frac-times59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}}\right) \]
      6. metadata-eval59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      7. metadata-eval59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}}\right) \]
      8. frac-times59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}}\right) \]
      9. rgt-mult-inverse59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}}\right) \]
      10. associate-*l/59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}}\right) \]
      11. rgt-mult-inverse59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B}}\right) \]
      12. associate-*l/59.6%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}}\right) \]
      13. sqrt-unprod38.7%

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

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}}\right) \]
      15. associate-*l/94.0%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}}\right) \]
      16. rgt-mult-inverse94.1%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{1}{\sin B}\right)} \]
    5. Taylor expanded in B around 0 51.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{-47}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-18}:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot \left(x \cdot 0.3333333333333333 + 0.16666666666666666\right)\right) - \frac{x}{B}\\ \end{array} \]

Alternative 19: 44.2% accurate, 16.9× speedup?

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

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

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

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


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

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

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

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

    if -8.99999999999999948e-51 < F < 3.19999999999999982e-19

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999982e-19 < F

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. add-sqr-sqrt30.8%

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

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}}\right) \]
      5. frac-times59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}}\right) \]
      6. metadata-eval59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}}\right) \]
      7. metadata-eval59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}}\right) \]
      8. frac-times59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}}\right) \]
      9. rgt-mult-inverse59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}}\right) \]
      10. associate-*l/59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}}\right) \]
      11. rgt-mult-inverse59.7%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B}}\right) \]
      12. associate-*l/59.6%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}}\right) \]
      13. sqrt-unprod38.7%

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

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}}\right) \]
      15. associate-*l/94.0%

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}}\right) \]
      16. rgt-mult-inverse94.1%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{1}{\sin B}\right)} \]
    5. Taylor expanded in B around 0 51.6%

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

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

Alternative 20: 43.9% accurate, 21.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-52}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{-101}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4e-52)
   (+ (* B (- (* x 0.3333333333333333) 0.16666666666666666)) (/ (- -1.0 x) B))
   (if (<= F 1.22e-101) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4e-52) {
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
	} else if (F <= 1.22e-101) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-4d-52)) then
        tmp = (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0)) + (((-1.0d0) - x) / b)
    else if (f <= 1.22d-101) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -4e-52) {
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
	} else if (F <= 1.22e-101) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4e-52:
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B)
	elif F <= 1.22e-101:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4e-52)
		tmp = Float64(Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666)) + Float64(Float64(-1.0 - x) / B));
	elseif (F <= 1.22e-101)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4e-52)
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
	elseif (F <= 1.22e-101)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4e-52], N[(N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.22e-101], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

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

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

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

    if -4e-52 < F < 1.2199999999999999e-101

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2199999999999999e-101 < F

    1. Initial program 71.0%

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

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

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

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

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

Alternative 21: 37.0% accurate, 31.8× speedup?

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

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

\mathbf{elif}\;F \leq 5.6 \cdot 10^{-18} \lor \neg \left(F \leq 8.4 \cdot 10^{+92}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub45.4%

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

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

    if -3.1999999999999998e-48 < F < 5.60000000000000025e-18 or 8.39999999999999944e92 < F

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.60000000000000025e-18 < F < 8.39999999999999944e92

    1. Initial program 99.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-48}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.6 \cdot 10^{-18} \lor \neg \left(F \leq 8.4 \cdot 10^{+92}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]

Alternative 22: 43.8% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-100}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.7e-49)
   (/ (- -1.0 x) B)
   (if (<= F 8.2e-100) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.7e-49) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 8.2e-100) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.7d-49)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 8.2d-100) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.7e-49) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 8.2e-100) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.7e-49:
		tmp = (-1.0 - x) / B
	elif F <= 8.2e-100:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.7e-49)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 8.2e-100)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.7e-49)
		tmp = (-1.0 - x) / B;
	elseif (F <= 8.2e-100)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.7e-49], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.2e-100], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub45.4%

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

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

    if -1.70000000000000002e-49 < F < 8.1999999999999998e-100

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.1999999999999998e-100 < F

    1. Initial program 71.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-100}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 23: 17.7% accurate, 64.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 5.9 \cdot 10^{-179}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x) :precision binary64 (if (<= F 5.9e-179) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 5.9e-179) {
		tmp = -1.0 / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= 5.9d-179) then
        tmp = (-1.0d0) / b
    else
        tmp = 1.0d0 / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 5.9e-179) {
		tmp = -1.0 / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 5.9e-179:
		tmp = -1.0 / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 5.9e-179)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 5.9e-179)
		tmp = -1.0 / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 5.9e-179], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.9 \cdot 10^{-179}:\\
\;\;\;\;\frac{-1}{B}\\

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


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

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

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

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

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

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

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

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

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

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

    if 5.90000000000000029e-179 < F

    1. Initial program 75.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 5.9 \cdot 10^{-179}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]

Alternative 24: 29.5% accurate, 81.0× speedup?

\[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
	return -x / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -x / b
end function
public static double code(double F, double B, double x) {
	return -x / B;
}
def code(F, B, x):
	return -x / B
function code(F, B, x)
	return Float64(Float64(-x) / B)
end
function tmp = code(F, B, x)
	tmp = -x / B;
end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-x}{B}
\end{array}
Derivation
  1. Initial program 76.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 63.4%

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

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

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

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

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

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

    \[\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}} \]
  9. Final simplification32.3%

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

Alternative 25: 10.6% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 76.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 63.4%

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

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

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

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

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

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

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

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

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

Reproduce

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