VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.5% → 99.6%
Time: 18.1s
Alternatives: 23
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 23 alternatives:

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

Initial Program: 76.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;F \leq 0.64:\\
\;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}} - t_0\\

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


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

    1. Initial program 35.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999998e125 < F < 0.640000000000000013

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.640000000000000013 < F

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 31.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000015e154 < F < 0.640000000000000013

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.640000000000000013 < F

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 51.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e8 < F < 0.640000000000000013

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.640000000000000013 < F

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.900000000000000022 < F < 0.640000000000000013

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.640000000000000013 < F

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.900000000000000022 < F < 0.640000000000000013

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.640000000000000013 < F

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{1}{B}\right) - t_0\\

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


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

    1. Initial program 53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.64999999999999998e-34 < F < 6.9999999999999998e-9

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999998e-9 < F

    1. Initial program 60.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. +-commutative60.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 84.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 9.2 \cdot 10^{-98}:\\
\;\;\;\;\frac{-F \cdot F}{\sin B} - t_0\\

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


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

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{{F}^{2}} - 1}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. sub-neg99.6%

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

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

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

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

    if -1.1499999999999999 < F < 9.20000000000000002e-98

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg74.0%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{{F}^{2}}{\sin B}} - \frac{x}{\tan B} \]
    15. Step-by-step derivation
      1. associate-*r/74.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot {F}^{2}}{\sin B}} - \frac{x}{\tan B} \]
      2. mul-1-neg74.0%

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

        \[\leadsto \frac{-\color{blue}{F \cdot F}}{\sin B} - \frac{x}{\tan B} \]
      4. distribute-rgt-neg-in74.0%

        \[\leadsto \frac{\color{blue}{F \cdot \left(-F\right)}}{\sin B} - \frac{x}{\tan B} \]
    16. Simplified74.0%

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

    if 9.20000000000000002e-98 < F

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 85.5% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{{F}^{2}} - 1}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. sub-neg99.6%

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

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

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

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

    if -0.849999999999999978 < F

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 85.7% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg91.1%

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

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

    if -2e-140 < F

    1. Initial program 81.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. +-commutative81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 84.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 8.8 \cdot 10^{-98}:\\
\;\;\;\;\frac{-F \cdot F}{\sin B} - t_0\\

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


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

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < F < 8.79999999999999985e-98

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg74.0%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{{F}^{2}}{\sin B}} - \frac{x}{\tan B} \]
    15. Step-by-step derivation
      1. associate-*r/74.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot {F}^{2}}{\sin B}} - \frac{x}{\tan B} \]
      2. mul-1-neg74.0%

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

        \[\leadsto \frac{-\color{blue}{F \cdot F}}{\sin B} - \frac{x}{\tan B} \]
      4. distribute-rgt-neg-in74.0%

        \[\leadsto \frac{\color{blue}{F \cdot \left(-F\right)}}{\sin B} - \frac{x}{\tan B} \]
    16. Simplified74.0%

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

    if 8.79999999999999985e-98 < F

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 84.8% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999998e-33 < F < 9.20000000000000002e-98

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg75.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\frac{F}{F + \frac{1}{F}}}{B}} - \frac{x}{\tan B} \]
      4. distribute-neg-frac75.1%

        \[\leadsto \frac{\color{blue}{\frac{-F}{F + \frac{1}{F}}}}{B} - \frac{x}{\tan B} \]
    16. Simplified75.1%

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

    if 9.20000000000000002e-98 < F

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 78.6% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 1.15 \cdot 10^{+150} \lor \neg \left(F \leq 3.8 \cdot 10^{+239}\right):\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

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


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

    1. Initial program 53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5000000000000001e-33 < F < 3.55e-16

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{\frac{\frac{F}{F + \frac{1}{F}}}{B}}\right) - \frac{x}{\tan B} \]
      3. distribute-frac-neg71.5%

        \[\leadsto \color{blue}{\frac{-\frac{F}{F + \frac{1}{F}}}{B}} - \frac{x}{\tan B} \]
      4. distribute-neg-frac71.5%

        \[\leadsto \frac{\color{blue}{\frac{-F}{F + \frac{1}{F}}}}{B} - \frac{x}{\tan B} \]
    16. Simplified71.5%

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

    if 3.55e-16 < F < 1.15000000000000001e150 or 3.8000000000000001e239 < F

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

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

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

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

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

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

    if 1.15000000000000001e150 < F < 3.8000000000000001e239

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 86.2%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification83.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.55 \cdot 10^{-16}:\\ \;\;\;\;\frac{-x}{\tan B} - \frac{\frac{F}{F + \frac{1}{F}}}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+150} \lor \neg \left(F \leq 3.8 \cdot 10^{+239}\right):\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 13: 72.0% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-16}:\\ \;\;\;\;\frac{-x}{\tan B} - \frac{\frac{F}{F + \frac{1}{F}}}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{+149} \lor \neg \left(F \leq 2.3 \cdot 10^{+239}\right):\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.55e-33)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 3.5e-16)
     (- (/ (- x) (tan B)) (/ (/ F (+ F (/ 1.0 F))) B))
     (if (or (<= F 6.5e+149) (not (<= F 2.3e+239)))
       (- (/ 1.0 (sin B)) (/ x B))
       (- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.55e-33) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 3.5e-16) {
		tmp = (-x / tan(B)) - ((F / (F + (1.0 / F))) / B);
	} else if ((F <= 6.5e+149) || !(F <= 2.3e+239)) {
		tmp = (1.0 / sin(B)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.55d-33)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 3.5d-16) then
        tmp = (-x / tan(b)) - ((f / (f + (1.0d0 / f))) / b)
    else if ((f <= 6.5d+149) .or. (.not. (f <= 2.3d+239))) then
        tmp = (1.0d0 / sin(b)) - (x / b)
    else
        tmp = (1.0d0 / b) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.55e-33) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 3.5e-16) {
		tmp = (-x / Math.tan(B)) - ((F / (F + (1.0 / F))) / B);
	} else if ((F <= 6.5e+149) || !(F <= 2.3e+239)) {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.55e-33:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 3.5e-16:
		tmp = (-x / math.tan(B)) - ((F / (F + (1.0 / F))) / B)
	elif (F <= 6.5e+149) or not (F <= 2.3e+239):
		tmp = (1.0 / math.sin(B)) - (x / B)
	else:
		tmp = (1.0 / B) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.55e-33)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 3.5e-16)
		tmp = Float64(Float64(Float64(-x) / tan(B)) - Float64(Float64(F / Float64(F + Float64(1.0 / F))) / B));
	elseif ((F <= 6.5e+149) || !(F <= 2.3e+239))
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.55e-33)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 3.5e-16)
		tmp = (-x / tan(B)) - ((F / (F + (1.0 / F))) / B);
	elseif ((F <= 6.5e+149) || ~((F <= 2.3e+239)))
		tmp = (1.0 / sin(B)) - (x / B);
	else
		tmp = (1.0 / B) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.55e-33], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-16], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] - N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 6.5e+149], N[Not[LessEqual[F, 2.3e+239]], $MachinePrecision]], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.55 \cdot 10^{-33}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 3.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{-x}{\tan B} - \frac{\frac{F}{F + \frac{1}{F}}}{B}\\

\mathbf{elif}\;F \leq 6.5 \cdot 10^{+149} \lor \neg \left(F \leq 2.3 \cdot 10^{+239}\right):\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.54999999999999998e-33

    1. Initial program 53.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 97.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -1.54999999999999998e-33 < F < 3.50000000000000017e-16

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.4%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.4%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow299.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef99.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u86.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-udef65.7%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. associate-*r/65.7%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. sqrt-div65.7%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval65.7%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv65.7%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr65.7%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. expm1-def86.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p99.7%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    10. Simplified99.7%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around -inf 71.5%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg71.5%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    13. Simplified71.5%

      \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right) - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    14. Taylor expanded in B around 0 71.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{F}{\left(F + \frac{1}{F}\right) \cdot B}} - \frac{x}{\tan B} \]
    15. Step-by-step derivation
      1. mul-1-neg71.5%

        \[\leadsto \color{blue}{\left(-\frac{F}{\left(F + \frac{1}{F}\right) \cdot B}\right)} - \frac{x}{\tan B} \]
      2. associate-/r*71.5%

        \[\leadsto \left(-\color{blue}{\frac{\frac{F}{F + \frac{1}{F}}}{B}}\right) - \frac{x}{\tan B} \]
      3. distribute-frac-neg71.5%

        \[\leadsto \color{blue}{\frac{-\frac{F}{F + \frac{1}{F}}}{B}} - \frac{x}{\tan B} \]
      4. distribute-neg-frac71.5%

        \[\leadsto \frac{\color{blue}{\frac{-F}{F + \frac{1}{F}}}}{B} - \frac{x}{\tan B} \]
    16. Simplified71.5%

      \[\leadsto \color{blue}{\frac{\frac{-F}{F + \frac{1}{F}}}{B}} - \frac{x}{\tan B} \]

    if 3.50000000000000017e-16 < F < 6.50000000000000015e149 or 2.3000000000000002e239 < F

    1. Initial program 58.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 38.6%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative38.6%

        \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \color{blue}{\left(x \cdot B\right)}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Simplified38.6%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Taylor expanded in F around inf 66.6%

      \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Taylor expanded in B around 0 86.5%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]

    if 6.50000000000000015e149 < F < 2.3000000000000002e239

    1. Initial program 67.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative67.3%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg67.3%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/77.0%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/77.0%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative77.0%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified77.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 99.6%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*99.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 86.2%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification77.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-16}:\\ \;\;\;\;\frac{-x}{\tan B} - \frac{\frac{F}{F + \frac{1}{F}}}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{+149} \lor \neg \left(F \leq 2.3 \cdot 10^{+239}\right):\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 14: 61.2% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := F + \frac{1}{F}\\ \mathbf{if}\;F \leq -8.5 \cdot 10^{-35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.3 \cdot 10^{-256}:\\ \;\;\;\;\frac{-1}{B} - t_0\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-132}:\\ \;\;\;\;\left(B \cdot \left(\frac{F}{t_1} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot t_1}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{+239}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))) (t_1 (+ F (/ 1.0 F))))
   (if (<= F -8.5e-35)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -3.3e-256)
       (- (/ -1.0 B) t_0)
       (if (<= F 5.1e-132)
         (-
          (-
           (*
            B
            (+ (* (/ F t_1) -0.16666666666666666) (* x 0.3333333333333333)))
           (/ F (* B t_1)))
          (/ x B))
         (if (<= F 2.4e+239)
           (- (/ 1.0 B) t_0)
           (- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = F + (1.0 / F);
	double tmp;
	if (F <= -8.5e-35) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -3.3e-256) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= 5.1e-132) {
		tmp = ((B * (((F / t_1) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_1))) - (x / B);
	} else if (F <= 2.4e+239) {
		tmp = (1.0 / B) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = f + (1.0d0 / f)
    if (f <= (-8.5d-35)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-3.3d-256)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= 5.1d-132) then
        tmp = ((b * (((f / t_1) * (-0.16666666666666666d0)) + (x * 0.3333333333333333d0))) - (f / (b * t_1))) - (x / b)
    else if (f <= 2.4d+239) then
        tmp = (1.0d0 / b) - t_0
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double t_1 = F + (1.0 / F);
	double tmp;
	if (F <= -8.5e-35) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -3.3e-256) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= 5.1e-132) {
		tmp = ((B * (((F / t_1) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_1))) - (x / B);
	} else if (F <= 2.4e+239) {
		tmp = (1.0 / B) - t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = F + (1.0 / F)
	tmp = 0
	if F <= -8.5e-35:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -3.3e-256:
		tmp = (-1.0 / B) - t_0
	elif F <= 5.1e-132:
		tmp = ((B * (((F / t_1) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_1))) - (x / B)
	elif F <= 2.4e+239:
		tmp = (1.0 / B) - t_0
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(F + Float64(1.0 / F))
	tmp = 0.0
	if (F <= -8.5e-35)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -3.3e-256)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= 5.1e-132)
		tmp = Float64(Float64(Float64(B * Float64(Float64(Float64(F / t_1) * -0.16666666666666666) + Float64(x * 0.3333333333333333))) - Float64(F / Float64(B * t_1))) - Float64(x / B));
	elseif (F <= 2.4e+239)
		tmp = Float64(Float64(1.0 / B) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	t_1 = F + (1.0 / F);
	tmp = 0.0;
	if (F <= -8.5e-35)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -3.3e-256)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= 5.1e-132)
		tmp = ((B * (((F / t_1) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_1))) - (x / B);
	elseif (F <= 2.4e+239)
		tmp = (1.0 / B) - t_0;
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.5e-35], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.3e-256], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.1e-132], N[(N[(N[(B * N[(N[(N[(F / t$95$1), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(F / N[(B * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e+239], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := F + \frac{1}{F}\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -3.3 \cdot 10^{-256}:\\
\;\;\;\;\frac{-1}{B} - t_0\\

\mathbf{elif}\;F \leq 5.1 \cdot 10^{-132}:\\
\;\;\;\;\left(B \cdot \left(\frac{F}{t_1} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot t_1}\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{+239}:\\
\;\;\;\;\frac{1}{B} - t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -8.5000000000000001e-35

    1. Initial program 53.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 97.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -8.5000000000000001e-35 < F < -3.3e-256

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.6%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.6%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow299.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef99.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 43.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 54.3%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]

    if -3.3e-256 < F < 5.10000000000000005e-132

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.3%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.3%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 99.8%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow299.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef99.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u89.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-udef75.1%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. associate-*r/75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. sqrt-div75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr75.1%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. expm1-def89.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p99.8%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    10. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around -inf 83.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg83.7%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    13. Simplified83.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right) - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    14. Taylor expanded in B around 0 62.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{F}{\left(F + \frac{1}{F}\right) \cdot B} + \left(-0.16666666666666666 \cdot \frac{F}{F + \frac{1}{F}} + 0.3333333333333333 \cdot x\right) \cdot B\right) - \frac{x}{B}} \]

    if 5.10000000000000005e-132 < F < 2.4e239

    1. Initial program 85.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative85.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg85.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/93.2%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/93.0%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative93.0%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified93.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 77.4%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative77.4%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*77.5%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified77.5%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 64.0%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]

    if 2.4e239 < F

    1. Initial program 11.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 1.4%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. *-commutative1.4%

        \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \color{blue}{\left(x \cdot B\right)}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Simplified1.4%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Taylor expanded in F around inf 65.5%

      \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Taylor expanded in B around 0 90.2%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification68.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.3 \cdot 10^{-256}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-132}:\\ \;\;\;\;\left(B \cdot \left(\frac{F}{F + \frac{1}{F}} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot \left(F + \frac{1}{F}\right)}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{+239}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 15: 61.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := F + \frac{1}{F}\\ \mathbf{if}\;F \leq -8.5 \cdot 10^{-35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4 \cdot 10^{-256}:\\ \;\;\;\;\frac{-1}{B} - t_0\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-132}:\\ \;\;\;\;\left(B \cdot \left(\frac{F}{t_1} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot t_1}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))) (t_1 (+ F (/ 1.0 F))))
   (if (<= F -8.5e-35)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -4e-256)
       (- (/ -1.0 B) t_0)
       (if (<= F 7.5e-132)
         (-
          (-
           (*
            B
            (+ (* (/ F t_1) -0.16666666666666666) (* x 0.3333333333333333)))
           (/ F (* B t_1)))
          (/ x B))
         (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = F + (1.0 / F);
	double tmp;
	if (F <= -8.5e-35) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -4e-256) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= 7.5e-132) {
		tmp = ((B * (((F / t_1) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_1))) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = f + (1.0d0 / f)
    if (f <= (-8.5d-35)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-4d-256)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= 7.5d-132) then
        tmp = ((b * (((f / t_1) * (-0.16666666666666666d0)) + (x * 0.3333333333333333d0))) - (f / (b * t_1))) - (x / b)
    else
        tmp = (1.0d0 / b) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double t_1 = F + (1.0 / F);
	double tmp;
	if (F <= -8.5e-35) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -4e-256) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= 7.5e-132) {
		tmp = ((B * (((F / t_1) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_1))) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = F + (1.0 / F)
	tmp = 0
	if F <= -8.5e-35:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -4e-256:
		tmp = (-1.0 / B) - t_0
	elif F <= 7.5e-132:
		tmp = ((B * (((F / t_1) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_1))) - (x / B)
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(F + Float64(1.0 / F))
	tmp = 0.0
	if (F <= -8.5e-35)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -4e-256)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= 7.5e-132)
		tmp = Float64(Float64(Float64(B * Float64(Float64(Float64(F / t_1) * -0.16666666666666666) + Float64(x * 0.3333333333333333))) - Float64(F / Float64(B * t_1))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	t_1 = F + (1.0 / F);
	tmp = 0.0;
	if (F <= -8.5e-35)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -4e-256)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= 7.5e-132)
		tmp = ((B * (((F / t_1) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_1))) - (x / B);
	else
		tmp = (1.0 / B) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.5e-35], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4e-256], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.5e-132], N[(N[(N[(B * N[(N[(N[(F / t$95$1), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(F / N[(B * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := F + \frac{1}{F}\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -4 \cdot 10^{-256}:\\
\;\;\;\;\frac{-1}{B} - t_0\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{-132}:\\
\;\;\;\;\left(B \cdot \left(\frac{F}{t_1} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot t_1}\right) - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -8.5000000000000001e-35

    1. Initial program 53.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 97.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 77.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -8.5000000000000001e-35 < F < -3.99999999999999991e-256

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.6%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.6%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow299.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef99.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 43.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 54.3%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]

    if -3.99999999999999991e-256 < F < 7.49999999999999989e-132

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.3%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.3%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 99.8%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow299.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef99.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u89.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-udef75.1%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. associate-*r/75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. sqrt-div75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr75.1%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. expm1-def89.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p99.8%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    10. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around -inf 83.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg83.7%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    13. Simplified83.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right) - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    14. Taylor expanded in B around 0 62.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{F}{\left(F + \frac{1}{F}\right) \cdot B} + \left(-0.16666666666666666 \cdot \frac{F}{F + \frac{1}{F}} + 0.3333333333333333 \cdot x\right) \cdot B\right) - \frac{x}{B}} \]

    if 7.49999999999999989e-132 < F

    1. Initial program 69.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/78.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/78.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative78.2%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified78.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 82.1%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative82.1%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*82.2%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified82.2%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 62.9%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification66.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4 \cdot 10^{-256}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-132}:\\ \;\;\;\;\left(B \cdot \left(\frac{F}{F + \frac{1}{F}} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot \left(F + \frac{1}{F}\right)}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 16: 60.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := F + \frac{1}{F}\\ \mathbf{if}\;B \leq -0.005 \lor \neg \left(B \leq 31\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(B \cdot \left(\frac{F}{t_0} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot t_0}\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (+ F (/ 1.0 F))))
   (if (or (<= B -0.005) (not (<= B 31.0)))
     (- (/ -1.0 B) (/ x (tan B)))
     (-
      (-
       (* B (+ (* (/ F t_0) -0.16666666666666666) (* x 0.3333333333333333)))
       (/ F (* B t_0)))
      (/ x B)))))
double code(double F, double B, double x) {
	double t_0 = F + (1.0 / F);
	double tmp;
	if ((B <= -0.005) || !(B <= 31.0)) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else {
		tmp = ((B * (((F / t_0) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_0))) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = f + (1.0d0 / f)
    if ((b <= (-0.005d0)) .or. (.not. (b <= 31.0d0))) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else
        tmp = ((b * (((f / t_0) * (-0.16666666666666666d0)) + (x * 0.3333333333333333d0))) - (f / (b * t_0))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = F + (1.0 / F);
	double tmp;
	if ((B <= -0.005) || !(B <= 31.0)) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = ((B * (((F / t_0) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_0))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = F + (1.0 / F)
	tmp = 0
	if (B <= -0.005) or not (B <= 31.0):
		tmp = (-1.0 / B) - (x / math.tan(B))
	else:
		tmp = ((B * (((F / t_0) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_0))) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(F + Float64(1.0 / F))
	tmp = 0.0
	if ((B <= -0.005) || !(B <= 31.0))
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(Float64(B * Float64(Float64(Float64(F / t_0) * -0.16666666666666666) + Float64(x * 0.3333333333333333))) - Float64(F / Float64(B * t_0))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = F + (1.0 / F);
	tmp = 0.0;
	if ((B <= -0.005) || ~((B <= 31.0)))
		tmp = (-1.0 / B) - (x / tan(B));
	else
		tmp = ((B * (((F / t_0) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_0))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[B, -0.005], N[Not[LessEqual[B, 31.0]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(B * N[(N[(N[(F / t$95$0), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(F / N[(B * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := F + \frac{1}{F}\\
\mathbf{if}\;B \leq -0.005 \lor \neg \left(B \leq 31\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\left(B \cdot \left(\frac{F}{t_0} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot t_0}\right) - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < -0.0050000000000000001 or 31 < B

    1. Initial program 81.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative81.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg81.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/81.2%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/81.1%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative81.1%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified81.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 81.3%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/81.3%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity81.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow281.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef81.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified81.3%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 53.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 43.1%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]

    if -0.0050000000000000001 < B < 31

    1. Initial program 67.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative67.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg67.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/84.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/84.3%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative84.3%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified84.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 84.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/84.5%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity84.5%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow284.5%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef84.5%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified84.5%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u55.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-udef52.1%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. associate-*r/52.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. sqrt-div52.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval52.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv52.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr52.1%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. expm1-def55.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p84.6%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    10. Simplified84.6%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around -inf 75.5%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg75.5%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    13. Simplified75.5%

      \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right) - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    14. Taylor expanded in B around 0 75.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{F}{\left(F + \frac{1}{F}\right) \cdot B} + \left(-0.16666666666666666 \cdot \frac{F}{F + \frac{1}{F}} + 0.3333333333333333 \cdot x\right) \cdot B\right) - \frac{x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -0.005 \lor \neg \left(B \leq 31\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(B \cdot \left(\frac{F}{F + \frac{1}{F}} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot \left(F + \frac{1}{F}\right)}\right) - \frac{x}{B}\\ \end{array} \]

Alternative 17: 60.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := F + \frac{1}{F}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.8 \cdot 10^{-256}:\\ \;\;\;\;\frac{-1}{B} - t_1\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-132}:\\ \;\;\;\;\left(B \cdot \left(\frac{F}{t_0} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot t_0}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (+ F (/ 1.0 F))) (t_1 (/ x (tan B))))
   (if (<= F -2.8e-256)
     (- (/ -1.0 B) t_1)
     (if (<= F 5.1e-132)
       (-
        (-
         (* B (+ (* (/ F t_0) -0.16666666666666666) (* x 0.3333333333333333)))
         (/ F (* B t_0)))
        (/ x B))
       (- (/ 1.0 B) t_1)))))
double code(double F, double B, double x) {
	double t_0 = F + (1.0 / F);
	double t_1 = x / tan(B);
	double tmp;
	if (F <= -2.8e-256) {
		tmp = (-1.0 / B) - t_1;
	} else if (F <= 5.1e-132) {
		tmp = ((B * (((F / t_0) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_0))) - (x / B);
	} else {
		tmp = (1.0 / B) - t_1;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = f + (1.0d0 / f)
    t_1 = x / tan(b)
    if (f <= (-2.8d-256)) then
        tmp = ((-1.0d0) / b) - t_1
    else if (f <= 5.1d-132) then
        tmp = ((b * (((f / t_0) * (-0.16666666666666666d0)) + (x * 0.3333333333333333d0))) - (f / (b * t_0))) - (x / b)
    else
        tmp = (1.0d0 / b) - t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = F + (1.0 / F);
	double t_1 = x / Math.tan(B);
	double tmp;
	if (F <= -2.8e-256) {
		tmp = (-1.0 / B) - t_1;
	} else if (F <= 5.1e-132) {
		tmp = ((B * (((F / t_0) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_0))) - (x / B);
	} else {
		tmp = (1.0 / B) - t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = F + (1.0 / F)
	t_1 = x / math.tan(B)
	tmp = 0
	if F <= -2.8e-256:
		tmp = (-1.0 / B) - t_1
	elif F <= 5.1e-132:
		tmp = ((B * (((F / t_0) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_0))) - (x / B)
	else:
		tmp = (1.0 / B) - t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(F + Float64(1.0 / F))
	t_1 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -2.8e-256)
		tmp = Float64(Float64(-1.0 / B) - t_1);
	elseif (F <= 5.1e-132)
		tmp = Float64(Float64(Float64(B * Float64(Float64(Float64(F / t_0) * -0.16666666666666666) + Float64(x * 0.3333333333333333))) - Float64(F / Float64(B * t_0))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - t_1);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = F + (1.0 / F);
	t_1 = x / tan(B);
	tmp = 0.0;
	if (F <= -2.8e-256)
		tmp = (-1.0 / B) - t_1;
	elseif (F <= 5.1e-132)
		tmp = ((B * (((F / t_0) * -0.16666666666666666) + (x * 0.3333333333333333))) - (F / (B * t_0))) - (x / B);
	else
		tmp = (1.0 / B) - t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.8e-256], N[(N[(-1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 5.1e-132], N[(N[(N[(B * N[(N[(N[(F / t$95$0), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(F / N[(B * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := F + \frac{1}{F}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.8 \cdot 10^{-256}:\\
\;\;\;\;\frac{-1}{B} - t_1\\

\mathbf{elif}\;F \leq 5.1 \cdot 10^{-132}:\\
\;\;\;\;\left(B \cdot \left(\frac{F}{t_0} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot t_0}\right) - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.80000000000000023e-256

    1. Initial program 66.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative66.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg66.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/79.7%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/79.6%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative79.6%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified79.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 79.7%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/79.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity79.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow279.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef79.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified79.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 82.2%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 66.0%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]

    if -2.80000000000000023e-256 < F < 5.10000000000000005e-132

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.3%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.3%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 99.8%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow299.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef99.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u89.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-udef75.1%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. associate-*r/75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. sqrt-div75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv75.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr75.1%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. expm1-def89.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p99.8%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    10. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around -inf 83.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg83.7%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    13. Simplified83.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right) - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    14. Taylor expanded in B around 0 62.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{F}{\left(F + \frac{1}{F}\right) \cdot B} + \left(-0.16666666666666666 \cdot \frac{F}{F + \frac{1}{F}} + 0.3333333333333333 \cdot x\right) \cdot B\right) - \frac{x}{B}} \]

    if 5.10000000000000005e-132 < F

    1. Initial program 69.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/78.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/78.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative78.2%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified78.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 82.1%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative82.1%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*82.2%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified82.2%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 62.9%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{-256}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-132}:\\ \;\;\;\;\left(B \cdot \left(\frac{F}{F + \frac{1}{F}} \cdot -0.16666666666666666 + x \cdot 0.3333333333333333\right) - \frac{F}{B \cdot \left(F + \frac{1}{F}\right)}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 18: 44.4% accurate, 21.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-127}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.15e-86)
   (/ (- -1.0 x) B)
   (if (<= F 1.25e-127)
     (/ (- x) B)
     (+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.15e-86) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.25e-127) {
		tmp = -x / B;
	} else {
		tmp = (0.3333333333333333 * (B * x)) + ((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.15d-86)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.25d-127) then
        tmp = -x / b
    else
        tmp = (0.3333333333333333d0 * (b * x)) + ((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.15e-86) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.25e-127) {
		tmp = -x / B;
	} else {
		tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.15e-86:
		tmp = (-1.0 - x) / B
	elif F <= 1.25e-127:
		tmp = -x / B
	else:
		tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.15e-86)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.25e-127)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.15e-86)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.25e-127)
		tmp = -x / B;
	else
		tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.15e-86], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.25e-127], N[((-x) / B), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.15 \cdot 10^{-86}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.25 \cdot 10^{-127}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.14999999999999998e-86

    1. Initial program 56.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 92.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 48.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/48.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in48.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval48.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-148.5%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified48.5%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -1.14999999999999998e-86 < F < 1.2499999999999999e-127

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.4%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.4%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 24.4%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative24.4%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*24.4%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified24.4%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 30.7%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 55.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. Step-by-step derivation
      1. mul-1-neg55.1%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac55.1%

        \[\leadsto \color{blue}{\frac{-x}{B}} \]
    10. Simplified55.1%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.2499999999999999e-127 < F

    1. Initial program 69.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/78.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/78.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative78.2%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified78.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 82.1%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative82.1%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*82.2%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified82.2%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 62.9%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 44.4%

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
    9. Step-by-step derivation
      1. associate--l+44.4%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. div-sub44.4%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\frac{1 - x}{B}} \]
    10. Simplified44.4%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-127}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 19: 44.6% accurate, 23.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 7.2 \cdot 10^{-129}:\\ \;\;\;\;\frac{\frac{-F}{F + \frac{1}{F}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 7.2e-129)
   (/ (- (/ (- F) (+ F (/ 1.0 F))) x) B)
   (+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 7.2e-129) {
		tmp = ((-F / (F + (1.0 / F))) - x) / B;
	} else {
		tmp = (0.3333333333333333 * (B * x)) + ((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 <= 7.2d-129) then
        tmp = ((-f / (f + (1.0d0 / f))) - x) / b
    else
        tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 7.2e-129) {
		tmp = ((-F / (F + (1.0 / F))) - x) / B;
	} else {
		tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 7.2e-129:
		tmp = ((-F / (F + (1.0 / F))) - x) / B
	else:
		tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 7.2e-129)
		tmp = Float64(Float64(Float64(Float64(-F) / Float64(F + Float64(1.0 / F))) - x) / B);
	else
		tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 7.2e-129)
		tmp = ((-F / (F + (1.0 / F))) - x) / B;
	else
		tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 7.2e-129], N[(N[(N[((-F) / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 7.2 \cdot 10^{-129}:\\
\;\;\;\;\frac{\frac{-F}{F + \frac{1}{F}} - x}{B}\\

\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 7.2e-129

    1. Initial program 76.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. +-commutative76.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg76.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/85.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/85.4%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative85.4%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified85.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in x around 0 85.7%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/85.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity85.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      3. unpow285.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      4. fma-udef85.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified85.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. expm1-log1p-u66.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-udef57.5%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. associate-*r/57.5%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. sqrt-div57.5%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. metadata-eval57.5%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. un-div-inv57.5%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}\right)} - 1\right) - \frac{x}{\tan B} \]
    8. Applied egg-rr57.5%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. expm1-def66.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\right)\right)} - \frac{x}{\tan B} \]
      2. expm1-log1p85.7%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    10. Simplified85.7%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around -inf 87.9%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. mul-1-neg87.9%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    13. Simplified87.9%

      \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right) - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    14. Taylor expanded in B around 0 51.5%

      \[\leadsto \color{blue}{\frac{-1 \cdot \frac{F}{F + \frac{1}{F}} - x}{B}} \]
    15. Step-by-step derivation
      1. mul-1-neg51.5%

        \[\leadsto \frac{\color{blue}{\left(-\frac{F}{F + \frac{1}{F}}\right)} - x}{B} \]
      2. distribute-neg-frac51.5%

        \[\leadsto \frac{\color{blue}{\frac{-F}{F + \frac{1}{F}}} - x}{B} \]
    16. Simplified51.5%

      \[\leadsto \color{blue}{\frac{\frac{-F}{F + \frac{1}{F}} - x}{B}} \]

    if 7.2e-129 < F

    1. Initial program 69.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/78.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/78.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative78.2%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified78.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 82.1%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative82.1%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*82.2%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified82.2%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 62.9%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 44.4%

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
    9. Step-by-step derivation
      1. associate--l+44.4%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. div-sub44.4%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\frac{1 - x}{B}} \]
    10. Simplified44.4%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 7.2 \cdot 10^{-129}:\\ \;\;\;\;\frac{\frac{-F}{F + \frac{1}{F}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 20: 44.2% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-127}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.15e-86)
   (/ (- -1.0 x) B)
   (if (<= F 1.1e-127) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.15e-86) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.1e-127) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.15d-86)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.1d-127) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.15e-86) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.1e-127) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.15e-86:
		tmp = (-1.0 - x) / B
	elif F <= 1.1e-127:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.15e-86)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.1e-127)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.15e-86)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.1e-127)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.15e-86], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.1e-127], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.15 \cdot 10^{-86}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{-127}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.14999999999999998e-86

    1. Initial program 56.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 92.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 48.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/48.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in48.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval48.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-148.5%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified48.5%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -1.14999999999999998e-86 < F < 1.1000000000000001e-127

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.4%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.4%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 24.4%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative24.4%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*24.4%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified24.4%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 30.7%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 55.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. Step-by-step derivation
      1. mul-1-neg55.1%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac55.1%

        \[\leadsto \color{blue}{\frac{-x}{B}} \]
    10. Simplified55.1%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.1000000000000001e-127 < F

    1. Initial program 69.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/78.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/78.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative78.2%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified78.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 82.1%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative82.1%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*82.2%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified82.2%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 43.3%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-127}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 21: 36.7% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 9.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 9.8e-129) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 9.8e-129) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= 9.8d-129) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 9.8e-129) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 9.8e-129:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 9.8e-129)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 9.8e-129)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 9.8e-129], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 9.8 \cdot 10^{-129}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 9.80000000000000004e-129

    1. Initial program 76.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. +-commutative76.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg76.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/85.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/85.4%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative85.4%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified85.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 34.0%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative34.0%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*34.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified34.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 26.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 38.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. Step-by-step derivation
      1. mul-1-neg38.5%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac38.5%

        \[\leadsto \color{blue}{\frac{-x}{B}} \]
    10. Simplified38.5%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 9.80000000000000004e-129 < F

    1. Initial program 69.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg69.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/78.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/78.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative78.2%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified78.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 82.1%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative82.1%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*82.2%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified82.2%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 43.3%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 9.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 22: 29.5% accurate, 53.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.35 \cdot 10^{+252}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 1.35e+252) (/ (- x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 1.35e+252) {
		tmp = -x / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= 1.35d+252) then
        tmp = -x / b
    else
        tmp = 1.0d0 / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 1.35e+252) {
		tmp = -x / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 1.35e+252:
		tmp = -x / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 1.35e+252)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 1.35e+252)
		tmp = -x / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 1.35e+252], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.35 \cdot 10^{+252}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.35000000000000005e252

    1. Initial program 78.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative78.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg78.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/87.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/87.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative87.2%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified87.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 48.2%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative48.2%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*48.3%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified48.3%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 31.6%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 34.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. Step-by-step derivation
      1. mul-1-neg34.5%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac34.5%

        \[\leadsto \color{blue}{\frac{-x}{B}} \]
    10. Simplified34.5%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.35000000000000005e252 < F

    1. Initial program 13.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative13.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg13.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/21.0%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/21.0%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative21.0%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified21.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around inf 99.6%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*99.5%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.5%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 50.9%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around 0 45.4%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification35.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.35 \cdot 10^{+252}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]

Alternative 23: 10.5% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
	return 1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
	return 1.0 / B;
}
def code(F, B, x):
	return 1.0 / B
function code(F, B, x)
	return Float64(1.0 / B)
end
function tmp = code(F, B, x)
	tmp = 1.0 / B;
end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{B}
\end{array}
Derivation
  1. Initial program 73.9%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Step-by-step derivation
    1. +-commutative73.9%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
    2. unsub-neg73.9%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. associate-*l/82.9%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
    4. associate-*r/82.8%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
    5. *-commutative82.8%

      \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
  3. Simplified82.9%

    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
  4. Taylor expanded in F around inf 51.7%

    \[\leadsto F \cdot \color{blue}{\frac{1}{\sin B \cdot F}} - \frac{x}{\tan B} \]
  5. Step-by-step derivation
    1. *-commutative51.7%

      \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    2. associate-/r*51.7%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
  6. Simplified51.7%

    \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
  7. Taylor expanded in B around 0 32.8%

    \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  8. Taylor expanded in x around 0 10.1%

    \[\leadsto \color{blue}{\frac{1}{B}} \]
  9. Final simplification10.1%

    \[\leadsto \frac{1}{B} \]

Reproduce

?
herbie shell --seed 2023255 
(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))))))