VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.7% → 99.5%
Time: 20.9s
Alternatives: 25
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 25 alternatives:

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

Initial Program: 76.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;F \leq 40000000:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\


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

    1. Initial program 41.8%

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def39.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-rr39.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-def39.6%

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

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

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

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

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

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

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

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

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

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

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

    if -4e46 < F < 4e7

    1. Initial program 99.5%

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

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

    1. Initial program 56.8%

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

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

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

Alternative 2: 99.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 45.9%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u39.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-udef39.5%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def39.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-rr39.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-def39.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.7%

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 3100

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.6%

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

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

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

    if 3100 < F

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

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

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

Alternative 3: 99.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 3100:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{\tan B}\\

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


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

    1. Initial program 45.9%

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

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

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

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

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

    if -1.3999999999999999 < F < 3100

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.6%

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

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

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

    if 3100 < F

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

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

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

Alternative 4: 92.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -1.04 \cdot 10^{-94}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 43.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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4e20 < F < -1.04e-94 or 1.7499999999999999e-135 < F < 1.69999999999999987e-7

    1. Initial program 99.5%

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

      \[\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 -1.04e-94 < F < 1.7499999999999999e-135

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. 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 92.6%

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

    if 1.69999999999999987e-7 < F

    1. Initial program 58.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.4 \cdot 10^{+20}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.04 \cdot 10^{-94}:\\ \;\;\;\;\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^{-135}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 5: 91.7% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 48.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.2000000000000002e-19 < F < 3100

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.6%

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

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

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

    if 3100 < F

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

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

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

Alternative 6: 60.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{0.5}\\
t_1 := \frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -8.6 \cdot 10^{-66}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 3.7 \cdot 10^{-305}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -2.29999999999999989e-12

    1. Initial program 47.4%

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

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

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

    if -2.29999999999999989e-12 < F < -8.60000000000000027e-66 or 2.69999999999999999e-135 < F < 1.69999999999999987e-7

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.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 0 99.4%

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

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

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

    if -8.60000000000000027e-66 < F < 3.69999999999999977e-305

    1. Initial program 99.4%

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

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

    if 3.69999999999999977e-305 < F < 8.1999999999999997e-137

    1. Initial program 99.5%

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

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative19.4%

        \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \color{blue}{\left(x \cdot B\right)}\right)\right) + \frac{-1}{\sin B} \]
    4. Simplified66.7%

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

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

    if 8.1999999999999997e-137 < F < 2.69999999999999999e-135

    1. Initial program 99.2%

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

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

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

    if 1.69999999999999987e-7 < F

    1. Initial program 58.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 32.3%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative30.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -8.6 \cdot 10^{-66}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-305}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-137}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-135}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 7: 60.7% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -2.29999999999999989e-12

    1. Initial program 47.4%

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

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

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

    if -2.29999999999999989e-12 < F < -1.95000000000000011e-63 or 1.7499999999999999e-135 < F < 1.69999999999999987e-7

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.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 0 99.4%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u57.2%

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{1}}{\sqrt{2 \cdot x + 2}} \cdot \frac{F}{\sin B}\right)} - 1 \]
      6. frac-times20.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot F}{\sqrt{2 \cdot x + 2} \cdot \sin B}}\right)} - 1 \]
      7. *-un-lft-identity20.1%

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

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

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

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

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

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

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

    if -1.95000000000000011e-63 < F < 6.19999999999999995e-306

    1. Initial program 99.4%

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

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

    if 6.19999999999999995e-306 < F < 4.60000000000000016e-137

    1. Initial program 99.5%

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

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative19.4%

        \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \color{blue}{\left(x \cdot B\right)}\right)\right) + \frac{-1}{\sin B} \]
    4. Simplified66.7%

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

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

    if 4.60000000000000016e-137 < F < 1.7499999999999999e-135

    1. Initial program 99.2%

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

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

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

    if 1.69999999999999987e-7 < F

    1. Initial program 58.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 32.3%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative30.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.95 \cdot 10^{-63}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-306}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-137}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-135}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 8: 85.3% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\
\;\;\;\;\cos B \cdot \frac{-1}{\frac{\sin B}{x}}\\

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

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


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

    1. Initial program 47.4%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u38.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-udef38.4%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def38.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-rr38.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-def38.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-log1p98.5%

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

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

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

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

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

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

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

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

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

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

    if -2.29999999999999989e-12 < F < -6.0000000000000004e-66 or 2.80000000000000023e-135 < F < 1.69999999999999987e-7

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.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 0 99.4%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u57.2%

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{1}}{\sqrt{2 \cdot x + 2}} \cdot \frac{F}{\sin B}\right)} - 1 \]
      6. frac-times20.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot F}{\sqrt{2 \cdot x + 2} \cdot \sin B}}\right)} - 1 \]
      7. *-un-lft-identity20.1%

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

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

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

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

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

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

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

    if -6.0000000000000004e-66 < F < 2.80000000000000023e-135

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 1.69999999999999987e-7 < F

    1. Initial program 58.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-66}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\ \;\;\;\;\cos B \cdot \frac{-1}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 9: 65.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -9.2 \cdot 10^{-66}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 2.7 \cdot 10^{-135}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 47.4%

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

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

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

    if -2.29999999999999989e-12 < F < -9.19999999999999967e-66 or 2.69999999999999999e-135 < F < 1.4499999999999999e-7

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.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 0 99.4%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u57.2%

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{1}}{\sqrt{2 \cdot x + 2}} \cdot \frac{F}{\sin B}\right)} - 1 \]
      6. frac-times20.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot F}{\sqrt{2 \cdot x + 2} \cdot \sin B}}\right)} - 1 \]
      7. *-un-lft-identity20.1%

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

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

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

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

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

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

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

    if -9.19999999999999967e-66 < F < 2.69999999999999999e-135 or 1.4499999999999999e-7 < F < 7.0000000000000005e163

    1. Initial program 96.9%

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

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

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

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

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

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

    if 7.0000000000000005e163 < F

    1. Initial program 24.5%

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

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative22.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.2 \cdot 10^{-66}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-135}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-7}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{+163}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 10: 72.5% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 47.4%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u38.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-udef38.4%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def38.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-rr38.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-def38.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-log1p98.5%

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

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

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

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

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

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

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

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

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

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

    if -2.29999999999999989e-12 < F < -2.25e-63 or 2.80000000000000023e-135 < F < 1.6e-7

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.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 0 99.4%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u57.2%

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{1}}{\sqrt{2 \cdot x + 2}} \cdot \frac{F}{\sin B}\right)} - 1 \]
      6. frac-times20.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot F}{\sqrt{2 \cdot x + 2} \cdot \sin B}}\right)} - 1 \]
      7. *-un-lft-identity20.1%

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

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

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

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

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

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

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

    if -2.25e-63 < F < 2.80000000000000023e-135 or 1.6e-7 < F < 7.0000000000000005e163

    1. Initial program 96.9%

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

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

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

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

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

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

    if 7.0000000000000005e163 < F

    1. Initial program 24.5%

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

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative22.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.25 \cdot 10^{-63}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-7}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{+163}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 11: 72.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.62 \cdot 10^{-65}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\
\;\;\;\;\cos B \cdot \frac{-1}{\frac{\sin B}{x}}\\

\mathbf{elif}\;F \leq 4.5 \cdot 10^{-12}:\\
\;\;\;\;t_0\\

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

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


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

    1. Initial program 47.4%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u38.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-udef38.4%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def38.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-rr38.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-def38.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-log1p98.5%

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

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

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

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

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

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

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

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

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

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

    if -1.30000000000000002e-15 < F < -1.6200000000000001e-65 or 2.80000000000000023e-135 < F < 4.49999999999999981e-12

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.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 0 99.4%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u57.2%

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{1}}{\sqrt{2 \cdot x + 2}} \cdot \frac{F}{\sin B}\right)} - 1 \]
      6. frac-times20.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot F}{\sqrt{2 \cdot x + 2} \cdot \sin B}}\right)} - 1 \]
      7. *-un-lft-identity20.1%

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

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

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

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

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

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

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

    if -1.6200000000000001e-65 < F < 2.80000000000000023e-135

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 4.49999999999999981e-12 < F < 7.0000000000000005e163

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

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

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

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

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

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

    if 7.0000000000000005e163 < F

    1. Initial program 24.5%

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

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative22.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.62 \cdot 10^{-65}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\ \;\;\;\;\cos B \cdot \frac{-1}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{+163}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 12: 61.2% accurate, 2.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 5.6 \cdot 10^{-304}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\

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

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


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

    1. Initial program 48.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.2%

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

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

    if -7.2000000000000002e-19 < F < -2.2e-208

    1. Initial program 99.4%

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

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative21.3%

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

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

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

    if -2.2e-208 < F < 5.5999999999999997e-304

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

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

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

    if 5.5999999999999997e-304 < F < 1.69999999999999987e-7

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.6%

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

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

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

    if 1.69999999999999987e-7 < F

    1. Initial program 58.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 32.3%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative30.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.2 \cdot 10^{-208}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 5.6 \cdot 10^{-304}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 13: 54.9% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq 3.1 \cdot 10^{-304}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\

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

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


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

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

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

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

    if -5.39999999999999998e-42 < F < 3.09999999999999985e-304

    1. Initial program 99.5%

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

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

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

    if 3.09999999999999985e-304 < F < 4.6000000000000002e-8

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.6%

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

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

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

    if 4.6000000000000002e-8 < F

    1. Initial program 58.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 51.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.4 \cdot 10^{-42}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-304}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-8}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \end{array} \]

Alternative 14: 60.0% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq 1.6 \cdot 10^{-304}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\

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

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


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

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

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

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

    if -3.20000000000000025e-42 < F < 1.59999999999999999e-304

    1. Initial program 99.5%

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

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

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

    if 1.59999999999999999e-304 < F < 1.69999999999999987e-7

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.6%

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

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

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

    if 1.69999999999999987e-7 < F

    1. Initial program 58.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 32.3%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative30.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-42}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-304}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]

Alternative 15: 43.1% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-60} \lor \neg \left(F \leq 6.2 \cdot 10^{-92}\right) \land F \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.8e-19)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F -4.2e-60) (and (not (<= F 6.2e-92)) (<= F 5.2e-15)))
     (/ F (* B (sqrt (+ 2.0 (* x 2.0)))))
     (- (/ (- x) B) (* -0.3333333333333333 (* B x))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.8e-19) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= -4.2e-60) || (!(F <= 6.2e-92) && (F <= 5.2e-15))) {
		tmp = F / (B * sqrt((2.0 + (x * 2.0))));
	} else {
		tmp = (-x / B) - (-0.3333333333333333 * (B * x));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-3.8d-19)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= (-4.2d-60)) .or. (.not. (f <= 6.2d-92)) .and. (f <= 5.2d-15)) then
        tmp = f / (b * sqrt((2.0d0 + (x * 2.0d0))))
    else
        tmp = (-x / b) - ((-0.3333333333333333d0) * (b * x))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.8e-19) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= -4.2e-60) || (!(F <= 6.2e-92) && (F <= 5.2e-15))) {
		tmp = F / (B * Math.sqrt((2.0 + (x * 2.0))));
	} else {
		tmp = (-x / B) - (-0.3333333333333333 * (B * x));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3.8e-19:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= -4.2e-60) or (not (F <= 6.2e-92) and (F <= 5.2e-15)):
		tmp = F / (B * math.sqrt((2.0 + (x * 2.0))))
	else:
		tmp = (-x / B) - (-0.3333333333333333 * (B * x))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.8e-19)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= -4.2e-60) || (!(F <= 6.2e-92) && (F <= 5.2e-15)))
		tmp = Float64(F / Float64(B * sqrt(Float64(2.0 + Float64(x * 2.0)))));
	else
		tmp = Float64(Float64(Float64(-x) / B) - Float64(-0.3333333333333333 * Float64(B * x)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3.8e-19)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= -4.2e-60) || (~((F <= 6.2e-92)) && (F <= 5.2e-15)))
		tmp = F / (B * sqrt((2.0 + (x * 2.0))));
	else
		tmp = (-x / B) - (-0.3333333333333333 * (B * x));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3.8e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -4.2e-60], And[N[Not[LessEqual[F, 6.2e-92]], $MachinePrecision], LessEqual[F, 5.2e-15]]], N[(F / N[(B * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -4.2 \cdot 10^{-60} \lor \neg \left(F \leq 6.2 \cdot 10^{-92}\right) \land F \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}}\\

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


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

    1. Initial program 48.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.2%

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

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

    if -3.8e-19 < F < -4.19999999999999982e-60 or 6.2000000000000002e-92 < F < 5.20000000000000009e-15

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.5%

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u52.5%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - 1} \]
      3. *-commutative23.0%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{1}}{\sqrt{2 \cdot x + 2}} \cdot \frac{F}{\sin B}\right)} - 1 \]
      6. frac-times23.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot F}{\sqrt{2 \cdot x + 2} \cdot \sin B}}\right)} - 1 \]
      7. *-un-lft-identity23.0%

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

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

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

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

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

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

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

    if -4.19999999999999982e-60 < F < 6.2000000000000002e-92 or 5.20000000000000009e-15 < F

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\cos B}{\frac{\sin B}{x}}} \]
    6. Taylor expanded in B around 0 38.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + -1 \cdot \left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out38.2%

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

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

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

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{\left(-0.3333333333333333 \cdot x\right)} \cdot B\right) \]
      5. associate-*r*38.2%

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

        \[\leadsto \color{blue}{-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)} \]
      7. remove-double-neg38.2%

        \[\leadsto \color{blue}{-\left(-\left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\right)\right)} \]
      8. remove-double-neg38.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-60} \lor \neg \left(F \leq 6.2 \cdot 10^{-92}\right) \land F \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\ \end{array} \]

Alternative 16: 47.7% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.4 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.8 \cdot 10^{-65} \lor \neg \left(F \leq 1.95 \cdot 10^{-77}\right) \land F \leq 0.000225:\\ \;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + B \cdot -0.16666666666666666\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.4e-19)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F -4.8e-65) (and (not (<= F 1.95e-77)) (<= F 0.000225)))
     (/ F (* B (sqrt (+ 2.0 (* x 2.0)))))
     (+ (* x (/ -1.0 (tan B))) (* B -0.16666666666666666)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.4e-19) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= -4.8e-65) || (!(F <= 1.95e-77) && (F <= 0.000225))) {
		tmp = F / (B * sqrt((2.0 + (x * 2.0))));
	} else {
		tmp = (x * (-1.0 / tan(B))) + (B * -0.16666666666666666);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-4.4d-19)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= (-4.8d-65)) .or. (.not. (f <= 1.95d-77)) .and. (f <= 0.000225d0)) then
        tmp = f / (b * sqrt((2.0d0 + (x * 2.0d0))))
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (b * (-0.16666666666666666d0))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.4e-19) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= -4.8e-65) || (!(F <= 1.95e-77) && (F <= 0.000225))) {
		tmp = F / (B * Math.sqrt((2.0 + (x * 2.0))));
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (B * -0.16666666666666666);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.4e-19:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= -4.8e-65) or (not (F <= 1.95e-77) and (F <= 0.000225)):
		tmp = F / (B * math.sqrt((2.0 + (x * 2.0))))
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (B * -0.16666666666666666)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.4e-19)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= -4.8e-65) || (!(F <= 1.95e-77) && (F <= 0.000225)))
		tmp = Float64(F / Float64(B * sqrt(Float64(2.0 + Float64(x * 2.0)))));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(B * -0.16666666666666666));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4.4e-19)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= -4.8e-65) || (~((F <= 1.95e-77)) && (F <= 0.000225)))
		tmp = F / (B * sqrt((2.0 + (x * 2.0))));
	else
		tmp = (x * (-1.0 / tan(B))) + (B * -0.16666666666666666);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.4e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -4.8e-65], And[N[Not[LessEqual[F, 1.95e-77]], $MachinePrecision], LessEqual[F, 0.000225]]], N[(F / N[(B * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(B * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -4.8 \cdot 10^{-65} \lor \neg \left(F \leq 1.95 \cdot 10^{-77}\right) \land F \leq 0.000225:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}}\\

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


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

    1. Initial program 48.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.2%

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

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

    if -4.3999999999999997e-19 < F < -4.8000000000000003e-65 or 1.9499999999999999e-77 < F < 2.2499999999999999e-4

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.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 0 99.4%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u52.7%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - 1} \]
      3. *-commutative26.6%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{1}}{\sqrt{2 \cdot x + 2}} \cdot \frac{F}{\sin B}\right)} - 1 \]
      6. frac-times26.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot F}{\sqrt{2 \cdot x + 2} \cdot \sin B}}\right)} - 1 \]
      7. *-un-lft-identity26.6%

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

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

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

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

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

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

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

    if -4.8000000000000003e-65 < F < 1.9499999999999999e-77 or 2.2499999999999999e-4 < F

    1. Initial program 82.2%

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{B \cdot -0.16666666666666666} \]
    6. Simplified41.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.4 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.8 \cdot 10^{-65} \lor \neg \left(F \leq 1.95 \cdot 10^{-77}\right) \land F \leq 0.000225:\\ \;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + B \cdot -0.16666666666666666\\ \end{array} \]

Alternative 17: 55.3% accurate, 2.8× speedup?

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

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

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

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


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

    1. Initial program 48.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.2%

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

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

    if -7.2000000000000002e-19 < F < 1.4999999999999999e-7

    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. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-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\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.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. Simplified99.6%

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

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

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

    if 1.4999999999999999e-7 < F

    1. Initial program 58.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 51.4%

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

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

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

Alternative 18: 56.5% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;x \leq -1.26 \cdot 10^{-27}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;x \leq 4.4 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.52000000000000002 or 4.4e-41 < x

    1. Initial program 84.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 95.4%

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

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

    if -0.52000000000000002 < x < -1.2599999999999999e-27

    1. Initial program 85.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\cos B}{\frac{\sin B}{x}}} \]
    6. Taylor expanded in B around 0 86.2%

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

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

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

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

    if -1.2599999999999999e-27 < x < 4.4e-41

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.52:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;x \leq -1.26 \cdot 10^{-27}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-41}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \end{array} \]

Alternative 19: 42.7% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 54.2%

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

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

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

    if -1.95000000000000016e-61 < F

    1. Initial program 83.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\cos B}{\frac{\sin B}{x}}} \]
    6. Taylor expanded in B around 0 35.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + -1 \cdot \left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out35.6%

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

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

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

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{\left(-0.3333333333333333 \cdot x\right)} \cdot B\right) \]
      5. associate-*r*35.6%

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

        \[\leadsto \color{blue}{-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)} \]
      7. remove-double-neg35.6%

        \[\leadsto \color{blue}{-\left(-\left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\right)\right)} \]
      8. remove-double-neg35.6%

        \[\leadsto -\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)} \]
      9. *-commutative35.6%

        \[\leadsto -\left(\frac{x}{B} + \color{blue}{\left(x \cdot B\right) \cdot -0.3333333333333333}\right) \]
      10. *-commutative35.6%

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

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

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

Alternative 20: 36.2% accurate, 3.1× speedup?

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

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

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


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

    1. Initial program 46.6%

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

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

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{-1}{\sin B} \]
    4. Step-by-step derivation
      1. *-commutative65.9%

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

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

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

    if -2.34999999999999996e-11 < F

    1. Initial program 84.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\cos B}{\frac{\sin B}{x}}} \]
    6. Taylor expanded in B around 0 34.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + -1 \cdot \left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out34.1%

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

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

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

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{\left(-0.3333333333333333 \cdot x\right)} \cdot B\right) \]
      5. associate-*r*34.1%

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

        \[\leadsto \color{blue}{-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)} \]
      7. remove-double-neg34.1%

        \[\leadsto \color{blue}{-\left(-\left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\right)\right)} \]
      8. remove-double-neg34.1%

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

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

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

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

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

Alternative 21: 35.8% accurate, 26.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000001e-59 < F

    1. Initial program 83.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\cos B}{\frac{\sin B}{x}}} \]
    6. Taylor expanded in B around 0 35.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + -1 \cdot \left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out35.4%

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

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

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

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{\left(-0.3333333333333333 \cdot x\right)} \cdot B\right) \]
      5. associate-*r*35.4%

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

        \[\leadsto \color{blue}{-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)} \]
      7. remove-double-neg35.4%

        \[\leadsto \color{blue}{-\left(-\left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\right)\right)} \]
      8. remove-double-neg35.4%

        \[\leadsto -\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)} \]
      9. *-commutative35.4%

        \[\leadsto -\left(\frac{x}{B} + \color{blue}{\left(x \cdot B\right) \cdot -0.3333333333333333}\right) \]
      10. *-commutative35.4%

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

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

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

Alternative 22: 35.9% accurate, 26.9× speedup?

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

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

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


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

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

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

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot B} + -1 \cdot \frac{1 + x}{B} \]
    5. Step-by-step derivation
      1. *-commutative45.7%

        \[\leadsto \color{blue}{B \cdot -0.16666666666666666} + -1 \cdot \frac{1 + x}{B} \]
    6. Simplified45.7%

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

    if -1.1499999999999999e-58 < F

    1. Initial program 83.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\cos B}{\frac{\sin B}{x}}} \]
    6. Taylor expanded in B around 0 35.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + -1 \cdot \left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out35.4%

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

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

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

        \[\leadsto -1 \cdot \left(\frac{x}{B} + \color{blue}{\left(-0.3333333333333333 \cdot x\right)} \cdot B\right) \]
      5. associate-*r*35.4%

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

        \[\leadsto \color{blue}{-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)} \]
      7. remove-double-neg35.4%

        \[\leadsto \color{blue}{-\left(-\left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\right)\right)} \]
      8. remove-double-neg35.4%

        \[\leadsto -\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)} \]
      9. *-commutative35.4%

        \[\leadsto -\left(\frac{x}{B} + \color{blue}{\left(x \cdot B\right) \cdot -0.3333333333333333}\right) \]
      10. *-commutative35.4%

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

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

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

Alternative 23: 35.8% accurate, 29.3× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.25e-57 < F

    1. Initial program 83.5%

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

      \[\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}{\left(0.3333333333333333 \cdot x - 0.16666666666666666\right) \cdot B + -1 \cdot \frac{1 + x}{B}} \]
    4. Taylor expanded in x around inf 35.3%

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

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

Alternative 24: 35.7% accurate, 45.9× speedup?

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

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

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


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

    1. Initial program 52.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 90.6%

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

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

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

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

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

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

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

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

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

    if -1.9500000000000001e-53 < F

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\cos B}{\frac{\sin B}{x}}} \]
    6. Taylor expanded in B around 0 34.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.95 \cdot 10^{-53}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 25: 28.7% accurate, 81.0× speedup?

\[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
	return -x / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -x / b
end function
public static double code(double F, double B, double x) {
	return -x / B;
}
def code(F, B, x):
	return -x / B
function code(F, B, x)
	return Float64(Float64(-x) / B)
end
function tmp = code(F, B, x)
	tmp = -x / B;
end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-x}{B}
\end{array}
Derivation
  1. Initial program 73.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 56.0%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-\cos B}{\frac{\sin B}{x}}} \]
  6. Taylor expanded in B around 0 29.1%

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

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

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

    \[\leadsto \color{blue}{\frac{-x}{B}} \]
  9. Final simplification29.1%

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

Reproduce

?
herbie shell --seed 2023273 
(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))))))