VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.1% → 99.7%
Time: 23.1s
Alternatives: 29
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 29 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: 77.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.7%

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

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

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

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

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

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

    if -2.79999999999999983e30 < F < 1.15e8

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

    if 1.15e8 < F

    1. Initial program 51.2%

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

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

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

Alternative 2: 99.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.9:\\
\;\;\;\;t_0 + \frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\

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


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

    1. Initial program 59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -43000 < F < 0.900000000000000022

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

    if 0.900000000000000022 < F

    1. Initial program 52.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 x around 0 52.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -43000 < F < 0.92000000000000004

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 0.92000000000000004 < F

    1. Initial program 52.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 x around 0 52.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 92.1% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -2.4 \cdot 10^{-209}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 60.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 x around 0 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2100 < F < -2.4000000000000001e-209 or 1.50000000000000011e-109 < F < 6e7

    1. Initial program 99.3%

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

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

    if -2.4000000000000001e-209 < F < 1.50000000000000011e-109

    1. Initial program 99.5%

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

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

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

    if 6e7 < F

    1. Initial program 51.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2100:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{\frac{-1}{F} - F}}{\sin B}\\ \mathbf{elif}\;F \leq -2.4 \cdot 10^{-209}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-109}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{elif}\;F \leq 60000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 5: 92.3% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -5.2 \cdot 10^{-202}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-111}:\\
\;\;\;\;t_1 \cdot \frac{F}{B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 45000000:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 60.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 x around 0 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -420 < F < -5.20000000000000019e-202 or 8.19999999999999936e-111 < F < 4.5e7

    1. Initial program 99.3%

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

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

    if -5.20000000000000019e-202 < F < 8.19999999999999936e-111

    1. Initial program 99.5%

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

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

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

        \[\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. Applied egg-rr37.2%

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

        \[\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)} \]
    6. Simplified92.2%

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

    if 4.5e7 < F

    1. Initial program 51.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -420:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{\frac{-1}{F} - F}}{\sin B}\\ \mathbf{elif}\;F \leq -5.2 \cdot 10^{-202}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-111}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 45000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 6: 91.9% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -43000 < F < 1.00000000000000005e-4

    1. Initial program 99.4%

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

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

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

    if 1.00000000000000005e-4 < F

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 91.9% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 60.0%

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

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

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

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

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

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

    if -0.0800000000000000017 < F < 6.9999999999999994e-5

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}}^{-0.5}}} \]
    3. Applied egg-rr99.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 B around 0 84.5%

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

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

    if 6.9999999999999994e-5 < F

    1. Initial program 54.1%

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

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

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

Alternative 8: 92.0% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 60.0%

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

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

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

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

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

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

    if -0.13 < F < 1.00000000000000005e-4

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}}^{-0.5}}} \]
    3. Applied egg-rr99.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 B around 0 84.5%

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

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

    if 1.00000000000000005e-4 < F

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 91.9% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -43000 < F < 1.00000000000000005e-4

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}}^{-0.5}}} \]
    3. Applied egg-rr99.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 B around 0 84.7%

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

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

    if 1.00000000000000005e-4 < F

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 83.5% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 60.0%

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

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

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

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

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

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

    if -240 < F < -2.6e-223

    1. Initial program 99.5%

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

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

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

    if -2.6e-223 < F < 5.8999999999999996e-87

    1. Initial program 99.4%

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

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

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

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

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

    if 5.8999999999999996e-87 < F

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

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

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

Alternative 11: 70.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\
\;\;\;\;t_0 - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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

\mathbf{elif}\;F \leq 5.5 \cdot 10^{-49}:\\
\;\;\;\;t_0 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.15 \cdot 10^{-19}:\\
\;\;\;\;t_1 + \frac{-1}{B}\\

\mathbf{elif}\;F \leq 5.2 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 59.5%

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

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

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

    if -43000 < F < -2.6e-223

    1. Initial program 99.4%

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

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

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

    if -2.6e-223 < F < 1.12000000000000009e-111

    1. Initial program 99.5%

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

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

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

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

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

    if 1.12000000000000009e-111 < F < 5.50000000000000031e-49

    1. Initial program 99.3%

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

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

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

    if 5.50000000000000031e-49 < F < 2.15e-19

    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. Taylor expanded in F around -inf 34.0%

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

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

    if 2.15e-19 < F < 5.2000000000000001e40

    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. Taylor expanded in F around inf 79.8%

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

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

    if 5.2000000000000001e40 < F

    1. Initial program 44.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -43000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 1.12 \cdot 10^{-111}:\\ \;\;\;\;-\frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-49}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-19}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 12: 76.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\
\;\;\;\;t_1 - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-49}:\\
\;\;\;\;t_1 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.65 \cdot 10^{-19}:\\
\;\;\;\;t_0 + \frac{-1}{B}\\

\mathbf{elif}\;F \leq 6 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 60.0%

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

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

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

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

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

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

    if -245 < F < -2.6e-223

    1. Initial program 99.5%

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

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

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

    if -2.6e-223 < F < 9.0000000000000002e-109

    1. Initial program 99.5%

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

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

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

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

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

    if 9.0000000000000002e-109 < F < 4.1999999999999998e-49

    1. Initial program 99.3%

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

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

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

    if 4.1999999999999998e-49 < F < 1.6499999999999999e-19

    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. Taylor expanded in F around -inf 34.0%

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

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

    if 1.6499999999999999e-19 < F < 6.0000000000000004e40

    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. Taylor expanded in F around inf 79.8%

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

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

    if 6.0000000000000004e40 < F

    1. Initial program 44.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -245:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 9 \cdot 10^{-109}:\\ \;\;\;\;-\frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-49}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-19}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+40}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 13: 69.8% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -3.9 \cdot 10^{-224}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 6.5 \cdot 10^{-64}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 7.5 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 59.5%

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

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

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

    if -43000 < F < -3.8999999999999998e-224 or 1.75000000000000014e-104 < F < 6.5000000000000004e-64

    1. Initial program 99.4%

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

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

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

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

    if -3.8999999999999998e-224 < F < 1.75000000000000014e-104

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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 B around 0 89.6%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B \cdot \color{blue}{\left(-1 \cdot F + -0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} \]
    6. Step-by-step derivation
      1. neg-mul-183.5%

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

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

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

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

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

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

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

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

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

    if 6.5000000000000004e-64 < F < 1.6499999999999999e-19

    1. Initial program 99.1%

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Step-by-step derivation
      1. div-inv99.4%

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

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

        \[\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)} \]
    5. Applied egg-rr20.3%

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

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

        \[\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)} \]
    7. Simplified42.4%

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

    if 1.6499999999999999e-19 < F < 7.4999999999999996e40

    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. Taylor expanded in F around inf 79.8%

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

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

    if 7.4999999999999996e40 < F

    1. Initial program 44.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -43000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.9 \cdot 10^{-224}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x \cdot \left(\frac{1}{B} + B \cdot -0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-104}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(\frac{-1 - x}{F} - F\right)}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-64}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x \cdot \left(\frac{1}{B} + B \cdot -0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-19}:\\ \;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+40}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 14: 70.9% accurate, 2.5× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 0.0001:\\
\;\;\;\;t_0 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.1 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 59.5%

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

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

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

    if -43000 < F < -2.6e-223

    1. Initial program 99.4%

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

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

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

    if -2.6e-223 < F < 1.75e-109

    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. fma-def99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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 B around 0 91.2%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B \cdot \color{blue}{\left(-1 \cdot F + -0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} \]
    6. Step-by-step derivation
      1. neg-mul-185.0%

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

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

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

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

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

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

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

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

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

    if 1.75e-109 < F < 1.00000000000000005e-4

    1. Initial program 99.1%

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

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

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

    if 1.00000000000000005e-4 < F < 2.1000000000000001e40

    1. Initial program 99.1%

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

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

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

    if 2.1000000000000001e40 < F

    1. Initial program 44.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -43000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} + x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-109}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(\frac{-1 - x}{F} - F\right)}\\ \mathbf{elif}\;F \leq 0.0001:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{+40}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 15: 70.9% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\
\;\;\;\;t_0 - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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

\mathbf{elif}\;F \leq 0.0001:\\
\;\;\;\;t_0 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 59.5%

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

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

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

    if -43000 < F < -2.6e-223

    1. Initial program 99.4%

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

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

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

    if -2.6e-223 < F < 1.42e-108

    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. fma-def99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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 B around 0 91.2%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B \cdot \color{blue}{\left(-1 \cdot F + -0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} \]
    6. Step-by-step derivation
      1. neg-mul-185.0%

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

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

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

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

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

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

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

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

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

    if 1.42e-108 < F < 1.00000000000000005e-4

    1. Initial program 99.1%

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

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

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

    if 1.00000000000000005e-4 < F < 7.4999999999999996e40

    1. Initial program 99.1%

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

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

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

    if 7.4999999999999996e40 < F

    1. Initial program 44.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -43000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{-108}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(\frac{-1 - x}{F} - F\right)}\\ \mathbf{elif}\;F \leq 0.0001:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+40}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 16: 70.9% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\
\;\;\;\;t_0\\

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

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

\mathbf{elif}\;F \leq 1.35 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 59.5%

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

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

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

    if -43000 < F < -2.6e-223 or 2.1e-113 < F < 1.00000000000000005e-4

    1. Initial program 99.3%

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

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

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

    if -2.6e-223 < F < 2.1e-113

    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. fma-def99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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 B around 0 91.2%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B \cdot \color{blue}{\left(-1 \cdot F + -0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} \]
    6. Step-by-step derivation
      1. neg-mul-185.0%

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

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

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

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

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

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

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

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

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

    if 1.00000000000000005e-4 < F < 1.35000000000000005e40

    1. Initial program 99.1%

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

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

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

    if 1.35000000000000005e40 < F

    1. Initial program 44.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -43000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.6 \cdot 10^{-223}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-113}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(\frac{-1 - x}{F} - F\right)}\\ \mathbf{elif}\;F \leq 0.0001:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{+40}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 17: 71.0% accurate, 2.7× speedup?

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

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

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

\mathbf{elif}\;F \leq 7 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 58.1%

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

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

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

    if -1.02e6 < F < 8.5000000000000001e-22

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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 B around 0 83.9%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B \cdot \color{blue}{\left(-1 \cdot F + -0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} \]
    6. Step-by-step derivation
      1. neg-mul-166.8%

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

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

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

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

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

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

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

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

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

    if 8.5000000000000001e-22 < F < 6.9999999999999998e40

    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. Taylor expanded in F around inf 79.8%

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

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

    if 6.9999999999999998e40 < F

    1. Initial program 44.1%

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

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

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

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

Alternative 18: 59.8% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.1 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.4 \cdot 10^{-226}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-19} \lor \neg \left(F \leq 5.6 \cdot 10^{+40}\right):\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.1e-21)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -6.4e-226)
     (* x (+ (/ -1.0 B) (* B 0.3333333333333333)))
     (if (or (<= F 3.4e-19) (not (<= F 5.6e+40)))
       (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
       (- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.1e-21) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -6.4e-226) {
		tmp = x * ((-1.0 / B) + (B * 0.3333333333333333));
	} else if ((F <= 3.4e-19) || !(F <= 5.6e+40)) {
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	} else {
		tmp = ((F / sin(B)) * (1.0 / F)) - (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.1d-21)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-6.4d-226)) then
        tmp = x * (((-1.0d0) / b) + (b * 0.3333333333333333d0))
    else if ((f <= 3.4d-19) .or. (.not. (f <= 5.6d+40))) then
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
    else
        tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.1e-21) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -6.4e-226) {
		tmp = x * ((-1.0 / B) + (B * 0.3333333333333333));
	} else if ((F <= 3.4e-19) || !(F <= 5.6e+40)) {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	} else {
		tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.1e-21:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -6.4e-226:
		tmp = x * ((-1.0 / B) + (B * 0.3333333333333333))
	elif (F <= 3.4e-19) or not (F <= 5.6e+40):
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	else:
		tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.1e-21)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -6.4e-226)
		tmp = Float64(x * Float64(Float64(-1.0 / B) + Float64(B * 0.3333333333333333)));
	elseif ((F <= 3.4e-19) || !(F <= 5.6e+40))
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
	else
		tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.1e-21)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -6.4e-226)
		tmp = x * ((-1.0 / B) + (B * 0.3333333333333333));
	elseif ((F <= 3.4e-19) || ~((F <= 5.6e+40)))
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	else
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-21], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.4e-226], N[(x * N[(N[(-1.0 / B), $MachinePrecision] + N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 3.4e-19], N[Not[LessEqual[F, 5.6e+40]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -6.4 \cdot 10^{-226}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

\mathbf{elif}\;F \leq 3.4 \cdot 10^{-19} \lor \neg \left(F \leq 5.6 \cdot 10^{+40}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\

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


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

    1. Initial program 61.3%

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

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

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

    if -2.10000000000000013e-21 < F < -6.39999999999999965e-226

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 23.5%

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

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

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

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

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in54.4%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef54.4%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in54.4%

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

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

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

    if -6.39999999999999965e-226 < F < 3.4000000000000002e-19 or 5.6000000000000003e40 < F

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

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

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

    if 3.4000000000000002e-19 < F < 5.6000000000000003e40

    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. Taylor expanded in F around inf 79.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.1 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.4 \cdot 10^{-226}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-19} \lor \neg \left(F \leq 5.6 \cdot 10^{+40}\right):\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \]

Alternative 19: 60.8% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -2.4 \cdot 10^{-225}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

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

\mathbf{elif}\;F \leq 3.9 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 61.3%

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

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

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

    if -2.10000000000000013e-21 < F < -2.39999999999999996e-225

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 23.5%

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

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

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

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

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in54.4%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef54.4%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in54.4%

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

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

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

    if -2.39999999999999996e-225 < F < 7.80000000000000014e-20

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Step-by-step derivation
      1. div-inv99.6%

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

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

        \[\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)} \]
    5. Applied egg-rr23.4%

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

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

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

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

    if 7.80000000000000014e-20 < F < 3.9000000000000001e40

    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. Taylor expanded in F around inf 79.8%

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

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

    if 3.9000000000000001e40 < F

    1. Initial program 44.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.1 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.4 \cdot 10^{-225}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-20}:\\ \;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.9 \cdot 10^{+40}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 20: 60.7% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -2.05 \cdot 10^{-226}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-21}:\\
\;\;\;\;t_0 + \frac{-1}{F \cdot \frac{B}{F}}\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{+40}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 61.3%

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

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

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

    if -1.68000000000000006e-21 < F < -2.05000000000000019e-226

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 23.5%

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

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

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

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

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in54.4%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef54.4%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in54.4%

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

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

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

    if -2.05000000000000019e-226 < F < 8.19999999999999988e-21

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Step-by-step derivation
      1. clear-num57.9%

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

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

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

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

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

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

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

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

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

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

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

    if 8.19999999999999988e-21 < F < 7.4999999999999996e40

    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. Taylor expanded in F around inf 79.8%

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

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

    if 7.4999999999999996e40 < F

    1. Initial program 44.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.68 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.05 \cdot 10^{-226}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-21}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{F \cdot \frac{B}{F}}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+40}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]

Alternative 21: 52.6% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq -4.1 \cdot 10^{-227}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

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

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


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

    1. Initial program 61.3%

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

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

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

    if -2.29999999999999999e-21 < F < -4.10000000000000009e-227

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 23.5%

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

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

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

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

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in54.4%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef54.4%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in54.4%

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

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

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

    if -4.10000000000000009e-227 < F < 3.4499999999999999e-19

    1. Initial program 99.4%

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

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

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

    if 3.4499999999999999e-19 < F

    1. Initial program 55.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 47.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.1 \cdot 10^{-227}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 3.45 \cdot 10^{-19}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \left(\frac{1}{B} + B \cdot -0.3333333333333333\right)\\ \end{array} \]

Alternative 22: 59.6% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;F \leq -2.05 \cdot 10^{-226}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

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


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

    1. Initial program 61.3%

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

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

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

    if -1.68000000000000006e-21 < F < -2.05000000000000019e-226

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 23.5%

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

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

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

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

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in54.4%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef54.4%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in54.4%

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

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

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

    if -2.05000000000000019e-226 < F

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

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

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

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

Alternative 23: 50.2% accurate, 3.0× speedup?

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

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

\mathbf{elif}\;F \leq 3.65 \cdot 10^{-84}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

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


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

    1. Initial program 61.3%

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

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

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

    if -1.7e-21 < F < 3.6500000000000002e-84

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 19.7%

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

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

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

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

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in40.8%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef40.8%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in40.8%

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

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

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

    if 3.6500000000000002e-84 < F

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 42.3%

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

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

Alternative 24: 43.4% accurate, 18.9× speedup?

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

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

\mathbf{elif}\;F \leq 4.5 \cdot 10^{-85}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

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


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

    1. Initial program 61.3%

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

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

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

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

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

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

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

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

    if -1.8999999999999999e-21 < F < 4.50000000000000004e-85

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 19.7%

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

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

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

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

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in40.8%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef40.8%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in40.8%

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

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

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

    if 4.50000000000000004e-85 < F

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 42.3%

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

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

Alternative 25: 43.4% accurate, 18.9× speedup?

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

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

\mathbf{elif}\;F \leq 1.45 \cdot 10^{-85}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

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


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

    1. Initial program 61.3%

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

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

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

    if -1.7500000000000002e-21 < F < 1.4500000000000001e-85

    1. Initial program 99.4%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 19.7%

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

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

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

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

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in40.8%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef40.8%

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

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

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

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

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in40.8%

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

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

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

    if 1.4500000000000001e-85 < F

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 42.3%

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

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

Alternative 26: 42.8% accurate, 24.7× speedup?

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

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

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

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


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

    1. Initial program 61.3%

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

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

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

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

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

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

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

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

    if -1.7e-21 < F < 5.00000000000000013e-147

    1. Initial program 99.5%

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

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

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 20.5%

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

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

        \[\leadsto \color{blue}{-x \cdot \left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)} \]
      2. *-commutative44.1%

        \[\leadsto -x \cdot \left(\color{blue}{B \cdot -0.3333333333333333} + \frac{1}{B}\right) \]
      3. fma-udef44.1%

        \[\leadsto -x \cdot \color{blue}{\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)} \]
      4. distribute-rgt-neg-in44.1%

        \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(B, -0.3333333333333333, \frac{1}{B}\right)\right)} \]
      5. fma-udef44.1%

        \[\leadsto x \cdot \left(-\color{blue}{\left(B \cdot -0.3333333333333333 + \frac{1}{B}\right)}\right) \]
      6. +-commutative44.1%

        \[\leadsto x \cdot \left(-\color{blue}{\left(\frac{1}{B} + B \cdot -0.3333333333333333\right)}\right) \]
      7. distribute-neg-in44.1%

        \[\leadsto x \cdot \color{blue}{\left(\left(-\frac{1}{B}\right) + \left(-B \cdot -0.3333333333333333\right)\right)} \]
      8. distribute-neg-frac44.1%

        \[\leadsto x \cdot \left(\color{blue}{\frac{-1}{B}} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      9. metadata-eval44.1%

        \[\leadsto x \cdot \left(\frac{\color{blue}{-1}}{B} + \left(-B \cdot -0.3333333333333333\right)\right) \]
      10. distribute-rgt-neg-in44.1%

        \[\leadsto x \cdot \left(\frac{-1}{B} + \color{blue}{B \cdot \left(--0.3333333333333333\right)}\right) \]
      11. metadata-eval44.1%

        \[\leadsto x \cdot \left(\frac{-1}{B} + B \cdot \color{blue}{0.3333333333333333}\right) \]
    7. Simplified44.1%

      \[\leadsto \color{blue}{x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)} \]

    if 5.00000000000000013e-147 < F

    1. Initial program 65.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 40.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in B around 0 24.3%

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 39.1%

      \[\leadsto \left(-x \cdot \left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)\right) + \color{blue}{\frac{1}{B}} \]
    5. Taylor expanded in B around 0 39.0%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 27: 37.0% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 2.25 \cdot 10^{-228}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 2.25e-228) (/ (- -1.0 x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 2.25e-228) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= 2.25d-228) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 2.25e-228) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 2.25e-228:
		tmp = (-1.0 - x) / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 2.25e-228)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 2.25e-228)
		tmp = (-1.0 - x) / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 2.25e-228], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.25 \cdot 10^{-228}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.25e-228

    1. Initial program 77.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 68.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 37.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/37.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in37.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval37.3%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-137.3%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified37.3%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if 2.25e-228 < F

    1. Initial program 70.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 47.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in B around 0 27.1%

      \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 36.3%

      \[\leadsto \left(-x \cdot \left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)\right) + \color{blue}{\frac{1}{B}} \]
    5. Taylor expanded in B around 0 36.4%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 2.25 \cdot 10^{-228}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 28: 29.7% accurate, 64.8× speedup?

\[\begin{array}{l} \\ \frac{1 - x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ (- 1.0 x) B))
double code(double F, double B, double x) {
	return (1.0 - 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 = (1.0d0 - x) / b
end function
public static double code(double F, double B, double x) {
	return (1.0 - x) / B;
}
def code(F, B, x):
	return (1.0 - x) / B
function code(F, B, x)
	return Float64(Float64(1.0 - x) / B)
end
function tmp = code(F, B, x)
	tmp = (1.0 - x) / B;
end
code[F_, B_, x_] := N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{1 - x}{B}
\end{array}
Derivation
  1. Initial program 74.6%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Taylor expanded in B around 0 56.6%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  3. Taylor expanded in B around 0 34.9%

    \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 27.7%

    \[\leadsto \left(-x \cdot \left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)\right) + \color{blue}{\frac{1}{B}} \]
  5. Taylor expanded in B around 0 27.7%

    \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  6. Final simplification27.7%

    \[\leadsto \frac{1 - x}{B} \]

Alternative 29: 10.0% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
	return 1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
	return 1.0 / B;
}
def code(F, B, x):
	return 1.0 / B
function code(F, B, x)
	return Float64(1.0 / B)
end
function tmp = code(F, B, x)
	tmp = 1.0 / B;
end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{B}
\end{array}
Derivation
  1. Initial program 74.6%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Taylor expanded in B around 0 56.6%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  3. Taylor expanded in B around 0 34.9%

    \[\leadsto \left(-x \cdot \color{blue}{\left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)}\right) + \frac{F}{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 27.7%

    \[\leadsto \left(-x \cdot \left(-0.3333333333333333 \cdot B + \frac{1}{B}\right)\right) + \color{blue}{\frac{1}{B}} \]
  5. Taylor expanded in x around 0 9.3%

    \[\leadsto \color{blue}{\frac{1}{B}} \]
  6. Final simplification9.3%

    \[\leadsto \frac{1}{B} \]

Reproduce

?
herbie shell --seed 2023315 
(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))))))