VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.1% → 99.6%
Time: 17.6s
Alternatives: 23
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 23 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

\mathbf{elif}\;F \leq 1000000000:\\
\;\;\;\;\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.80000000000000005e43

    1. Initial program 44.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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000005e43 < F < 1e9

    1. Initial program 99.6%

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

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

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

      \[\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 1e9 < F

    1. Initial program 57.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. +-commutative57.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-neg57.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/72.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/72.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. *-commutative72.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. Simplified72.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 F around inf 99.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{+43}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1000000000:\\ \;\;\;\;\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, 1.0× speedup?

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

\mathbf{elif}\;F \leq 140000000:\\
\;\;\;\;\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.89999999999999999e53

    1. Initial program 41.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 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.89999999999999999e53 < F < 1.4e8

    1. Initial program 99.6%

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

    if 1.4e8 < F

    1. Initial program 57.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. +-commutative57.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-neg57.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/72.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/72.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. *-commutative72.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. Simplified72.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 F around inf 99.6%

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around 0 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 -1.9 \cdot 10^{+53}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 140000000:\\ \;\;\;\;\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 3: 99.1% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\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 < -1.8500000000000001

    1. Initial program 48.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8500000000000001 < F < 1.3999999999999999

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 57.7%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/73.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. *-commutative73.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. Simplified73.1%

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

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;F \cdot \frac{\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 -1.45)
     (- (/ -1.0 (sin B)) 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 <= -1.45) {
		tmp = (-1.0 / sin(B)) - 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 <= (-1.45d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1.4d0) then
        tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
    else
        tmp = (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 <= -1.45) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1.4) {
		tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.45:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1.4:
		tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0
	else:
		tmp = (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 <= -1.45)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1.4)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0);
	else
		tmp = Float64(Float64(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 <= -1.45)
		tmp = (-1.0 / sin(B)) - 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, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(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.45:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\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 < -1.44999999999999996

    1. Initial program 48.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.44999999999999996 < F < 1.3999999999999999

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 57.7%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/73.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. *-commutative73.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. Simplified73.1%

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

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

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

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

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

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

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

Alternative 5: 91.1% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq -9.6 \cdot 10^{-85}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq -7.8 \cdot 10^{-85}:\\
\;\;\;\;t_0\\

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

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


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

    1. Initial program 48.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000012e-5 < F < -3.2e-50 or -9.6000000000000002e-85 < F < -7.79999999999999977e-85

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.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/99.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. *-commutative99.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. Simplified99.7%

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

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

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

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

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

    if -3.2e-50 < F < -9.6000000000000002e-85

    1. Initial program 99.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 60.8%

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

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

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

        \[\leadsto -1 \cdot \color{blue}{{\left(\frac{\sin B}{\cos B \cdot x}\right)}^{-1}} \]
      3. *-un-lft-identity99.6%

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

        \[\leadsto -1 \cdot {\left(\frac{1 \cdot \sin B}{\color{blue}{x \cdot \cos B}}\right)}^{-1} \]
      5. times-frac99.3%

        \[\leadsto -1 \cdot {\color{blue}{\left(\frac{1}{x} \cdot \frac{\sin B}{\cos B}\right)}}^{-1} \]
      6. tan-quot99.8%

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

      \[\leadsto -1 \cdot \color{blue}{{\left(\frac{1}{x} \cdot \tan B\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{1}{x} \cdot \tan B}} \]
      2. *-commutative99.8%

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

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B \cdot 1}{x}}} \]
      4. *-commutative99.6%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{1 \cdot \tan B}}{x}} \]
      5. *-lft-identity99.6%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\tan B}}{x}} \]
      6. associate-/r/99.8%

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

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
      8. associate-*r/100.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      9. *-rgt-identity100.0%

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

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

    if -7.79999999999999977e-85 < F < 1.75e-9

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 1.75e-9 < F

    1. Initial program 59.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. +-commutative59.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-neg59.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/74.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/74.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. *-commutative74.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. Simplified74.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq -9.6 \cdot 10^{-85}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -7.8 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-9}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 6: 91.7% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 44.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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5e38 < F < -8.59999999999999995e-50

    1. Initial program 99.7%

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

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

    if -8.59999999999999995e-50 < F < 1.75e-9

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

    if 1.75e-9 < F

    1. Initial program 59.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. +-commutative59.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-neg59.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/74.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/74.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. *-commutative74.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. Simplified74.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{+38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8.6 \cdot 10^{-50}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-9}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 7: 85.8% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 1.3 \cdot 10^{-25}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

    1. Initial program 48.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0280000000000000006 < F < -6.49999999999999987e-50

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    if -6.49999999999999987e-50 < F < 1.3e-25

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{{\left(\frac{\sin B}{\cos B \cdot x}\right)}^{-1}} \]
      3. *-un-lft-identity78.8%

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

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

        \[\leadsto -1 \cdot {\color{blue}{\left(\frac{1}{x} \cdot \frac{\sin B}{\cos B}\right)}}^{-1} \]
      6. tan-quot78.9%

        \[\leadsto -1 \cdot {\left(\frac{1}{x} \cdot \color{blue}{\tan B}\right)}^{-1} \]
    5. Applied egg-rr78.9%

      \[\leadsto -1 \cdot \color{blue}{{\left(\frac{1}{x} \cdot \tan B\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-178.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{1}{x} \cdot \tan B}} \]
      2. *-commutative78.9%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B \cdot \frac{1}{x}}} \]
      3. associate-*r/78.8%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B \cdot 1}{x}}} \]
      4. *-commutative78.8%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{1 \cdot \tan B}}{x}} \]
      5. *-lft-identity78.8%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\tan B}}{x}} \]
      6. associate-/r/78.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{1}{\tan B} \cdot x\right)} \]
      7. *-commutative78.9%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
      8. associate-*r/79.1%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      9. *-rgt-identity79.1%

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

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

    if 1.3e-25 < F

    1. Initial program 59.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. +-commutative59.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-neg59.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/74.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/74.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. *-commutative74.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. Simplified74.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.028:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{-50}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-25}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 8: 65.7% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 9.6 \cdot 10^{+146}:\\
\;\;\;\;\left(t_0 + \frac{1}{B}\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 6 \cdot 10^{+210}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 48.7%

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

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

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

    if -0.0179999999999999986 < F < -4.49999999999999962e-50

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    if -4.49999999999999962e-50 < F < 4.4e9 or 9.6000000000000008e146 < F < 6.00000000000000044e210

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{{\left(\frac{\sin B}{\cos B \cdot x}\right)}^{-1}} \]
      3. *-un-lft-identity74.6%

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

        \[\leadsto -1 \cdot {\left(\frac{1 \cdot \sin B}{\color{blue}{x \cdot \cos B}}\right)}^{-1} \]
      5. times-frac74.5%

        \[\leadsto -1 \cdot {\color{blue}{\left(\frac{1}{x} \cdot \frac{\sin B}{\cos B}\right)}}^{-1} \]
      6. tan-quot74.6%

        \[\leadsto -1 \cdot {\left(\frac{1}{x} \cdot \color{blue}{\tan B}\right)}^{-1} \]
    5. Applied egg-rr74.6%

      \[\leadsto -1 \cdot \color{blue}{{\left(\frac{1}{x} \cdot \tan B\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-174.6%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{1}{x} \cdot \tan B}} \]
      2. *-commutative74.6%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B \cdot \frac{1}{x}}} \]
      3. associate-*r/74.7%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B \cdot 1}{x}}} \]
      4. *-commutative74.7%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{1 \cdot \tan B}}{x}} \]
      5. *-lft-identity74.7%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\tan B}}{x}} \]
      6. associate-/r/74.7%

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{1}{\tan B} \cdot x\right)} \]
      7. *-commutative74.7%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
      8. associate-*r/74.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      9. *-rgt-identity74.9%

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

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

    if 4.4e9 < F < 9.6000000000000008e146

    1. Initial program 86.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. +-commutative86.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-neg86.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/99.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/99.5%

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

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

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

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

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

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

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

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

    if 6.00000000000000044e210 < F

    1. Initial program 25.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. +-commutative25.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-neg25.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/44.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/44.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. *-commutative44.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. Simplified45.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 F around inf 99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.018:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-50}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 4400000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{+146}:\\ \;\;\;\;\left(B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+210}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 9: 72.0% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 7.8 \cdot 10^{+146}:\\
\;\;\;\;\left(t_0 + \frac{1}{B}\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.85 \cdot 10^{+211}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 48.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.00145 < F < -4.2000000000000002e-50

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000002e-50 < F < 4.4e9 or 7.8e146 < F < 1.85000000000000005e211

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{{\left(\frac{\sin B}{\cos B \cdot x}\right)}^{-1}} \]
      3. *-un-lft-identity74.6%

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

        \[\leadsto -1 \cdot {\left(\frac{1 \cdot \sin B}{\color{blue}{x \cdot \cos B}}\right)}^{-1} \]
      5. times-frac74.5%

        \[\leadsto -1 \cdot {\color{blue}{\left(\frac{1}{x} \cdot \frac{\sin B}{\cos B}\right)}}^{-1} \]
      6. tan-quot74.6%

        \[\leadsto -1 \cdot {\left(\frac{1}{x} \cdot \color{blue}{\tan B}\right)}^{-1} \]
    5. Applied egg-rr74.6%

      \[\leadsto -1 \cdot \color{blue}{{\left(\frac{1}{x} \cdot \tan B\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-174.6%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{1}{x} \cdot \tan B}} \]
      2. *-commutative74.6%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B \cdot \frac{1}{x}}} \]
      3. associate-*r/74.7%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B \cdot 1}{x}}} \]
      4. *-commutative74.7%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{1 \cdot \tan B}}{x}} \]
      5. *-lft-identity74.7%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\tan B}}{x}} \]
      6. associate-/r/74.7%

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{1}{\tan B} \cdot x\right)} \]
      7. *-commutative74.7%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
      8. associate-*r/74.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      9. *-rgt-identity74.9%

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

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

    if 4.4e9 < F < 7.8e146

    1. Initial program 86.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. +-commutative86.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-neg86.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/99.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/99.5%

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

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

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

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

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

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

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

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

    if 1.85000000000000005e211 < F

    1. Initial program 25.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. +-commutative25.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-neg25.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/44.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/44.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. *-commutative44.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. Simplified45.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 F around inf 99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00145:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 4400000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{+146}:\\ \;\;\;\;\left(B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.85 \cdot 10^{+211}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 10: 57.6% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ t_1 := B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right)\\ \mathbf{if}\;F \leq -2.45 \cdot 10^{+35}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4400000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+147}:\\ \;\;\;\;\left(t_1 + \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+210}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1 + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B)))
        (t_1 (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))))
   (if (<= F -2.45e+35)
     (- (/ -1.0 B) (/ x B))
     (if (<= F 4400000000.0)
       t_0
       (if (<= F 1.05e+147)
         (- (+ t_1 (/ 1.0 B)) (/ x B))
         (if (<= F 6e+210) t_0 (+ t_1 (/ (- 1.0 x) B))))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	double tmp;
	if (F <= -2.45e+35) {
		tmp = (-1.0 / B) - (x / B);
	} else if (F <= 4400000000.0) {
		tmp = t_0;
	} else if (F <= 1.05e+147) {
		tmp = (t_1 + (1.0 / B)) - (x / B);
	} else if (F <= 6e+210) {
		tmp = t_0;
	} else {
		tmp = t_1 + ((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 = b * (0.16666666666666666d0 + (x * 0.3333333333333333d0))
    if (f <= (-2.45d+35)) then
        tmp = ((-1.0d0) / b) - (x / b)
    else if (f <= 4400000000.0d0) then
        tmp = t_0
    else if (f <= 1.05d+147) then
        tmp = (t_1 + (1.0d0 / b)) - (x / b)
    else if (f <= 6d+210) then
        tmp = t_0
    else
        tmp = t_1 + ((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 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	double tmp;
	if (F <= -2.45e+35) {
		tmp = (-1.0 / B) - (x / B);
	} else if (F <= 4400000000.0) {
		tmp = t_0;
	} else if (F <= 1.05e+147) {
		tmp = (t_1 + (1.0 / B)) - (x / B);
	} else if (F <= 6e+210) {
		tmp = t_0;
	} else {
		tmp = t_1 + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / math.tan(B)
	t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333))
	tmp = 0
	if F <= -2.45e+35:
		tmp = (-1.0 / B) - (x / B)
	elif F <= 4400000000.0:
		tmp = t_0
	elif F <= 1.05e+147:
		tmp = (t_1 + (1.0 / B)) - (x / B)
	elif F <= 6e+210:
		tmp = t_0
	else:
		tmp = t_1 + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	t_1 = Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333)))
	tmp = 0.0
	if (F <= -2.45e+35)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / B));
	elseif (F <= 4400000000.0)
		tmp = t_0;
	elseif (F <= 1.05e+147)
		tmp = Float64(Float64(t_1 + Float64(1.0 / B)) - Float64(x / B));
	elseif (F <= 6e+210)
		tmp = t_0;
	else
		tmp = Float64(t_1 + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / tan(B);
	t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	tmp = 0.0;
	if (F <= -2.45e+35)
		tmp = (-1.0 / B) - (x / B);
	elseif (F <= 4400000000.0)
		tmp = t_0;
	elseif (F <= 1.05e+147)
		tmp = (t_1 + (1.0 / B)) - (x / B);
	elseif (F <= 6e+210)
		tmp = t_0;
	else
		tmp = t_1 + ((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[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.45e+35], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4400000000.0], t$95$0, If[LessEqual[F, 1.05e+147], N[(N[(t$95$1 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e+210], t$95$0, N[(t$95$1 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right)\\
\mathbf{if}\;F \leq -2.45 \cdot 10^{+35}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\

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

\mathbf{elif}\;F \leq 1.05 \cdot 10^{+147}:\\
\;\;\;\;\left(t_1 + \frac{1}{B}\right) - \frac{x}{B}\\

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

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


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

    1. Initial program 46.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 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45000000000000013e35 < F < 4.4e9 or 1.05000000000000003e147 < F < 6.00000000000000044e210

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{{\left(\frac{\sin B}{\cos B \cdot x}\right)}^{-1}} \]
      3. *-un-lft-identity69.7%

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

        \[\leadsto -1 \cdot {\left(\frac{1 \cdot \sin B}{\color{blue}{x \cdot \cos B}}\right)}^{-1} \]
      5. times-frac69.6%

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

        \[\leadsto -1 \cdot {\left(\frac{1}{x} \cdot \color{blue}{\tan B}\right)}^{-1} \]
    5. Applied egg-rr69.7%

      \[\leadsto -1 \cdot \color{blue}{{\left(\frac{1}{x} \cdot \tan B\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-169.7%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{1}{x} \cdot \tan B}} \]
      2. *-commutative69.7%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B \cdot \frac{1}{x}}} \]
      3. associate-*r/69.7%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B \cdot 1}{x}}} \]
      4. *-commutative69.7%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{1 \cdot \tan B}}{x}} \]
      5. *-lft-identity69.7%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\tan B}}{x}} \]
      6. associate-/r/69.8%

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

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
      8. associate-*r/70.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      9. *-rgt-identity70.0%

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

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

    if 4.4e9 < F < 1.05000000000000003e147

    1. Initial program 86.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. +-commutative86.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-neg86.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/99.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/99.5%

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

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

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

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

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

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

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

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

    if 6.00000000000000044e210 < F

    1. Initial program 25.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. +-commutative25.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-neg25.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/44.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/44.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. *-commutative44.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. Simplified45.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 F around inf 99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.45 \cdot 10^{+35}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4400000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+147}:\\ \;\;\;\;\left(B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+210}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 11: 63.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ t_1 := B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right)\\ \mathbf{if}\;F \leq -2.4 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 22500000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+147}:\\ \;\;\;\;\left(t_1 + \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 9.4 \cdot 10^{+210}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1 + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B)))
        (t_1 (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))))
   (if (<= F -2.4e-29)
     (- (/ -1.0 B) (/ x (tan B)))
     (if (<= F 22500000000.0)
       t_0
       (if (<= F 1.05e+147)
         (- (+ t_1 (/ 1.0 B)) (/ x B))
         (if (<= F 9.4e+210) t_0 (+ t_1 (/ (- 1.0 x) B))))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	double tmp;
	if (F <= -2.4e-29) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= 22500000000.0) {
		tmp = t_0;
	} else if (F <= 1.05e+147) {
		tmp = (t_1 + (1.0 / B)) - (x / B);
	} else if (F <= 9.4e+210) {
		tmp = t_0;
	} else {
		tmp = t_1 + ((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 = b * (0.16666666666666666d0 + (x * 0.3333333333333333d0))
    if (f <= (-2.4d-29)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= 22500000000.0d0) then
        tmp = t_0
    else if (f <= 1.05d+147) then
        tmp = (t_1 + (1.0d0 / b)) - (x / b)
    else if (f <= 9.4d+210) then
        tmp = t_0
    else
        tmp = t_1 + ((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 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	double tmp;
	if (F <= -2.4e-29) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= 22500000000.0) {
		tmp = t_0;
	} else if (F <= 1.05e+147) {
		tmp = (t_1 + (1.0 / B)) - (x / B);
	} else if (F <= 9.4e+210) {
		tmp = t_0;
	} else {
		tmp = t_1 + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / math.tan(B)
	t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333))
	tmp = 0
	if F <= -2.4e-29:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= 22500000000.0:
		tmp = t_0
	elif F <= 1.05e+147:
		tmp = (t_1 + (1.0 / B)) - (x / B)
	elif F <= 9.4e+210:
		tmp = t_0
	else:
		tmp = t_1 + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	t_1 = Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333)))
	tmp = 0.0
	if (F <= -2.4e-29)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 22500000000.0)
		tmp = t_0;
	elseif (F <= 1.05e+147)
		tmp = Float64(Float64(t_1 + Float64(1.0 / B)) - Float64(x / B));
	elseif (F <= 9.4e+210)
		tmp = t_0;
	else
		tmp = Float64(t_1 + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / tan(B);
	t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	tmp = 0.0;
	if (F <= -2.4e-29)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= 22500000000.0)
		tmp = t_0;
	elseif (F <= 1.05e+147)
		tmp = (t_1 + (1.0 / B)) - (x / B);
	elseif (F <= 9.4e+210)
		tmp = t_0;
	else
		tmp = t_1 + ((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[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.4e-29], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 22500000000.0], t$95$0, If[LessEqual[F, 1.05e+147], N[(N[(t$95$1 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.4e+210], t$95$0, N[(t$95$1 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right)\\
\mathbf{if}\;F \leq -2.4 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

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

\mathbf{elif}\;F \leq 1.05 \cdot 10^{+147}:\\
\;\;\;\;\left(t_1 + \frac{1}{B}\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 9.4 \cdot 10^{+210}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 51.3%

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

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

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

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

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

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

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

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

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

    if -2.39999999999999992e-29 < F < 2.25e10 or 1.05000000000000003e147 < F < 9.4000000000000001e210

    1. Initial program 91.3%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{{\left(\frac{\sin B}{\cos B \cdot x}\right)}^{-1}} \]
      3. *-un-lft-identity72.4%

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

        \[\leadsto -1 \cdot {\left(\frac{1 \cdot \sin B}{\color{blue}{x \cdot \cos B}}\right)}^{-1} \]
      5. times-frac72.3%

        \[\leadsto -1 \cdot {\color{blue}{\left(\frac{1}{x} \cdot \frac{\sin B}{\cos B}\right)}}^{-1} \]
      6. tan-quot72.5%

        \[\leadsto -1 \cdot {\left(\frac{1}{x} \cdot \color{blue}{\tan B}\right)}^{-1} \]
    5. Applied egg-rr72.5%

      \[\leadsto -1 \cdot \color{blue}{{\left(\frac{1}{x} \cdot \tan B\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-172.5%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{1}{x} \cdot \tan B}} \]
      2. *-commutative72.5%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B \cdot \frac{1}{x}}} \]
      3. associate-*r/72.5%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B \cdot 1}{x}}} \]
      4. *-commutative72.5%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{1 \cdot \tan B}}{x}} \]
      5. *-lft-identity72.5%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\tan B}}{x}} \]
      6. associate-/r/72.5%

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{1}{\tan B} \cdot x\right)} \]
      7. *-commutative72.5%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
      8. associate-*r/72.7%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      9. *-rgt-identity72.7%

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

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

    if 2.25e10 < F < 1.05000000000000003e147

    1. Initial program 86.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. +-commutative86.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-neg86.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/99.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/99.5%

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

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

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

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

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

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

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

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

    if 9.4000000000000001e210 < F

    1. Initial program 25.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. +-commutative25.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-neg25.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/44.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/44.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. *-commutative44.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. Simplified45.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 F around inf 99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 22500000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+147}:\\ \;\;\;\;\left(B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 9.4 \cdot 10^{+210}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 12: 64.3% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ t_1 := B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right)\\ \mathbf{if}\;F \leq -1.9 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 22000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{+146}:\\ \;\;\;\;\left(t_1 + \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{+210}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1 + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B)))
        (t_1 (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))))
   (if (<= F -1.9e-49)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F 22000000000.0)
       t_0
       (if (<= F 9.5e+146)
         (- (+ t_1 (/ 1.0 B)) (/ x B))
         (if (<= F 6.4e+210) t_0 (+ t_1 (/ (- 1.0 x) B))))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	double tmp;
	if (F <= -1.9e-49) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 22000000000.0) {
		tmp = t_0;
	} else if (F <= 9.5e+146) {
		tmp = (t_1 + (1.0 / B)) - (x / B);
	} else if (F <= 6.4e+210) {
		tmp = t_0;
	} else {
		tmp = t_1 + ((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 = b * (0.16666666666666666d0 + (x * 0.3333333333333333d0))
    if (f <= (-1.9d-49)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 22000000000.0d0) then
        tmp = t_0
    else if (f <= 9.5d+146) then
        tmp = (t_1 + (1.0d0 / b)) - (x / b)
    else if (f <= 6.4d+210) then
        tmp = t_0
    else
        tmp = t_1 + ((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 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	double tmp;
	if (F <= -1.9e-49) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 22000000000.0) {
		tmp = t_0;
	} else if (F <= 9.5e+146) {
		tmp = (t_1 + (1.0 / B)) - (x / B);
	} else if (F <= 6.4e+210) {
		tmp = t_0;
	} else {
		tmp = t_1 + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / math.tan(B)
	t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333))
	tmp = 0
	if F <= -1.9e-49:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 22000000000.0:
		tmp = t_0
	elif F <= 9.5e+146:
		tmp = (t_1 + (1.0 / B)) - (x / B)
	elif F <= 6.4e+210:
		tmp = t_0
	else:
		tmp = t_1 + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	t_1 = Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333)))
	tmp = 0.0
	if (F <= -1.9e-49)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 22000000000.0)
		tmp = t_0;
	elseif (F <= 9.5e+146)
		tmp = Float64(Float64(t_1 + Float64(1.0 / B)) - Float64(x / B));
	elseif (F <= 6.4e+210)
		tmp = t_0;
	else
		tmp = Float64(t_1 + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / tan(B);
	t_1 = B * (0.16666666666666666 + (x * 0.3333333333333333));
	tmp = 0.0;
	if (F <= -1.9e-49)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 22000000000.0)
		tmp = t_0;
	elseif (F <= 9.5e+146)
		tmp = (t_1 + (1.0 / B)) - (x / B);
	elseif (F <= 6.4e+210)
		tmp = t_0;
	else
		tmp = t_1 + ((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[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.9e-49], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 22000000000.0], t$95$0, If[LessEqual[F, 9.5e+146], N[(N[(t$95$1 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.4e+210], t$95$0, N[(t$95$1 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;F \leq 6.4 \cdot 10^{+210}:\\
\;\;\;\;t_0\\

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


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

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

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

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

    if -1.8999999999999999e-49 < F < 2.2e10 or 9.49999999999999926e146 < F < 6.4000000000000005e210

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{{\left(\frac{\sin B}{\cos B \cdot x}\right)}^{-1}} \]
      3. *-un-lft-identity74.6%

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

        \[\leadsto -1 \cdot {\left(\frac{1 \cdot \sin B}{\color{blue}{x \cdot \cos B}}\right)}^{-1} \]
      5. times-frac74.5%

        \[\leadsto -1 \cdot {\color{blue}{\left(\frac{1}{x} \cdot \frac{\sin B}{\cos B}\right)}}^{-1} \]
      6. tan-quot74.6%

        \[\leadsto -1 \cdot {\left(\frac{1}{x} \cdot \color{blue}{\tan B}\right)}^{-1} \]
    5. Applied egg-rr74.6%

      \[\leadsto -1 \cdot \color{blue}{{\left(\frac{1}{x} \cdot \tan B\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-174.6%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{1}{x} \cdot \tan B}} \]
      2. *-commutative74.6%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B \cdot \frac{1}{x}}} \]
      3. associate-*r/74.7%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B \cdot 1}{x}}} \]
      4. *-commutative74.7%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{1 \cdot \tan B}}{x}} \]
      5. *-lft-identity74.7%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\tan B}}{x}} \]
      6. associate-/r/74.7%

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{1}{\tan B} \cdot x\right)} \]
      7. *-commutative74.7%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
      8. associate-*r/74.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      9. *-rgt-identity74.9%

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

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

    if 2.2e10 < F < 9.49999999999999926e146

    1. Initial program 86.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. +-commutative86.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-neg86.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/99.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/99.5%

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

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

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

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

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

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

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

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

    if 6.4000000000000005e210 < F

    1. Initial program 25.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. +-commutative25.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-neg25.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/44.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/44.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. *-commutative44.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. Simplified45.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 F around inf 99.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 22000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{+146}:\\ \;\;\;\;\left(B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{+210}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 13: 44.2% accurate, 3.0× speedup?

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

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

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

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


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

    1. Initial program 46.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 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45000000000000013e35 < F < 4.4e9

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{\cos B \cdot x}{\sin B}} \]
    4. Taylor expanded in B around 0 43.6%

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

    if 4.4e9 < F

    1. Initial program 56.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. +-commutative56.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-neg56.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/72.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/72.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. *-commutative72.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. Simplified72.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.45 \cdot 10^{+35}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4400000000:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1}{B}\right) - \frac{x}{B}\\ \end{array} \]

Alternative 14: 44.1% accurate, 16.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8999999999999999e-49 < F < 2.5000000000000001e-9

    1. Initial program 99.6%

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

      \[\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. Taylor expanded in B around 0 45.3%

      \[\leadsto -1 \cdot \color{blue}{\left(\frac{x}{B} + \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    5. Step-by-step derivation
      1. *-commutative45.3%

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}\right) \]
      2. distribute-rgt-out--45.3%

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

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

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

    if 2.5000000000000001e-9 < F

    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/73.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/73.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. *-commutative73.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. Simplified73.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 F around inf 97.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-9}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\left(B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1}{B}\right) - \frac{x}{B}\\ \end{array} \]

Alternative 15: 44.1% accurate, 18.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.2000000000000004e-50 < F < 2.5000000000000001e-9

    1. Initial program 99.6%

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

      \[\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. Taylor expanded in B around 0 45.3%

      \[\leadsto -1 \cdot \color{blue}{\left(\frac{x}{B} + \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    5. Step-by-step derivation
      1. *-commutative45.3%

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}\right) \]
      2. distribute-rgt-out--45.3%

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

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

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

    if 2.5000000000000001e-9 < F

    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/73.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/73.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. *-commutative73.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. Simplified73.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 F around inf 97.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-9}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 16: 44.0% accurate, 22.9× speedup?

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

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

\mathbf{elif}\;F \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.42e-49 < F < 1.8e-9

    1. Initial program 99.6%

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

      \[\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. Taylor expanded in B around 0 45.3%

      \[\leadsto -1 \cdot \color{blue}{\left(\frac{x}{B} + \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    5. Taylor expanded in x around 0 45.3%

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

    if 1.8e-9 < F

    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/73.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/73.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. *-commutative73.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. Simplified73.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 F around inf 97.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.42 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 17: 44.0% accurate, 22.9× speedup?

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

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

\mathbf{elif}\;F \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999996e-49 < F < 1.8e-9

    1. Initial program 99.6%

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

      \[\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. Taylor expanded in B around 0 45.3%

      \[\leadsto -1 \cdot \color{blue}{\left(\frac{x}{B} + \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    5. Step-by-step derivation
      1. *-commutative45.3%

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}\right) \]
      2. distribute-rgt-out--45.3%

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

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

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

    if 1.8e-9 < F

    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/73.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/73.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. *-commutative73.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. Simplified73.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 F around inf 97.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.2 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 18: 44.0% accurate, 24.7× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1199999999999999e-49 < F < 2.5000000000000001e-9

    1. Initial program 99.6%

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

      \[\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. Taylor expanded in B around 0 45.3%

      \[\leadsto -1 \cdot \color{blue}{\left(\frac{x}{B} + \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    5. Taylor expanded in x around 0 45.2%

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

    if 2.5000000000000001e-9 < F

    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/73.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/73.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. *-commutative73.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. Simplified73.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 F around inf 97.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.12 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 19: 37.2% accurate, 35.5× speedup?

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

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

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

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


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

    1. Initial program 50.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 97.5%

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

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

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

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

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

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

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

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

    if -8.9999999999999999e-10 < F < 1.14999999999999998e-36

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.14999999999999998e-36 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/75.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/75.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. *-commutative75.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. Simplified75.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 F around inf 94.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-10}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-36}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 20: 44.0% accurate, 35.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e-46 < F < 2.74999999999999992e-36

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac46.0%

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

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

    if 2.74999999999999992e-36 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/75.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/75.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. *-commutative75.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. Simplified75.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 F around inf 94.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.2 \cdot 10^{-46}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.75 \cdot 10^{-36}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 21: 44.0% accurate, 35.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      4. distribute-neg-frac59.7%

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

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

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

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

    if -2.2000000000000001e-46 < F < 1.14999999999999998e-36

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac46.0%

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

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

    if 1.14999999999999998e-36 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/75.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/75.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. *-commutative75.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. Simplified75.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 F around inf 94.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.2 \cdot 10^{-46}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-36}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 22: 30.3% accurate, 39.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-31} \lor \neg \left(x \leq 1.85 \cdot 10^{-94}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2e-31 or 1.8499999999999999e-94 < x

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{B}} \]
    8. Simplified53.2%

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

    if -2e-31 < x < 1.8499999999999999e-94

    1. Initial program 64.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-31} \lor \neg \left(x \leq 1.85 \cdot 10^{-94}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]

Alternative 23: 10.3% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 73.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 58.5%

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

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

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

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

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

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

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

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

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

Reproduce

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