VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.4% → 99.6%
Time: 28.2s
Alternatives: 21
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 21 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.4% 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 -5 \cdot 10^{+22}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -5e+22)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 200000000.0)
       (- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) t_0)
       (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -5e+22) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 200000000.0) {
		tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_0;
	} else {
		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -5e+22)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 200000000.0)
		tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0);
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 200000000.0], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\

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


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

    1. Initial program 54.2%

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

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

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

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

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

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

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

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

      \[\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.9999999999999996e22 < F < 2e8

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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} \]

    if 2e8 < F

    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. Add Preprocessing
    3. Taylor expanded in F around inf 99.8%

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

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

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

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

\mathbf{elif}\;F \leq 100000000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\

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


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

    1. Initial program 54.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified72.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 72.5%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified72.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 -2e18 < F < 1e11

    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. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. associate-*r/99.6%

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

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

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

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

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

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

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

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

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

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

    if 1e11 < F

    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. Add Preprocessing
    3. Taylor expanded in F around inf 99.8%

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

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

Alternative 3: 99.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;F \leq 5 \cdot 10^{+126}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\

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


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

    1. Initial program 37.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. Simplified59.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 59.8%

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

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

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

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

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

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

      \[\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 -9.99999999999999953e157 < F < 4.99999999999999977e126

    1. Initial program 98.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. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. associate-*r/99.6%

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

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

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

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

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

    if 4.99999999999999977e126 < F

    1. Initial program 28.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. Add Preprocessing
    3. Taylor expanded in F around inf 99.9%

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified72.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 72.5%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified72.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 -3e8 < F < 1.9e8

    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. Add Preprocessing

    if 1.9e8 < F

    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. Add Preprocessing
    3. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -300000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 190000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\

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


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

    1. Initial program 55.4%

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified72.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. associate-*r/72.9%

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

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

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

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

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

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

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

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

    if -0.92000000000000004 < F < 1.3999999999999999

    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. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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 98.9%

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

    if 1.3999999999999999 < F

    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. Add Preprocessing
    3. Taylor expanded in F around inf 99.8%

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

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

Alternative 6: 60.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ t_1 := \frac{F \cdot \sqrt{0.5} - x}{B}\\ t_2 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.7 \cdot 10^{+140}:\\ \;\;\;\;\frac{-1}{B} - t\_2\\ \mathbf{elif}\;F \leq -0.29:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.46 \cdot 10^{-90}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-204}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{+39}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left|t\_2 + \frac{-1}{B}\right|\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B)))
        (t_1 (/ (- (* F (sqrt 0.5)) x) B))
        (t_2 (/ x (tan B))))
   (if (<= F -1.7e+140)
     (- (/ -1.0 B) t_2)
     (if (<= F -0.29)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -1.46e-90)
         t_1
         (if (<= F 1.2e-204)
           t_0
           (if (<= F 9.5e-20)
             t_1
             (if (<= F 1.95e+39) t_0 (fabs (+ t_2 (/ -1.0 B)))))))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double t_1 = ((F * sqrt(0.5)) - x) / B;
	double t_2 = x / tan(B);
	double tmp;
	if (F <= -1.7e+140) {
		tmp = (-1.0 / B) - t_2;
	} else if (F <= -0.29) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.46e-90) {
		tmp = t_1;
	} else if (F <= 1.2e-204) {
		tmp = t_0;
	} else if (F <= 9.5e-20) {
		tmp = t_1;
	} else if (F <= 1.95e+39) {
		tmp = t_0;
	} else {
		tmp = fabs((t_2 + (-1.0 / B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = -x / tan(b)
    t_1 = ((f * sqrt(0.5d0)) - x) / b
    t_2 = x / tan(b)
    if (f <= (-1.7d+140)) then
        tmp = ((-1.0d0) / b) - t_2
    else if (f <= (-0.29d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.46d-90)) then
        tmp = t_1
    else if (f <= 1.2d-204) then
        tmp = t_0
    else if (f <= 9.5d-20) then
        tmp = t_1
    else if (f <= 1.95d+39) then
        tmp = t_0
    else
        tmp = abs((t_2 + ((-1.0d0) / 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 * Math.sqrt(0.5)) - x) / B;
	double t_2 = x / Math.tan(B);
	double tmp;
	if (F <= -1.7e+140) {
		tmp = (-1.0 / B) - t_2;
	} else if (F <= -0.29) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.46e-90) {
		tmp = t_1;
	} else if (F <= 1.2e-204) {
		tmp = t_0;
	} else if (F <= 9.5e-20) {
		tmp = t_1;
	} else if (F <= 1.95e+39) {
		tmp = t_0;
	} else {
		tmp = Math.abs((t_2 + (-1.0 / B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / math.tan(B)
	t_1 = ((F * math.sqrt(0.5)) - x) / B
	t_2 = x / math.tan(B)
	tmp = 0
	if F <= -1.7e+140:
		tmp = (-1.0 / B) - t_2
	elif F <= -0.29:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.46e-90:
		tmp = t_1
	elif F <= 1.2e-204:
		tmp = t_0
	elif F <= 9.5e-20:
		tmp = t_1
	elif F <= 1.95e+39:
		tmp = t_0
	else:
		tmp = math.fabs((t_2 + (-1.0 / B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	t_1 = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B)
	t_2 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.7e+140)
		tmp = Float64(Float64(-1.0 / B) - t_2);
	elseif (F <= -0.29)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.46e-90)
		tmp = t_1;
	elseif (F <= 1.2e-204)
		tmp = t_0;
	elseif (F <= 9.5e-20)
		tmp = t_1;
	elseif (F <= 1.95e+39)
		tmp = t_0;
	else
		tmp = abs(Float64(t_2 + Float64(-1.0 / B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / tan(B);
	t_1 = ((F * sqrt(0.5)) - x) / B;
	t_2 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.7e+140)
		tmp = (-1.0 / B) - t_2;
	elseif (F <= -0.29)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.46e-90)
		tmp = t_1;
	elseif (F <= 1.2e-204)
		tmp = t_0;
	elseif (F <= 9.5e-20)
		tmp = t_1;
	elseif (F <= 1.95e+39)
		tmp = t_0;
	else
		tmp = abs((t_2 + (-1.0 / B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.7e+140], N[(N[(-1.0 / B), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, -0.29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.46e-90], t$95$1, If[LessEqual[F, 1.2e-204], t$95$0, If[LessEqual[F, 9.5e-20], t$95$1, If[LessEqual[F, 1.95e+39], t$95$0, N[Abs[N[(t$95$2 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \frac{F \cdot \sqrt{0.5} - x}{B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.7 \cdot 10^{+140}:\\
\;\;\;\;\frac{-1}{B} - t\_2\\

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

\mathbf{elif}\;F \leq -1.46 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 1.2 \cdot 10^{-204}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 9.5 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 1.95 \cdot 10^{+39}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\left|t\_2 + \frac{-1}{B}\right|\\


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

    1. Initial program 38.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. Add Preprocessing
    3. Taylor expanded in F around -inf 59.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{-1}{F} - \frac{x}{\tan B}} \]
      4. *-commutative45.9%

        \[\leadsto \color{blue}{\frac{-1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      5. frac-2neg45.9%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot F}{\left(-F\right) \cdot B}} - \frac{x}{\tan B} \]
      8. *-un-lft-identity86.6%

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

      \[\leadsto \color{blue}{\frac{F}{\left(-F\right) \cdot B} - \frac{x}{\tan B}} \]
    7. Step-by-step derivation
      1. associate-/r*86.6%

        \[\leadsto \color{blue}{\frac{\frac{F}{-F}}{B}} - \frac{x}{\tan B} \]
      2. neg-mul-186.6%

        \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F}}}{B} - \frac{x}{\tan B} \]
      3. *-commutative86.6%

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

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

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

        \[\leadsto \frac{\frac{F}{F} \cdot \color{blue}{-1}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval86.6%

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

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

        \[\leadsto \frac{\frac{F \cdot -1}{\color{blue}{F}}}{B} - \frac{x}{\tan B} \]
      10. *-commutative86.6%

        \[\leadsto \frac{\frac{\color{blue}{-1 \cdot F}}{F}}{B} - \frac{x}{\tan B} \]
      11. neg-mul-186.6%

        \[\leadsto \frac{\frac{\color{blue}{-F}}{F}}{B} - \frac{x}{\tan B} \]
      12. *-rgt-identity86.6%

        \[\leadsto \frac{\frac{\color{blue}{\left(-F\right) \cdot 1}}{F}}{B} - \frac{x}{\tan B} \]
      13. *-rgt-identity86.6%

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

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{F \cdot \color{blue}{\left(--1\right)}}}{B} - \frac{x}{\tan B} \]
      15. distribute-rgt-neg-in86.6%

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{-F \cdot -1}}}{B} - \frac{x}{\tan B} \]
      16. distribute-lft-neg-in86.6%

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{\left(-F\right) \cdot -1}}}{B} - \frac{x}{\tan B} \]
      17. times-frac86.6%

        \[\leadsto \frac{\color{blue}{\frac{-F}{-F} \cdot \frac{1}{-1}}}{B} - \frac{x}{\tan B} \]
      18. *-inverses86.6%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{1}{-1}}{B} - \frac{x}{\tan B} \]
      19. metadata-eval86.6%

        \[\leadsto \frac{1 \cdot \color{blue}{-1}}{B} - \frac{x}{\tan B} \]
      20. metadata-eval86.6%

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

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

    if -1.7e140 < F < -0.28999999999999998

    1. Initial program 91.7%

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

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

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

    if -0.28999999999999998 < F < -1.46000000000000004e-90 or 1.2e-204 < F < 9.5e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 63.3%

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

    if -1.46000000000000004e-90 < F < 1.2e-204 or 9.5e-20 < F < 1.95e39

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 37.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    6. Simplified77.4%

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot77.5%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      2. *-un-lft-identity77.5%

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

        \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    8. Applied egg-rr77.5%

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

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

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

    if 1.95e39 < F

    1. Initial program 47.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. Add Preprocessing
    3. Taylor expanded in F around -inf 28.6%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt9.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\left|\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, \frac{x}{\tan B}\right)\right|} \]
      3. fma-undefine14.1%

        \[\leadsto \left|\color{blue}{\frac{F}{B} \cdot \frac{-1}{F} + \frac{x}{\tan B}}\right| \]
      4. times-frac26.1%

        \[\leadsto \left|\color{blue}{\frac{F \cdot -1}{B \cdot F}} + \frac{x}{\tan B}\right| \]
      5. *-commutative26.1%

        \[\leadsto \left|\frac{\color{blue}{-1 \cdot F}}{B \cdot F} + \frac{x}{\tan B}\right| \]
      6. neg-mul-126.1%

        \[\leadsto \left|\frac{\color{blue}{-F}}{B \cdot F} + \frac{x}{\tan B}\right| \]
      7. *-commutative26.1%

        \[\leadsto \left|\frac{-F}{\color{blue}{F \cdot B}} + \frac{x}{\tan B}\right| \]
      8. associate-/r*26.2%

        \[\leadsto \left|\color{blue}{\frac{\frac{-F}{F}}{B}} + \frac{x}{\tan B}\right| \]
      9. *-rgt-identity26.2%

        \[\leadsto \left|\frac{\frac{\color{blue}{\left(-F\right) \cdot 1}}{F}}{B} + \frac{x}{\tan B}\right| \]
      10. *-rgt-identity26.2%

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

        \[\leadsto \left|\frac{\frac{\left(-F\right) \cdot 1}{F \cdot \color{blue}{\left(--1\right)}}}{B} + \frac{x}{\tan B}\right| \]
      12. distribute-rgt-neg-in26.2%

        \[\leadsto \left|\frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{-F \cdot -1}}}{B} + \frac{x}{\tan B}\right| \]
      13. distribute-lft-neg-in26.2%

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

        \[\leadsto \left|\frac{\color{blue}{\frac{-F}{-F} \cdot \frac{1}{-1}}}{B} + \frac{x}{\tan B}\right| \]
      15. *-inverses26.2%

        \[\leadsto \left|\frac{\color{blue}{1} \cdot \frac{1}{-1}}{B} + \frac{x}{\tan B}\right| \]
      16. metadata-eval26.2%

        \[\leadsto \left|\frac{1 \cdot \color{blue}{-1}}{B} + \frac{x}{\tan B}\right| \]
      17. metadata-eval26.2%

        \[\leadsto \left|\frac{\color{blue}{-1}}{B} + \frac{x}{\tan B}\right| \]
    8. Simplified26.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{+140}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.29:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.46 \cdot 10^{-90}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-204}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{+39}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{\tan B} + \frac{-1}{B}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 67.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F \cdot \sqrt{0.5} - x}{B}\\ t_1 := \frac{-x}{\tan B}\\ t_2 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.9 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_2\\ \mathbf{elif}\;F \leq -1.85 \cdot 10^{-90}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-204}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 10^{-19}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{+42}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left|t\_2 + \frac{-1}{B}\right|\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- (* F (sqrt 0.5)) x) B))
        (t_1 (/ (- x) (tan B)))
        (t_2 (/ x (tan B))))
   (if (<= F -2.9e-9)
     (- (/ -1.0 (sin B)) t_2)
     (if (<= F -1.85e-90)
       t_0
       (if (<= F 1.15e-204)
         t_1
         (if (<= F 1e-19)
           t_0
           (if (<= F 1.6e+42) t_1 (fabs (+ t_2 (/ -1.0 B))))))))))
double code(double F, double B, double x) {
	double t_0 = ((F * sqrt(0.5)) - x) / B;
	double t_1 = -x / tan(B);
	double t_2 = x / tan(B);
	double tmp;
	if (F <= -2.9e-9) {
		tmp = (-1.0 / sin(B)) - t_2;
	} else if (F <= -1.85e-90) {
		tmp = t_0;
	} else if (F <= 1.15e-204) {
		tmp = t_1;
	} else if (F <= 1e-19) {
		tmp = t_0;
	} else if (F <= 1.6e+42) {
		tmp = t_1;
	} else {
		tmp = fabs((t_2 + (-1.0 / B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = ((f * sqrt(0.5d0)) - x) / b
    t_1 = -x / tan(b)
    t_2 = x / tan(b)
    if (f <= (-2.9d-9)) then
        tmp = ((-1.0d0) / sin(b)) - t_2
    else if (f <= (-1.85d-90)) then
        tmp = t_0
    else if (f <= 1.15d-204) then
        tmp = t_1
    else if (f <= 1d-19) then
        tmp = t_0
    else if (f <= 1.6d+42) then
        tmp = t_1
    else
        tmp = abs((t_2 + ((-1.0d0) / b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = ((F * Math.sqrt(0.5)) - x) / B;
	double t_1 = -x / Math.tan(B);
	double t_2 = x / Math.tan(B);
	double tmp;
	if (F <= -2.9e-9) {
		tmp = (-1.0 / Math.sin(B)) - t_2;
	} else if (F <= -1.85e-90) {
		tmp = t_0;
	} else if (F <= 1.15e-204) {
		tmp = t_1;
	} else if (F <= 1e-19) {
		tmp = t_0;
	} else if (F <= 1.6e+42) {
		tmp = t_1;
	} else {
		tmp = Math.abs((t_2 + (-1.0 / B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = ((F * math.sqrt(0.5)) - x) / B
	t_1 = -x / math.tan(B)
	t_2 = x / math.tan(B)
	tmp = 0
	if F <= -2.9e-9:
		tmp = (-1.0 / math.sin(B)) - t_2
	elif F <= -1.85e-90:
		tmp = t_0
	elif F <= 1.15e-204:
		tmp = t_1
	elif F <= 1e-19:
		tmp = t_0
	elif F <= 1.6e+42:
		tmp = t_1
	else:
		tmp = math.fabs((t_2 + (-1.0 / B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B)
	t_1 = Float64(Float64(-x) / tan(B))
	t_2 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -2.9e-9)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_2);
	elseif (F <= -1.85e-90)
		tmp = t_0;
	elseif (F <= 1.15e-204)
		tmp = t_1;
	elseif (F <= 1e-19)
		tmp = t_0;
	elseif (F <= 1.6e+42)
		tmp = t_1;
	else
		tmp = abs(Float64(t_2 + Float64(-1.0 / B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = ((F * sqrt(0.5)) - x) / B;
	t_1 = -x / tan(B);
	t_2 = x / tan(B);
	tmp = 0.0;
	if (F <= -2.9e-9)
		tmp = (-1.0 / sin(B)) - t_2;
	elseif (F <= -1.85e-90)
		tmp = t_0;
	elseif (F <= 1.15e-204)
		tmp = t_1;
	elseif (F <= 1e-19)
		tmp = t_0;
	elseif (F <= 1.6e+42)
		tmp = t_1;
	else
		tmp = abs((t_2 + (-1.0 / B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.9e-9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, -1.85e-90], t$95$0, If[LessEqual[F, 1.15e-204], t$95$1, If[LessEqual[F, 1e-19], t$95$0, If[LessEqual[F, 1.6e+42], t$95$1, N[Abs[N[(t$95$2 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{0.5} - x}{B}\\
t_1 := \frac{-x}{\tan B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.9 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_2\\

\mathbf{elif}\;F \leq -1.85 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.15 \cdot 10^{-204}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.6 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left|t\_2 + \frac{-1}{B}\right|\\


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

    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. Simplified73.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 73.5%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified73.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.1%

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

    if -2.89999999999999991e-9 < F < -1.85000000000000009e-90 or 1.15e-204 < F < 9.9999999999999998e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 65.4%

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

    if -1.85000000000000009e-90 < F < 1.15e-204 or 9.9999999999999998e-20 < F < 1.60000000000000001e42

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 37.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    6. Simplified77.4%

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot77.5%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      2. *-un-lft-identity77.5%

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

        \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    8. Applied egg-rr77.5%

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

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

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

    if 1.60000000000000001e42 < F

    1. Initial program 47.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. Add Preprocessing
    3. Taylor expanded in F around -inf 28.6%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt9.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\left|\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, \frac{x}{\tan B}\right)\right|} \]
      3. fma-undefine14.1%

        \[\leadsto \left|\color{blue}{\frac{F}{B} \cdot \frac{-1}{F} + \frac{x}{\tan B}}\right| \]
      4. times-frac26.1%

        \[\leadsto \left|\color{blue}{\frac{F \cdot -1}{B \cdot F}} + \frac{x}{\tan B}\right| \]
      5. *-commutative26.1%

        \[\leadsto \left|\frac{\color{blue}{-1 \cdot F}}{B \cdot F} + \frac{x}{\tan B}\right| \]
      6. neg-mul-126.1%

        \[\leadsto \left|\frac{\color{blue}{-F}}{B \cdot F} + \frac{x}{\tan B}\right| \]
      7. *-commutative26.1%

        \[\leadsto \left|\frac{-F}{\color{blue}{F \cdot B}} + \frac{x}{\tan B}\right| \]
      8. associate-/r*26.2%

        \[\leadsto \left|\color{blue}{\frac{\frac{-F}{F}}{B}} + \frac{x}{\tan B}\right| \]
      9. *-rgt-identity26.2%

        \[\leadsto \left|\frac{\frac{\color{blue}{\left(-F\right) \cdot 1}}{F}}{B} + \frac{x}{\tan B}\right| \]
      10. *-rgt-identity26.2%

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

        \[\leadsto \left|\frac{\frac{\left(-F\right) \cdot 1}{F \cdot \color{blue}{\left(--1\right)}}}{B} + \frac{x}{\tan B}\right| \]
      12. distribute-rgt-neg-in26.2%

        \[\leadsto \left|\frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{-F \cdot -1}}}{B} + \frac{x}{\tan B}\right| \]
      13. distribute-lft-neg-in26.2%

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

        \[\leadsto \left|\frac{\color{blue}{\frac{-F}{-F} \cdot \frac{1}{-1}}}{B} + \frac{x}{\tan B}\right| \]
      15. *-inverses26.2%

        \[\leadsto \left|\frac{\color{blue}{1} \cdot \frac{1}{-1}}{B} + \frac{x}{\tan B}\right| \]
      16. metadata-eval26.2%

        \[\leadsto \left|\frac{1 \cdot \color{blue}{-1}}{B} + \frac{x}{\tan B}\right| \]
      17. metadata-eval26.2%

        \[\leadsto \left|\frac{\color{blue}{-1}}{B} + \frac{x}{\tan B}\right| \]
    8. Simplified26.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.85 \cdot 10^{-90}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-204}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-19}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{+42}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{\tan B} + \frac{-1}{B}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 91.6% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}} - t\_0\\

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


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

    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. Simplified73.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 73.5%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified73.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. associate-*r/73.6%

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

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

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

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

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

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

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

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

    if -2.89999999999999991e-9 < F < -2.7999999999999999e-90

    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. Add Preprocessing
    3. Taylor expanded in B around 0 99.5%

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

    if -2.7999999999999999e-90 < F < 9.9999999999999998e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 88.6%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. associate-/l*88.7%

        \[\leadsto \color{blue}{\frac{F}{\frac{B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    10. Simplified88.7%

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

    if 9.9999999999999998e-20 < F

    1. Initial program 55.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. Add Preprocessing
    3. Taylor expanded in F around inf 95.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{-90}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 10^{-19}:\\ \;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.0% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -1.65 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;t\_0\\

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


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

    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. Simplified73.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 73.5%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified73.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.1%

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

    if -2.89999999999999991e-9 < F < -1.65e-90 or 4.49999999999999956e-205 < F < 9.9999999999999998e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 65.4%

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

    if -1.65e-90 < F < 4.49999999999999956e-205

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 35.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      2. *-un-lft-identity83.3%

        \[\leadsto \frac{-x}{\color{blue}{1 \cdot \tan B}} \]
      3. *-commutative83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    8. Applied egg-rr83.3%

      \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    9. Step-by-step derivation
      1. *-rgt-identity83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
    10. Simplified83.3%

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

    if 9.9999999999999998e-20 < F

    1. Initial program 55.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. Simplified67.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 67.3%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified67.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 95.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.65 \cdot 10^{-90}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-205}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-19}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 91.4% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{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 < -0.294999999999999984

    1. Initial program 55.4%

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

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

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

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

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

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

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

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

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

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

    if -0.294999999999999984 < F < 9.9999999999999998e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 86.2%

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

    if 9.9999999999999998e-20 < F

    1. Initial program 55.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. Simplified67.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 67.3%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified67.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 95.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.295:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-19}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 91.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

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


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

    1. Initial program 55.4%

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

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

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

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

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

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

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

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

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

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

    if -0.27000000000000002 < F < 9.9999999999999998e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 86.2%

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

    if 9.9999999999999998e-20 < F

    1. Initial program 55.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. Add Preprocessing
    3. Taylor expanded in F around inf 95.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.27:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-19}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 91.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

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


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

    1. Initial program 55.4%

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified72.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. associate-*r/72.9%

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

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

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

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

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

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

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

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

    if -0.39000000000000001 < F < 9.9999999999999998e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 86.2%

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

    if 9.9999999999999998e-20 < F

    1. Initial program 55.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. Add Preprocessing
    3. Taylor expanded in F around inf 95.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.39:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-19}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 63.6% accurate, 2.5× speedup?

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

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

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

\mathbf{elif}\;F \leq -1.7 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 9.5 \cdot 10^{-20}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 38.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. Add Preprocessing
    3. Taylor expanded in F around -inf 59.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{-1}{F} - \frac{x}{\tan B}} \]
      4. *-commutative45.9%

        \[\leadsto \color{blue}{\frac{-1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      5. frac-2neg45.9%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot F}{\left(-F\right) \cdot B}} - \frac{x}{\tan B} \]
      8. *-un-lft-identity86.6%

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

      \[\leadsto \color{blue}{\frac{F}{\left(-F\right) \cdot B} - \frac{x}{\tan B}} \]
    7. Step-by-step derivation
      1. associate-/r*86.6%

        \[\leadsto \color{blue}{\frac{\frac{F}{-F}}{B}} - \frac{x}{\tan B} \]
      2. neg-mul-186.6%

        \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F}}}{B} - \frac{x}{\tan B} \]
      3. *-commutative86.6%

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

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

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

        \[\leadsto \frac{\frac{F}{F} \cdot \color{blue}{-1}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval86.6%

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

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

        \[\leadsto \frac{\frac{F \cdot -1}{\color{blue}{F}}}{B} - \frac{x}{\tan B} \]
      10. *-commutative86.6%

        \[\leadsto \frac{\frac{\color{blue}{-1 \cdot F}}{F}}{B} - \frac{x}{\tan B} \]
      11. neg-mul-186.6%

        \[\leadsto \frac{\frac{\color{blue}{-F}}{F}}{B} - \frac{x}{\tan B} \]
      12. *-rgt-identity86.6%

        \[\leadsto \frac{\frac{\color{blue}{\left(-F\right) \cdot 1}}{F}}{B} - \frac{x}{\tan B} \]
      13. *-rgt-identity86.6%

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

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{F \cdot \color{blue}{\left(--1\right)}}}{B} - \frac{x}{\tan B} \]
      15. distribute-rgt-neg-in86.6%

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{-F \cdot -1}}}{B} - \frac{x}{\tan B} \]
      16. distribute-lft-neg-in86.6%

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{\left(-F\right) \cdot -1}}}{B} - \frac{x}{\tan B} \]
      17. times-frac86.6%

        \[\leadsto \frac{\color{blue}{\frac{-F}{-F} \cdot \frac{1}{-1}}}{B} - \frac{x}{\tan B} \]
      18. *-inverses86.6%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{1}{-1}}{B} - \frac{x}{\tan B} \]
      19. metadata-eval86.6%

        \[\leadsto \frac{1 \cdot \color{blue}{-1}}{B} - \frac{x}{\tan B} \]
      20. metadata-eval86.6%

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

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

    if -1.60000000000000005e140 < F < -0.26000000000000001

    1. Initial program 91.7%

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

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

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

    if -0.26000000000000001 < F < -1.69999999999999997e-90 or 4.8000000000000004e-205 < F < 9.5e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 63.3%

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

    if -1.69999999999999997e-90 < F < 4.8000000000000004e-205

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 35.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      2. *-un-lft-identity83.3%

        \[\leadsto \frac{-x}{\color{blue}{1 \cdot \tan B}} \]
      3. *-commutative83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    8. Applied egg-rr83.3%

      \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    9. Step-by-step derivation
      1. *-rgt-identity83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
    10. Simplified83.3%

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

    if 9.5e-20 < F

    1. Initial program 55.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. Add Preprocessing
    3. Taylor expanded in F around -inf 37.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    6. Simplified39.0%

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot39.0%

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

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

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-\tan B}} \]
      4. remove-double-neg39.1%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-\tan B} \]
    8. Applied egg-rr39.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{+140}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.26:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-90}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-205}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{-\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 62.9% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -2.1 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;t\_0\\

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


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

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 69.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{-1}{F} - \frac{x}{\tan B}} \]
      4. *-commutative49.2%

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

        \[\leadsto \color{blue}{\frac{--1}{-F}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      6. metadata-eval49.2%

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\left(-F\right) \cdot B} - \frac{x}{\tan B}} \]
    7. Step-by-step derivation
      1. associate-/r*78.8%

        \[\leadsto \color{blue}{\frac{\frac{F}{-F}}{B}} - \frac{x}{\tan B} \]
      2. neg-mul-178.8%

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

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

        \[\leadsto \frac{\frac{\color{blue}{F \cdot 1}}{F \cdot -1}}{B} - \frac{x}{\tan B} \]
      5. times-frac78.8%

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

        \[\leadsto \frac{\frac{F}{F} \cdot \color{blue}{-1}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval78.8%

        \[\leadsto \frac{\frac{F}{F} \cdot \color{blue}{\frac{-1}{1}}}{B} - \frac{x}{\tan B} \]
      8. times-frac78.8%

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

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

        \[\leadsto \frac{\frac{\color{blue}{-1 \cdot F}}{F}}{B} - \frac{x}{\tan B} \]
      11. neg-mul-178.8%

        \[\leadsto \frac{\frac{\color{blue}{-F}}{F}}{B} - \frac{x}{\tan B} \]
      12. *-rgt-identity78.8%

        \[\leadsto \frac{\frac{\color{blue}{\left(-F\right) \cdot 1}}{F}}{B} - \frac{x}{\tan B} \]
      13. *-rgt-identity78.8%

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

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{F \cdot \color{blue}{\left(--1\right)}}}{B} - \frac{x}{\tan B} \]
      15. distribute-rgt-neg-in78.8%

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{-F \cdot -1}}}{B} - \frac{x}{\tan B} \]
      16. distribute-lft-neg-in78.8%

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{\left(-F\right) \cdot -1}}}{B} - \frac{x}{\tan B} \]
      17. times-frac78.8%

        \[\leadsto \frac{\color{blue}{\frac{-F}{-F} \cdot \frac{1}{-1}}}{B} - \frac{x}{\tan B} \]
      18. *-inverses78.8%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{1}{-1}}{B} - \frac{x}{\tan B} \]
      19. metadata-eval78.8%

        \[\leadsto \frac{1 \cdot \color{blue}{-1}}{B} - \frac{x}{\tan B} \]
      20. metadata-eval78.8%

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

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

    if -1.49999999999999999e-9 < F < -2.0999999999999999e-90 or 1.16000000000000007e-204 < F < 9.9999999999999998e-20

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{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}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.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. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 65.4%

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

    if -2.0999999999999999e-90 < F < 1.16000000000000007e-204

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 35.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      2. *-un-lft-identity83.3%

        \[\leadsto \frac{-x}{\color{blue}{1 \cdot \tan B}} \]
      3. *-commutative83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    8. Applied egg-rr83.3%

      \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    9. Step-by-step derivation
      1. *-rgt-identity83.3%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
    10. Simplified83.3%

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

    if 9.9999999999999998e-20 < F

    1. Initial program 55.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. Add Preprocessing
    3. Taylor expanded in F around -inf 37.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    6. Simplified39.0%

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot39.0%

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

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

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-\tan B}} \]
      4. remove-double-neg39.1%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-\tan B} \]
    8. Applied egg-rr39.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-90}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 1.16 \cdot 10^{-204}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-19}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{-\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 63.6% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 61.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. Add Preprocessing
    3. Taylor expanded in F around -inf 65.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \frac{-1}{F} - \frac{x}{\tan B}} \]
      4. *-commutative47.0%

        \[\leadsto \color{blue}{\frac{-1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      5. frac-2neg47.0%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot F}{\left(-F\right) \cdot B}} - \frac{x}{\tan B} \]
      8. *-un-lft-identity73.5%

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

      \[\leadsto \color{blue}{\frac{F}{\left(-F\right) \cdot B} - \frac{x}{\tan B}} \]
    7. Step-by-step derivation
      1. associate-/r*73.6%

        \[\leadsto \color{blue}{\frac{\frac{F}{-F}}{B}} - \frac{x}{\tan B} \]
      2. neg-mul-173.6%

        \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F}}}{B} - \frac{x}{\tan B} \]
      3. *-commutative73.6%

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

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

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

        \[\leadsto \frac{\frac{F}{F} \cdot \color{blue}{-1}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval73.6%

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

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

        \[\leadsto \frac{\frac{F \cdot -1}{\color{blue}{F}}}{B} - \frac{x}{\tan B} \]
      10. *-commutative73.6%

        \[\leadsto \frac{\frac{\color{blue}{-1 \cdot F}}{F}}{B} - \frac{x}{\tan B} \]
      11. neg-mul-173.6%

        \[\leadsto \frac{\frac{\color{blue}{-F}}{F}}{B} - \frac{x}{\tan B} \]
      12. *-rgt-identity73.6%

        \[\leadsto \frac{\frac{\color{blue}{\left(-F\right) \cdot 1}}{F}}{B} - \frac{x}{\tan B} \]
      13. *-rgt-identity73.6%

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

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{F \cdot \color{blue}{\left(--1\right)}}}{B} - \frac{x}{\tan B} \]
      15. distribute-rgt-neg-in73.6%

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{-F \cdot -1}}}{B} - \frac{x}{\tan B} \]
      16. distribute-lft-neg-in73.6%

        \[\leadsto \frac{\frac{\left(-F\right) \cdot 1}{\color{blue}{\left(-F\right) \cdot -1}}}{B} - \frac{x}{\tan B} \]
      17. times-frac73.6%

        \[\leadsto \frac{\color{blue}{\frac{-F}{-F} \cdot \frac{1}{-1}}}{B} - \frac{x}{\tan B} \]
      18. *-inverses73.6%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{1}{-1}}{B} - \frac{x}{\tan B} \]
      19. metadata-eval73.6%

        \[\leadsto \frac{1 \cdot \color{blue}{-1}}{B} - \frac{x}{\tan B} \]
      20. metadata-eval73.6%

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

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

    if -6.19999999999999998e-59 < F

    1. Initial program 82.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. Add Preprocessing
    3. Taylor expanded in F around -inf 34.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot56.1%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      2. *-un-lft-identity56.1%

        \[\leadsto \frac{-x}{\color{blue}{1 \cdot \tan B}} \]
      3. *-commutative56.1%

        \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    8. Applied egg-rr56.1%

      \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    9. Step-by-step derivation
      1. *-rgt-identity56.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.2 \cdot 10^{-59}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 43.7% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 6 \cdot 10^{-124}:\\
\;\;\;\;\frac{-1 - x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 6e-124

    1. Initial program 71.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. Add Preprocessing
    3. Taylor expanded in F around -inf 52.7%

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

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

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

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

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

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

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

    if 6e-124 < B

    1. Initial program 83.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. Add Preprocessing
    3. Taylor expanded in F around -inf 55.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    7. Step-by-step derivation
      1. tan-quot56.7%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
      2. *-un-lft-identity56.7%

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

        \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    8. Applied egg-rr56.7%

      \[\leadsto \frac{-x}{\color{blue}{\tan B \cdot 1}} \]
    9. Step-by-step derivation
      1. *-rgt-identity56.7%

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
    10. Simplified56.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6 \cdot 10^{-124}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 37.8% accurate, 20.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.65 \cdot 10^{-57}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{-1 - x}{B}\\

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


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

    1. Initial program 61.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. Add Preprocessing
    3. Taylor expanded in F around -inf 65.2%

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

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

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

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

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

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

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

    if -1.6499999999999999e-57 < F

    1. Initial program 82.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. Add Preprocessing
    3. Taylor expanded in F around -inf 34.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 37.7% accurate, 21.6× speedup?

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

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

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


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

    1. Initial program 59.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. Add Preprocessing
    3. Taylor expanded in F around -inf 93.7%

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

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

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

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

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

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

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

    if -7.4000000000000004e-41 < F

    1. Initial program 83.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. Add Preprocessing
    3. Taylor expanded in F around -inf 34.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.4 \cdot 10^{-41}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 31.4% accurate, 23.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{-199} \lor \neg \left(x \leq 2.4 \cdot 10^{-42}\right):\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -4.1e-199) (not (<= x 2.4e-42))) (- (/ x B)) (/ -1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -4.1e-199) || !(x <= 2.4e-42)) {
		tmp = -(x / B);
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-4.1d-199)) .or. (.not. (x <= 2.4d-42))) then
        tmp = -(x / b)
    else
        tmp = (-1.0d0) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -4.1e-199) || !(x <= 2.4e-42)) {
		tmp = -(x / B);
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -4.1e-199) or not (x <= 2.4e-42):
		tmp = -(x / B)
	else:
		tmp = -1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -4.1e-199) || !(x <= 2.4e-42))
		tmp = Float64(-Float64(x / B));
	else
		tmp = Float64(-1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -4.1e-199) || ~((x <= 2.4e-42)))
		tmp = -(x / B);
	else
		tmp = -1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -4.1e-199], N[Not[LessEqual[x, 2.4e-42]], $MachinePrecision]], (-N[(x / B), $MachinePrecision]), N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{-199} \lor \neg \left(x \leq 2.4 \cdot 10^{-42}\right):\\
\;\;\;\;-\frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.10000000000000022e-199 or 2.40000000000000003e-42 < x

    1. Initial program 80.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. Add Preprocessing
    3. Taylor expanded in F around -inf 67.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. mul-1-neg42.3%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
    9. Simplified42.3%

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

    if -4.10000000000000022e-199 < x < 2.40000000000000003e-42

    1. Initial program 66.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. Add Preprocessing
    3. Taylor expanded in F around -inf 29.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{-199} \lor \neg \left(x \leq 2.4 \cdot 10^{-42}\right):\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 37.7% accurate, 32.3× speedup?

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

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

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


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

    1. Initial program 61.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. Add Preprocessing
    3. Taylor expanded in F around -inf 91.8%

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

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

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

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

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

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

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

    if -4.1999999999999999e-57 < F

    1. Initial program 82.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. Add Preprocessing
    3. Taylor expanded in F around -inf 34.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
    9. Simplified30.6%

      \[\leadsto \color{blue}{-\frac{x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-57}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 11.0% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 75.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. Add Preprocessing
  3. Taylor expanded in F around -inf 53.8%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  8. Final simplification11.6%

    \[\leadsto \frac{-1}{B} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024041 
(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))))))