VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.7% → 99.6%
Time: 26.2s
Alternatives: 26
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 26 alternatives:

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

Initial Program: 76.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.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 62.9%

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

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

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

    if -1.3e38 < F < 2e8

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 2e8 < F

    1. Initial program 61.5%

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

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

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

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

      \[\leadsto \left(-\frac{1}{\frac{\tan B}{x}}\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.3 \cdot 10^{+38}:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 2: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1100:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - x \cdot \frac{1}{\tan B}\\

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


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

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\frac{F}{\sin B}}{\color{blue}{-1 \cdot F + -0.5 \cdot \frac{2 + 2 \cdot x}{F}}} \]
    8. Step-by-step derivation
      1. +-commutative89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.900000000000000022 < F < 1100

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1100 < F

    1. Initial program 61.5%

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

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

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

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

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

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

Alternative 3: 91.3% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\frac{F}{\sin B}}{\color{blue}{-1 \cdot F + -0.5 \cdot \frac{2 + 2 \cdot x}{F}}} \]
    8. Step-by-step derivation
      1. +-commutative89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.14000000000000001 < F < 2.30000000000000007e-10

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 2.30000000000000007e-10 < F

    1. Initial program 62.7%

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

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

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

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

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

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

Alternative 4: 91.3% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 68.1%

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

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

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

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

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

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

    if -4.5999999999999999e-7 < F < 2.30000000000000007e-10

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 2.30000000000000007e-10 < F

    1. Initial program 62.7%

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

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

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

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

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

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

Alternative 5: 86.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -3.4 \cdot 10^{-98}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - \frac{x}{B}\\

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

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


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

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

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

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

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

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

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

    if -7.19999999999999962e-8 < F < -3.4000000000000001e-98

    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. Step-by-step derivation
      1. associate-*l/99.2%

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

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

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

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

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

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

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

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

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

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

    if -3.4000000000000001e-98 < F < 6.00000000000000018e-54

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u55.8%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*30.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan30.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr30.7%

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

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

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

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

    if 6.00000000000000018e-54 < F

    1. Initial program 64.9%

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

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

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

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

      \[\leadsto \left(-\frac{1}{\frac{\tan B}{x}}\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 -7.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.4 \cdot 10^{-98}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-54}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 6: 85.6% accurate, 1.5× speedup?

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

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

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

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

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


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

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

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

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

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

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

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

    if -5.8000000000000003e-8 < F < -6.49999999999999951e-69

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

    if -6.49999999999999951e-69 < F < 1.4e-51

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u52.0%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*29.2%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan29.2%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr29.2%

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

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

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

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

    if 1.4e-51 < F

    1. Initial program 64.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-51}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 7: 85.6% accurate, 1.5× speedup?

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

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

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

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

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


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

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

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

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

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

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

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

    if -5.79999999999999982e-9 < F < -8.00000000000000053e-68

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000053e-68 < F < 3.0999999999999999e-52

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u52.0%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*29.2%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan29.2%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr29.2%

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

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

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

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

    if 3.0999999999999999e-52 < F

    1. Initial program 64.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8 \cdot 10^{-68}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-52}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 8: 86.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -7 \cdot 10^{-98}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\

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

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


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

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

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

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

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

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

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

    if -7.19999999999999962e-8 < F < -7.0000000000000004e-98

    1. Initial program 99.2%

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

      \[\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)} \]
    3. Taylor expanded in F around 0 85.2%

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

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

    if -7.0000000000000004e-98 < F < 6.5999999999999999e-52

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u55.8%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*30.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan30.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr30.7%

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

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

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

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

    if 6.5999999999999999e-52 < F

    1. Initial program 64.9%

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

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

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

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

      \[\leadsto \left(-\frac{1}{\frac{\tan B}{x}}\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 -7.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7 \cdot 10^{-98}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-52}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 9: 86.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -2.8 \cdot 10^{-98}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{B}\\

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

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


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

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

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

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

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

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

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

    if -7.19999999999999962e-8 < F < -2.7999999999999999e-98

    1. Initial program 99.2%

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

      \[\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)} \]
    3. Taylor expanded in F around 0 85.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} \]
    6. Simplified85.4%

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

    if -2.7999999999999999e-98 < F < 3.29999999999999973e-51

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u55.8%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*30.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan30.7%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr30.7%

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

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

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

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

    if 3.29999999999999973e-51 < F

    1. Initial program 64.9%

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

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

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

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

      \[\leadsto \left(-\frac{1}{\frac{\tan B}{x}}\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 -7.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{-98}:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.3 \cdot 10^{-51}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 10: 72.7% accurate, 1.5× speedup?

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

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

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

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

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

\mathbf{elif}\;F \leq 1100:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -2.9000000000000001e237 or -1.6000000000000001e153 < F < -4.5999999999999999e-7

    1. Initial program 70.0%

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

      \[\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)} \]
    3. Taylor expanded in F around -inf 84.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    5. Simplified84.0%

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

    if -2.9000000000000001e237 < F < -1.6000000000000001e153

    1. Initial program 63.7%

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

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

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

    if -4.5999999999999999e-7 < F < -3.5e-72

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    6. Step-by-step derivation
      1. *-lft-identity90.3%

        \[\leadsto \frac{F \cdot \sqrt{0.5}}{\color{blue}{1 \cdot \sin B}} \]
      2. times-frac90.1%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{0.5}}{\sin B}} \]
      3. /-rgt-identity90.1%

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

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

    if -3.5e-72 < F < 1100

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u49.9%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*28.4%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan28.4%

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

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def49.9%

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

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

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

    if 1100 < F

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

      \[\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)} \]
    3. Taylor expanded in F around inf 76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{+237}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{+153}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -4.6 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-72}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 1100:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 11: 72.6% accurate, 1.5× speedup?

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

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

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

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

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

\mathbf{elif}\;F \leq 3100:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -9.19999999999999997e231 or -4.49999999999999982e149 < F < -4.5999999999999999e-7

    1. Initial program 70.0%

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

      \[\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)} \]
    3. Taylor expanded in F around -inf 84.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    5. Simplified84.0%

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

    if -9.19999999999999997e231 < F < -4.49999999999999982e149

    1. Initial program 63.7%

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

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

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

    if -4.5999999999999999e-7 < F < -1.1e-69

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e-69 < F < 3100

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u49.9%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*28.4%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan28.4%

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

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def49.9%

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

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

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

    if 3100 < F

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

      \[\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)} \]
    3. Taylor expanded in F around inf 76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.2 \cdot 10^{+231}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{+149}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -4.6 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.1 \cdot 10^{-69}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 3100:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 12: 79.1% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 8000:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

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

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

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

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

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

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

    if -5.79999999999999982e-9 < F < -1.9500000000000001e-70

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.9500000000000001e-70 < F < 8e3

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u49.9%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*28.4%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan28.4%

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

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def49.9%

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

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

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

    if 8e3 < F

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

      \[\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)} \]
    3. Taylor expanded in F around inf 76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.95 \cdot 10^{-70}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 8000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 13: 72.0% accurate, 2.6× speedup?

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

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

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

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

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

\mathbf{elif}\;F \leq 1100:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -5.60000000000000052e235 or -2.40000000000000015e154 < F < -780

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

    if -5.60000000000000052e235 < F < -2.40000000000000015e154

    1. Initial program 63.7%

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

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

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

    if -780 < F < -2.1999999999999999e-97

    1. Initial program 99.2%

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

      \[\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)} \]
    3. Taylor expanded in B around 0 64.5%

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

    if -2.1999999999999999e-97 < F < 1100

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u53.1%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)\right)} \]
      2. expm1-udef29.8%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*29.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan29.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr29.8%

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

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
      2. expm1-log1p78.6%

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

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

    if 1100 < F

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

      \[\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)} \]
    3. Taylor expanded in F around inf 76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{+235}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.4 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -780:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.2 \cdot 10^{-97}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1100:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 14: 71.8% accurate, 2.6× speedup?

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

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

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

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

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

\mathbf{elif}\;F \leq 1100:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -2.3000000000000001e234 or -1.1e153 < F < -7.19999999999999962e-8

    1. Initial program 70.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 54.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)} \]
    3. Taylor expanded in F around -inf 82.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} + \left(-\frac{x}{B}\right) \]
      4. metadata-eval82.6%

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

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

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

    if -2.3000000000000001e234 < F < -1.1e153

    1. Initial program 63.7%

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

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

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

    if -7.19999999999999962e-8 < F < -6.2e-98

    1. Initial program 99.2%

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

      \[\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)} \]
    3. Taylor expanded in F around 0 85.2%

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

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

    if -6.2e-98 < F < 1100

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u53.1%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)\right)} \]
      2. expm1-udef29.8%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*29.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan29.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr29.8%

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

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
      2. expm1-log1p78.6%

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

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

    if 1100 < F

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

      \[\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)} \]
    3. Taylor expanded in F around inf 76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{+234}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.1 \cdot 10^{+153}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-98}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1100:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 15: 71.8% accurate, 2.7× speedup?

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

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

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

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

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

\mathbf{elif}\;F \leq 2300:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -5.5e231 or -2.95e155 < F < -7.19999999999999962e-8

    1. Initial program 70.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 54.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)} \]
    3. Taylor expanded in F around -inf 82.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} + \left(-\frac{x}{B}\right) \]
      4. metadata-eval82.6%

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

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

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

    if -5.5e231 < F < -2.95e155

    1. Initial program 63.7%

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

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

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

    if -7.19999999999999962e-8 < F < -7.6000000000000006e-98

    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. Step-by-step derivation
      1. associate-*l/99.2%

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

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

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

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

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

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

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

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

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

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

    if -7.6000000000000006e-98 < F < 2300

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u53.1%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)\right)} \]
      2. expm1-udef29.8%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*29.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan29.8%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr29.8%

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

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
      2. expm1-log1p78.6%

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

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

    if 2300 < F

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

      \[\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)} \]
    3. Taylor expanded in F around inf 76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{+231}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.95 \cdot 10^{+155}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.6 \cdot 10^{-98}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2300:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 16: 63.7% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -2 \cdot 10^{+199}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{+177}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -230:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 15500 \lor \neg \left(F \leq 1.5 \cdot 10^{+89}\right) \land \left(F \leq 1.46 \cdot 10^{+147} \lor \neg \left(F \leq 1.6 \cdot 10^{+169}\right) \land F \leq 5 \cdot 10^{+185}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B))) (t_1 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= F -2e+199)
     t_1
     (if (<= F -2.8e+177)
       t_0
       (if (<= F -230.0)
         t_1
         (if (or (<= F 15500.0)
                 (and (not (<= F 1.5e+89))
                      (or (<= F 1.46e+147)
                          (and (not (<= F 1.6e+169)) (<= F 5e+185)))))
           t_0
           (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double t_1 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -2e+199) {
		tmp = t_1;
	} else if (F <= -2.8e+177) {
		tmp = t_0;
	} else if (F <= -230.0) {
		tmp = t_1;
	} else if ((F <= 15500.0) || (!(F <= 1.5e+89) && ((F <= 1.46e+147) || (!(F <= 1.6e+169) && (F <= 5e+185))))) {
		tmp = t_0;
	} else {
		tmp = 1.0 / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = -x / tan(b)
    t_1 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-2d+199)) then
        tmp = t_1
    else if (f <= (-2.8d+177)) then
        tmp = t_0
    else if (f <= (-230.0d0)) then
        tmp = t_1
    else if ((f <= 15500.0d0) .or. (.not. (f <= 1.5d+89)) .and. (f <= 1.46d+147) .or. (.not. (f <= 1.6d+169)) .and. (f <= 5d+185)) then
        tmp = t_0
    else
        tmp = 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 t_1 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -2e+199) {
		tmp = t_1;
	} else if (F <= -2.8e+177) {
		tmp = t_0;
	} else if (F <= -230.0) {
		tmp = t_1;
	} else if ((F <= 15500.0) || (!(F <= 1.5e+89) && ((F <= 1.46e+147) || (!(F <= 1.6e+169) && (F <= 5e+185))))) {
		tmp = t_0;
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / math.tan(B)
	t_1 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -2e+199:
		tmp = t_1
	elif F <= -2.8e+177:
		tmp = t_0
	elif F <= -230.0:
		tmp = t_1
	elif (F <= 15500.0) or (not (F <= 1.5e+89) and ((F <= 1.46e+147) or (not (F <= 1.6e+169) and (F <= 5e+185)))):
		tmp = t_0
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -2e+199)
		tmp = t_1;
	elseif (F <= -2.8e+177)
		tmp = t_0;
	elseif (F <= -230.0)
		tmp = t_1;
	elseif ((F <= 15500.0) || (!(F <= 1.5e+89) && ((F <= 1.46e+147) || (!(F <= 1.6e+169) && (F <= 5e+185)))))
		tmp = t_0;
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / tan(B);
	t_1 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -2e+199)
		tmp = t_1;
	elseif (F <= -2.8e+177)
		tmp = t_0;
	elseif (F <= -230.0)
		tmp = t_1;
	elseif ((F <= 15500.0) || (~((F <= 1.5e+89)) && ((F <= 1.46e+147) || (~((F <= 1.6e+169)) && (F <= 5e+185)))))
		tmp = t_0;
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+199], t$95$1, If[LessEqual[F, -2.8e+177], t$95$0, If[LessEqual[F, -230.0], t$95$1, If[Or[LessEqual[F, 15500.0], And[N[Not[LessEqual[F, 1.5e+89]], $MachinePrecision], Or[LessEqual[F, 1.46e+147], And[N[Not[LessEqual[F, 1.6e+169]], $MachinePrecision], LessEqual[F, 5e+185]]]]], t$95$0, N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -2.8 \cdot 10^{+177}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 15500 \lor \neg \left(F \leq 1.5 \cdot 10^{+89}\right) \land \left(F \leq 1.46 \cdot 10^{+147} \lor \neg \left(F \leq 1.6 \cdot 10^{+169}\right) \land F \leq 5 \cdot 10^{+185}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.00000000000000019e199 or -2.80000000000000002e177 < F < -230

    1. Initial program 64.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 B around 0 49.1%

      \[\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)} \]
    3. Taylor expanded in F around -inf 82.5%

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

        \[\leadsto \color{blue}{-\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      2. distribute-neg-in82.5%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right) + \left(-\frac{x}{B}\right)} \]
      3. distribute-neg-frac82.5%

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

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

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

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

    if -2.00000000000000019e199 < F < -2.80000000000000002e177 or -230 < F < 15500 or 1.50000000000000006e89 < F < 1.46000000000000007e147 or 1.5999999999999999e169 < F < 4.9999999999999999e185

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u45.2%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)\right)} \]
      2. expm1-udef29.3%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*29.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan29.3%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr29.3%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def45.2%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
      2. expm1-log1p73.6%

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

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

    if 15500 < F < 1.50000000000000006e89 or 1.46000000000000007e147 < F < 1.5999999999999999e169 or 4.9999999999999999e185 < F

    1. Initial program 55.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{+199}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{+177}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -230:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 15500 \lor \neg \left(F \leq 1.5 \cdot 10^{+89}\right) \land \left(F \leq 1.46 \cdot 10^{+147} \lor \neg \left(F \leq 1.6 \cdot 10^{+169}\right) \land F \leq 5 \cdot 10^{+185}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]

Alternative 17: 70.8% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq -2.8 \cdot 10^{+177}:\\
\;\;\;\;t_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -6.0000000000000002e199 or -2.80000000000000002e177 < F < -7.79999999999999982

    1. Initial program 64.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 B around 0 49.1%

      \[\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)} \]
    3. Taylor expanded in F around -inf 82.5%

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

        \[\leadsto \color{blue}{-\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      2. distribute-neg-in82.5%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right) + \left(-\frac{x}{B}\right)} \]
      3. distribute-neg-frac82.5%

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

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

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

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

    if -6.0000000000000002e199 < F < -2.80000000000000002e177 or -7.79999999999999982 < F < 6e4

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u46.6%

        \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)\right)} \]
      2. expm1-udef28.6%

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*28.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan28.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr28.6%

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

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

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

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

    if 6e4 < F

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

      \[\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)} \]
    3. Taylor expanded in F around inf 76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{+199}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{+177}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -7.8:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 60000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 18: 71.3% accurate, 2.8× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 23000:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6999999999999998e233 or -7.49999999999999983e146 < F < -2.60000000000000009

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

    if -3.6999999999999998e233 < F < -7.49999999999999983e146

    1. Initial program 63.7%

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

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

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

    if -2.60000000000000009 < F < 23000

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u45.9%

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

        \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
      3. associate-/l*26.9%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
      4. quot-tan26.9%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
    9. Applied egg-rr26.9%

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)} \]
    10. Step-by-step derivation
      1. expm1-def46.0%

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

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

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

    if 23000 < F

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

      \[\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)} \]
    3. Taylor expanded in F around inf 76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.7 \cdot 10^{+233}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -2.6:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 23000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 19: 43.6% accurate, 2.9× speedup?

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

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

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

\mathbf{elif}\;F \leq 7.8 \cdot 10^{+80} \lor \neg \left(F \leq 2.35 \cdot 10^{+185}\right):\\
\;\;\;\;\frac{1}{\sin B}\\

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


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

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

      \[\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}{-1 \cdot \frac{1 + x}{B} + B \cdot \left(0.3333333333333333 \cdot x - 0.16666666666666666\right)} \]

    if -2.1999999999999999e-97 < F < 2.30000000000000007e-10

    1. Initial program 99.6%

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

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

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

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

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

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

    if 2.30000000000000007e-10 < F < 7.79999999999999998e80 or 2.34999999999999986e185 < F

    1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.79999999999999998e80 < F < 2.34999999999999986e185

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.2 \cdot 10^{-97}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) - \frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-10}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{+80} \lor \neg \left(F \leq 2.35 \cdot 10^{+185}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 20: 44.6% accurate, 2.9× speedup?

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

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

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

\mathbf{elif}\;F \leq 2.25 \cdot 10^{+79} \lor \neg \left(F \leq 3.7 \cdot 10^{+186}\right):\\
\;\;\;\;\frac{1}{\sin B}\\

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


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

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

      \[\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}{-1 \cdot \frac{1 + x}{B} + B \cdot \left(0.3333333333333333 \cdot x - 0.16666666666666666\right)} \]

    if -6.8000000000000003e-98 < F < 1100

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1100 < F < 2.24999999999999997e79 or 3.7e186 < F

    1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.24999999999999997e79 < F < 3.7e186

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-98}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) - \frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 1100:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{elif}\;F \leq 2.25 \cdot 10^{+79} \lor \neg \left(F \leq 3.7 \cdot 10^{+186}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 21: 55.4% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \frac{-x}{\tan B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ (- x) (tan B)))
double code(double F, double B, double x) {
	return -x / tan(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 / tan(b)
end function
public static double code(double F, double B, double x) {
	return -x / Math.tan(B);
}
def code(F, B, x):
	return -x / math.tan(B)
function code(F, B, x)
	return Float64(Float64(-x) / tan(B))
end
function tmp = code(F, B, x)
	tmp = -x / tan(B);
end
code[F_, B_, x_] := N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-x}{\tan B}
\end{array}
Derivation
  1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x \cdot \cos B}{\sin B}\right)} - 1\right)} \]
    3. associate-/l*25.1%

      \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\right)} - 1\right) \]
    4. quot-tan25.1%

      \[\leadsto -\left(e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{\tan B}}\right)} - 1\right) \]
  9. Applied egg-rr25.1%

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

      \[\leadsto -\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)} \]
    2. expm1-log1p57.2%

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

    \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
  12. Final simplification57.2%

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

Alternative 22: 42.7% accurate, 21.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-97}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) - \frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-113}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B} + B \cdot 0.16666666666666666\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.6e-97)
   (- (* B (- (* x 0.3333333333333333) 0.16666666666666666)) (/ (+ x 1.0) B))
   (if (<= F 2.4e-113)
     (/ (- x) B)
     (+ (/ (- 1.0 x) B) (* B 0.16666666666666666)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.6e-97) {
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) - ((x + 1.0) / B);
	} else if (F <= 2.4e-113) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 - x) / 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 <= (-1.6d-97)) then
        tmp = (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0)) - ((x + 1.0d0) / b)
    else if (f <= 2.4d-113) then
        tmp = -x / b
    else
        tmp = ((1.0d0 - x) / b) + (b * 0.16666666666666666d0)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.6e-97) {
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) - ((x + 1.0) / B);
	} else if (F <= 2.4e-113) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 - x) / B) + (B * 0.16666666666666666);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.6e-97:
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) - ((x + 1.0) / B)
	elif F <= 2.4e-113:
		tmp = -x / B
	else:
		tmp = ((1.0 - x) / B) + (B * 0.16666666666666666)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.6e-97)
		tmp = Float64(Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666)) - Float64(Float64(x + 1.0) / B));
	elseif (F <= 2.4e-113)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(Float64(1.0 - x) / B) + Float64(B * 0.16666666666666666));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.6e-97)
		tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) - ((x + 1.0) / B);
	elseif (F <= 2.4e-113)
		tmp = -x / B;
	else
		tmp = ((1.0 - x) / B) + (B * 0.16666666666666666);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.6e-97], N[(N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision] - N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e-113], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(B * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{-97}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) - \frac{x + 1}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-113}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B} + B \cdot 0.16666666666666666\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.5999999999999999e-97

    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 86.8%

      \[\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}{-1 \cdot \frac{1 + x}{B} + B \cdot \left(0.3333333333333333 \cdot x - 0.16666666666666666\right)} \]

    if -1.5999999999999999e-97 < F < 2.40000000000000012e-113

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 60.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)} \]
    3. Taylor expanded in x around inf 44.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/44.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-144.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    5. Simplified44.4%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.40000000000000012e-113 < F

    1. Initial program 68.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/78.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
      2. associate-/l*78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}}} \]
      3. +-commutative78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}} \]
      4. fma-def78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}} \]
      5. fma-def78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}}} \]
      6. metadata-eval78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}}} \]
      7. metadata-eval78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}}} \]
    3. Applied egg-rr78.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} \]
    4. Taylor expanded in F around inf 87.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{F \cdot \sin B}} \]
    5. Taylor expanded in B around 0 64.7%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{F \cdot \sin B} \]
    6. Taylor expanded in B around 0 38.8%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate--l+38.8%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot B + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. *-commutative38.8%

        \[\leadsto \color{blue}{B \cdot 0.16666666666666666} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. div-sub38.8%

        \[\leadsto B \cdot 0.16666666666666666 + \color{blue}{\frac{1 - x}{B}} \]
    8. Simplified38.8%

      \[\leadsto \color{blue}{B \cdot 0.16666666666666666 + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-97}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) - \frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-113}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B} + B \cdot 0.16666666666666666\\ \end{array} \]

Alternative 23: 42.4% accurate, 24.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-113}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B} + B \cdot 0.16666666666666666\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6.5e-125)
   (/ (- -1.0 x) B)
   (if (<= F 2.15e-113)
     (/ (- x) B)
     (+ (/ (- 1.0 x) B) (* B 0.16666666666666666)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.5e-125) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.15e-113) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 - x) / 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 <= (-6.5d-125)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 2.15d-113) then
        tmp = -x / b
    else
        tmp = ((1.0d0 - x) / b) + (b * 0.16666666666666666d0)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.5e-125) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.15e-113) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 - x) / B) + (B * 0.16666666666666666);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6.5e-125:
		tmp = (-1.0 - x) / B
	elif F <= 2.15e-113:
		tmp = -x / B
	else:
		tmp = ((1.0 - x) / B) + (B * 0.16666666666666666)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6.5e-125)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 2.15e-113)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(Float64(1.0 - x) / B) + Float64(B * 0.16666666666666666));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -6.5e-125)
		tmp = (-1.0 - x) / B;
	elseif (F <= 2.15e-113)
		tmp = -x / B;
	else
		tmp = ((1.0 - x) / B) + (B * 0.16666666666666666);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6.5e-125], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.15e-113], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(B * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.5 \cdot 10^{-125}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 2.15 \cdot 10^{-113}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B} + B \cdot 0.16666666666666666\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -6.4999999999999999e-125

    1. Initial program 74.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 84.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 42.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/42.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in42.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval42.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-142.8%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified42.8%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -6.4999999999999999e-125 < F < 2.15e-113

    1. Initial program 99.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 61.6%

      \[\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)} \]
    3. Taylor expanded in x around inf 47.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/47.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-147.3%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    5. Simplified47.3%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.15e-113 < F

    1. Initial program 68.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/78.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
      2. associate-/l*78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}}} \]
      3. +-commutative78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}} \]
      4. fma-def78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}} \]
      5. fma-def78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}}} \]
      6. metadata-eval78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}}} \]
      7. metadata-eval78.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}}} \]
    3. Applied egg-rr78.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} \]
    4. Taylor expanded in F around inf 87.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{F \cdot \sin B}} \]
    5. Taylor expanded in B around 0 64.7%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{F \cdot \sin B} \]
    6. Taylor expanded in B around 0 38.8%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate--l+38.8%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot B + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. *-commutative38.8%

        \[\leadsto \color{blue}{B \cdot 0.16666666666666666} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. div-sub38.8%

        \[\leadsto B \cdot 0.16666666666666666 + \color{blue}{\frac{1 - x}{B}} \]
    8. Simplified38.8%

      \[\leadsto \color{blue}{B \cdot 0.16666666666666666 + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-113}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B} + B \cdot 0.16666666666666666\\ \end{array} \]

Alternative 24: 42.7% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6.5e-125)
   (/ (- -1.0 x) B)
   (if (<= F 8.5e-79) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.5e-125) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 8.5e-79) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-6.5d-125)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 8.5d-79) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.5e-125) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 8.5e-79) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6.5e-125:
		tmp = (-1.0 - x) / B
	elif F <= 8.5e-79:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6.5e-125)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 8.5e-79)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -6.5e-125)
		tmp = (-1.0 - x) / B;
	elseif (F <= 8.5e-79)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6.5e-125], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.5e-79], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.5 \cdot 10^{-125}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 8.5 \cdot 10^{-79}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -6.4999999999999999e-125

    1. Initial program 74.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 84.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 42.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/42.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in42.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval42.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-142.8%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified42.8%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -6.4999999999999999e-125 < F < 8.50000000000000029e-79

    1. Initial program 99.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 60.2%

      \[\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)} \]
    3. Taylor expanded in x around inf 45.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/45.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-145.6%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    5. Simplified45.6%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 8.50000000000000029e-79 < F

    1. Initial program 66.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/76.6%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
      2. associate-/l*76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}}} \]
      3. +-commutative76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}} \]
      4. fma-def76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}} \]
      5. fma-def76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}}} \]
      6. metadata-eval76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}}} \]
      7. metadata-eval76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}}} \]
    3. Applied egg-rr76.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} \]
    4. Taylor expanded in F around inf 90.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{F \cdot \sin B}} \]
    5. Taylor expanded in B around 0 67.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{F \cdot \sin B} \]
    6. Taylor expanded in B around 0 39.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 25: 35.5% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 3.5 \cdot 10^{-86}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 3.5e-86) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 3.5e-86) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= 3.5d-86) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 3.5e-86) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 3.5e-86:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 3.5e-86)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 3.5e-86)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 3.5e-86], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.5 \cdot 10^{-86}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 3.50000000000000021e-86

    1. Initial program 85.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 55.8%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in x around inf 32.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/32.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-132.7%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    5. Simplified32.7%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 3.50000000000000021e-86 < F

    1. Initial program 66.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/76.6%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
      2. associate-/l*76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}}} \]
      3. +-commutative76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}} \]
      4. fma-def76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}} \]
      5. fma-def76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}}} \]
      6. metadata-eval76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}}} \]
      7. metadata-eval76.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}}} \]
    3. Applied egg-rr76.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} \]
    4. Taylor expanded in F around inf 90.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{F \cdot \sin B}} \]
    5. Taylor expanded in B around 0 67.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{F \cdot \sin B} \]
    6. Taylor expanded in B around 0 39.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 3.5 \cdot 10^{-86}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 26: 29.0% 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 79.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 B around 0 51.4%

    \[\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)} \]
  3. Taylor expanded in x around inf 30.0%

    \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
  4. Step-by-step derivation
    1. associate-*r/30.0%

      \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
    2. neg-mul-130.0%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  5. Simplified30.0%

    \[\leadsto \color{blue}{\frac{-x}{B}} \]
  6. Final simplification30.0%

    \[\leadsto \frac{-x}{B} \]

Reproduce

?
herbie shell --seed 2023318 
(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))))))