VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.0% → 99.7%
Time: 26.4s
Alternatives: 18
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 18 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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{-1}{{F}^{2}}}{\sin B} - t\_0\\


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

    1. Initial program 66.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000001e30 < F < 1e4

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e4 < F

    1. Initial program 53.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.1% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{-1}{{F}^{2}}}{\sin B} - t\_0\\


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

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < 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. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < 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. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\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}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < 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. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.15 \cdot 10^{-41}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_1\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-116}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-45}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B))) (t_1 (/ x (tan B))))
   (if (<= F -2.15e-41)
     (- (/ -1.0 (sin B)) t_1)
     (if (<= F 5.1e-206)
       t_0
       (if (<= F 2.1e-116)
         (/ (* F (sqrt 0.5)) (sin B))
         (if (<= F 2.7e-45) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double t_1 = x / tan(B);
	double tmp;
	if (F <= -2.15e-41) {
		tmp = (-1.0 / sin(B)) - t_1;
	} else if (F <= 5.1e-206) {
		tmp = t_0;
	} else if (F <= 2.1e-116) {
		tmp = (F * sqrt(0.5)) / sin(B);
	} else if (F <= 2.7e-45) {
		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 = -x / tan(b)
    t_1 = x / tan(b)
    if (f <= (-2.15d-41)) then
        tmp = ((-1.0d0) / sin(b)) - t_1
    else if (f <= 5.1d-206) then
        tmp = t_0
    else if (f <= 2.1d-116) then
        tmp = (f * sqrt(0.5d0)) / sin(b)
    else if (f <= 2.7d-45) 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 = -x / Math.tan(B);
	double t_1 = x / Math.tan(B);
	double tmp;
	if (F <= -2.15e-41) {
		tmp = (-1.0 / Math.sin(B)) - t_1;
	} else if (F <= 5.1e-206) {
		tmp = t_0;
	} else if (F <= 2.1e-116) {
		tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
	} else if (F <= 2.7e-45) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / math.tan(B)
	t_1 = x / math.tan(B)
	tmp = 0
	if F <= -2.15e-41:
		tmp = (-1.0 / math.sin(B)) - t_1
	elif F <= 5.1e-206:
		tmp = t_0
	elif F <= 2.1e-116:
		tmp = (F * math.sqrt(0.5)) / math.sin(B)
	elif F <= 2.7e-45:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	t_1 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -2.15e-41)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_1);
	elseif (F <= 5.1e-206)
		tmp = t_0;
	elseif (F <= 2.1e-116)
		tmp = Float64(Float64(F * sqrt(0.5)) / sin(B));
	elseif (F <= 2.7e-45)
		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 = -x / tan(B);
	t_1 = x / tan(B);
	tmp = 0.0;
	if (F <= -2.15e-41)
		tmp = (-1.0 / sin(B)) - t_1;
	elseif (F <= 5.1e-206)
		tmp = t_0;
	elseif (F <= 2.1e-116)
		tmp = (F * sqrt(0.5)) / sin(B);
	elseif (F <= 2.7e-45)
		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[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.15e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 5.1e-206], t$95$0, If[LessEqual[F, 2.1e-116], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e-45], 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{-x}{\tan B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.15 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 2.7 \cdot 10^{-45}:\\
\;\;\;\;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.1499999999999999e-41

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1499999999999999e-41 < F < 5.10000000000000005e-206 or 2.0999999999999999e-116 < F < 2.69999999999999985e-45

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac283.0%

        \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Simplified83.0%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    12. Step-by-step derivation
      1. distribute-frac-neg283.0%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. neg-sub083.0%

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

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

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

        \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      6. associate-*l/83.1%

        \[\leadsto 0 - \color{blue}{\frac{1 \cdot x}{\frac{\sin B}{\cos B}}} \]
      7. *-un-lft-identity83.1%

        \[\leadsto 0 - \frac{\color{blue}{x}}{\frac{\sin B}{\cos B}} \]
      8. quot-tan83.1%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    13. Applied egg-rr83.1%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    14. Step-by-step derivation
      1. neg-sub083.1%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac83.1%

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

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

    if 5.10000000000000005e-206 < F < 2.0999999999999999e-116

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    7. Step-by-step derivation
      1. *-commutative66.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{F}}{\sqrt{2 + 2 \cdot x} \cdot \sin B} \]
      6. +-commutative65.5%

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

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

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

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

    if 2.69999999999999985e-45 < F

    1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.15 \cdot 10^{-41}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-116}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-45}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 5.8 \cdot 10^{+131}:\\
\;\;\;\;t\_0\\

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


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

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

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

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

    if -110 < F < 5.10000000000000005e-206 or 1.35999999999999996e-117 < F < 5.8000000000000002e131

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      6. associate-*l/71.5%

        \[\leadsto 0 - \color{blue}{\frac{1 \cdot x}{\frac{\sin B}{\cos B}}} \]
      7. *-un-lft-identity71.5%

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

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    13. Applied egg-rr71.6%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    14. Step-by-step derivation
      1. neg-sub071.6%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac71.6%

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

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

    if 5.10000000000000005e-206 < F < 1.35999999999999996e-117

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8000000000000002e131 < F

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\right) + \color{blue}{\sqrt{\frac{1}{\sin B}} \cdot \sqrt{\frac{1}{\sin B}}} \]
      8. add-sqr-sqrt65.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -110:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.36 \cdot 10^{-117}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+131}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 64.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 9 \cdot 10^{+134}:\\
\;\;\;\;t\_0\\

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


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

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

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

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

    if -200 < F < 5.10000000000000005e-206 or 9.49999999999999931e-118 < F < 8.9999999999999995e134

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      6. associate-*l/71.5%

        \[\leadsto 0 - \color{blue}{\frac{1 \cdot x}{\frac{\sin B}{\cos B}}} \]
      7. *-un-lft-identity71.5%

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

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    13. Applied egg-rr71.6%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    14. Step-by-step derivation
      1. neg-sub071.6%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac71.6%

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

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

    if 5.10000000000000005e-206 < F < 9.49999999999999931e-118

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    7. Step-by-step derivation
      1. *-commutative66.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{F}}{\sqrt{2 + 2 \cdot x} \cdot \sin B} \]
      6. +-commutative65.5%

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

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

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

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

    if 8.9999999999999995e134 < F

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\right) + \color{blue}{\sqrt{\frac{1}{\sin B}} \cdot \sqrt{\frac{1}{\sin B}}} \]
      8. add-sqr-sqrt65.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -200:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-118}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+134}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 70.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{+133}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2e-41 < F < 5.10000000000000005e-206 or 9.49999999999999931e-118 < F < 2.2999999999999999e133

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    12. Step-by-step derivation
      1. distribute-frac-neg272.2%

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

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

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

        \[\leadsto 0 - \color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      5. clear-num72.0%

        \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      6. associate-*l/72.3%

        \[\leadsto 0 - \color{blue}{\frac{1 \cdot x}{\frac{\sin B}{\cos B}}} \]
      7. *-un-lft-identity72.3%

        \[\leadsto 0 - \frac{\color{blue}{x}}{\frac{\sin B}{\cos B}} \]
      8. quot-tan72.3%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    13. Applied egg-rr72.3%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    14. Step-by-step derivation
      1. neg-sub072.3%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac72.3%

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

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

    if 5.10000000000000005e-206 < F < 9.49999999999999931e-118

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    7. Step-by-step derivation
      1. *-commutative66.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{F}}{\sqrt{2 + 2 \cdot x} \cdot \sin B} \]
      6. +-commutative65.5%

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

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

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

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

    if 2.2999999999999999e133 < F

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\right) + \color{blue}{\sqrt{\frac{1}{\sin B}} \cdot \sqrt{\frac{1}{\sin B}}} \]
      8. add-sqr-sqrt65.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.2 \cdot 10^{-41}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-118}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{+133}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 91.7% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 0.085:\\
\;\;\;\;\frac{F \cdot \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.0379999999999999991

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0379999999999999991 < F < 0.0850000000000000061

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{B}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. *-commutative85.3%

        \[\leadsto \frac{\color{blue}{\sqrt{0.5} \cdot F}}{B} - \frac{x}{\tan B} \]
    11. Simplified85.3%

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

    if 0.0850000000000000061 < F

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 37.7% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x + 1}{B}\\ t_1 := \frac{x}{-\sin B}\\ \mathbf{if}\;F \leq -165000000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+134}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+161}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+206}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+236}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (+ x 1.0) B)) (t_1 (/ x (- (sin B)))))
   (if (<= F -165000000.0)
     (/ (- -1.0 x) B)
     (if (<= F 6.2e+134)
       t_1
       (if (<= F 1.5e+161)
         t_0
         (if (<= F 1.1e+206)
           t_1
           (if (<= F 2.7e+236)
             t_0
             (- (/ -1.0 B) (+ (* -0.3333333333333333 (* B x)) (/ x B))))))))))
double code(double F, double B, double x) {
	double t_0 = (x + 1.0) / B;
	double t_1 = x / -sin(B);
	double tmp;
	if (F <= -165000000.0) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 6.2e+134) {
		tmp = t_1;
	} else if (F <= 1.5e+161) {
		tmp = t_0;
	} else if (F <= 1.1e+206) {
		tmp = t_1;
	} else if (F <= 2.7e+236) {
		tmp = t_0;
	} else {
		tmp = (-1.0 / B) - ((-0.3333333333333333 * (B * x)) + (x / B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (x + 1.0d0) / b
    t_1 = x / -sin(b)
    if (f <= (-165000000.0d0)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 6.2d+134) then
        tmp = t_1
    else if (f <= 1.5d+161) then
        tmp = t_0
    else if (f <= 1.1d+206) then
        tmp = t_1
    else if (f <= 2.7d+236) then
        tmp = t_0
    else
        tmp = ((-1.0d0) / b) - (((-0.3333333333333333d0) * (b * x)) + (x / b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (x + 1.0) / B;
	double t_1 = x / -Math.sin(B);
	double tmp;
	if (F <= -165000000.0) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 6.2e+134) {
		tmp = t_1;
	} else if (F <= 1.5e+161) {
		tmp = t_0;
	} else if (F <= 1.1e+206) {
		tmp = t_1;
	} else if (F <= 2.7e+236) {
		tmp = t_0;
	} else {
		tmp = (-1.0 / B) - ((-0.3333333333333333 * (B * x)) + (x / B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (x + 1.0) / B
	t_1 = x / -math.sin(B)
	tmp = 0
	if F <= -165000000.0:
		tmp = (-1.0 - x) / B
	elif F <= 6.2e+134:
		tmp = t_1
	elif F <= 1.5e+161:
		tmp = t_0
	elif F <= 1.1e+206:
		tmp = t_1
	elif F <= 2.7e+236:
		tmp = t_0
	else:
		tmp = (-1.0 / B) - ((-0.3333333333333333 * (B * x)) + (x / B))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(x + 1.0) / B)
	t_1 = Float64(x / Float64(-sin(B)))
	tmp = 0.0
	if (F <= -165000000.0)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 6.2e+134)
		tmp = t_1;
	elseif (F <= 1.5e+161)
		tmp = t_0;
	elseif (F <= 1.1e+206)
		tmp = t_1;
	elseif (F <= 2.7e+236)
		tmp = t_0;
	else
		tmp = Float64(Float64(-1.0 / B) - Float64(Float64(-0.3333333333333333 * Float64(B * x)) + Float64(x / B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (x + 1.0) / B;
	t_1 = x / -sin(B);
	tmp = 0.0;
	if (F <= -165000000.0)
		tmp = (-1.0 - x) / B;
	elseif (F <= 6.2e+134)
		tmp = t_1;
	elseif (F <= 1.5e+161)
		tmp = t_0;
	elseif (F <= 1.1e+206)
		tmp = t_1;
	elseif (F <= 2.7e+236)
		tmp = t_0;
	else
		tmp = (-1.0 / B) - ((-0.3333333333333333 * (B * x)) + (x / B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[F, -165000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.2e+134], t$95$1, If[LessEqual[F, 1.5e+161], t$95$0, If[LessEqual[F, 1.1e+206], t$95$1, If[LessEqual[F, 2.7e+236], t$95$0, N[(N[(-1.0 / B), $MachinePrecision] - N[(N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 6.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 1.5 \cdot 10^{+161}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{+206}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 2.7 \cdot 10^{+236}:\\
\;\;\;\;t\_0\\

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


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

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac242.1%

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

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

    if -1.65e8 < F < 6.19999999999999963e134 or 1.50000000000000006e161 < F < 1.10000000000000001e206

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.19999999999999963e134 < F < 1.50000000000000006e161 or 1.10000000000000001e206 < F < 2.7000000000000002e236

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac21.3%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity1.3%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{-B}} \]
      2. add-sqr-sqrt0.8%

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

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

        \[\leadsto 1 \cdot \frac{1 + x}{\sqrt{\color{blue}{B \cdot B}}} \]
      5. sqrt-unprod41.2%

        \[\leadsto 1 \cdot \frac{1 + x}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      6. add-sqr-sqrt55.5%

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

      \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity55.5%

        \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
    10. Simplified55.5%

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

    if 2.7000000000000002e236 < F

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -165000000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+134}:\\ \;\;\;\;\frac{x}{-\sin B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+161}:\\ \;\;\;\;\frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+206}:\\ \;\;\;\;\frac{x}{-\sin B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+236}:\\ \;\;\;\;\frac{x + 1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 66.8% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \leq 1.8 \cdot 10^{+131}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

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

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

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

    if -0.55000000000000004 < F < 1.80000000000000016e131

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      6. associate-*l/66.6%

        \[\leadsto 0 - \color{blue}{\frac{1 \cdot x}{\frac{\sin B}{\cos B}}} \]
      7. *-un-lft-identity66.6%

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

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    13. Applied egg-rr66.6%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    14. Step-by-step derivation
      1. neg-sub066.6%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac66.6%

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

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

    if 1.80000000000000016e131 < F

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\right) + \color{blue}{\sqrt{\frac{1}{\sin B}} \cdot \sqrt{\frac{1}{\sin B}}} \]
      8. add-sqr-sqrt65.3%

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

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

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

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

Alternative 12: 64.5% accurate, 2.9× speedup?

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

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

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


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

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

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

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

    if -19 < F

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac263.1%

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

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    12. Step-by-step derivation
      1. distribute-frac-neg263.1%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. neg-sub063.1%

        \[\leadsto \color{blue}{0 - \frac{x \cdot \cos B}{\sin B}} \]
      3. *-commutative63.1%

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

        \[\leadsto 0 - \color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      5. clear-num63.0%

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

        \[\leadsto 0 - \color{blue}{\frac{1 \cdot x}{\frac{\sin B}{\cos B}}} \]
      7. *-un-lft-identity63.2%

        \[\leadsto 0 - \frac{\color{blue}{x}}{\frac{\sin B}{\cos B}} \]
      8. quot-tan63.2%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    13. Applied egg-rr63.2%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    14. Step-by-step derivation
      1. neg-sub063.2%

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

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

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

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

Alternative 13: 56.3% accurate, 3.1× speedup?

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

\\
\frac{-x}{\tan B}
\end{array}
Derivation
  1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
    6. associate-*l/58.5%

      \[\leadsto 0 - \color{blue}{\frac{1 \cdot x}{\frac{\sin B}{\cos B}}} \]
    7. *-un-lft-identity58.5%

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

      \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
  13. Applied egg-rr58.6%

    \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
  14. Step-by-step derivation
    1. neg-sub058.6%

      \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
    2. distribute-neg-frac58.6%

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

    \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
  16. Final simplification58.6%

    \[\leadsto \frac{-x}{\tan B} \]
  17. Add Preprocessing

Alternative 14: 36.3% accurate, 10.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 - x}{B}\\ \mathbf{if}\;F \leq -4.5 \cdot 10^{-52}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+130}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+161} \lor \neg \left(F \leq 1.15 \cdot 10^{+206}\right) \land F \leq 3.2 \cdot 10^{+237}:\\ \;\;\;\;\frac{x + 1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- -1.0 x) B)))
   (if (<= F -4.5e-52)
     t_0
     (if (<= F 2e+130)
       (/ (- x) B)
       (if (or (<= F 1.5e+161) (and (not (<= F 1.15e+206)) (<= F 3.2e+237)))
         (/ (+ x 1.0) B)
         t_0)))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 - x) / B;
	double tmp;
	if (F <= -4.5e-52) {
		tmp = t_0;
	} else if (F <= 2e+130) {
		tmp = -x / B;
	} else if ((F <= 1.5e+161) || (!(F <= 1.15e+206) && (F <= 3.2e+237))) {
		tmp = (x + 1.0) / B;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((-1.0d0) - x) / b
    if (f <= (-4.5d-52)) then
        tmp = t_0
    else if (f <= 2d+130) then
        tmp = -x / b
    else if ((f <= 1.5d+161) .or. (.not. (f <= 1.15d+206)) .and. (f <= 3.2d+237)) then
        tmp = (x + 1.0d0) / b
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 - x) / B;
	double tmp;
	if (F <= -4.5e-52) {
		tmp = t_0;
	} else if (F <= 2e+130) {
		tmp = -x / B;
	} else if ((F <= 1.5e+161) || (!(F <= 1.15e+206) && (F <= 3.2e+237))) {
		tmp = (x + 1.0) / B;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 - x) / B
	tmp = 0
	if F <= -4.5e-52:
		tmp = t_0
	elif F <= 2e+130:
		tmp = -x / B
	elif (F <= 1.5e+161) or (not (F <= 1.15e+206) and (F <= 3.2e+237)):
		tmp = (x + 1.0) / B
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 - x) / B)
	tmp = 0.0
	if (F <= -4.5e-52)
		tmp = t_0;
	elseif (F <= 2e+130)
		tmp = Float64(Float64(-x) / B);
	elseif ((F <= 1.5e+161) || (!(F <= 1.15e+206) && (F <= 3.2e+237)))
		tmp = Float64(Float64(x + 1.0) / B);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 - x) / B;
	tmp = 0.0;
	if (F <= -4.5e-52)
		tmp = t_0;
	elseif (F <= 2e+130)
		tmp = -x / B;
	elseif ((F <= 1.5e+161) || (~((F <= 1.15e+206)) && (F <= 3.2e+237)))
		tmp = (x + 1.0) / B;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -4.5e-52], t$95$0, If[LessEqual[F, 2e+130], N[((-x) / B), $MachinePrecision], If[Or[LessEqual[F, 1.5e+161], And[N[Not[LessEqual[F, 1.15e+206]], $MachinePrecision], LessEqual[F, 3.2e+237]]], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 2 \cdot 10^{+130}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;F \leq 1.5 \cdot 10^{+161} \lor \neg \left(F \leq 1.15 \cdot 10^{+206}\right) \land F \leq 3.2 \cdot 10^{+237}:\\
\;\;\;\;\frac{x + 1}{B}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.5e-52 or 1.50000000000000006e161 < F < 1.15000000000000008e206 or 3.20000000000000017e237 < F

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac238.5%

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

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

    if -4.5e-52 < F < 2.0000000000000001e130

    1. Initial program 97.1%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac213.0%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified13.0%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 29.0%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified29.0%

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

    if 2.0000000000000001e130 < F < 1.50000000000000006e161 or 1.15000000000000008e206 < F < 3.20000000000000017e237

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac21.3%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity1.3%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{-B}} \]
      2. add-sqr-sqrt0.8%

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

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

        \[\leadsto 1 \cdot \frac{1 + x}{\sqrt{\color{blue}{B \cdot B}}} \]
      5. sqrt-unprod41.2%

        \[\leadsto 1 \cdot \frac{1 + x}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      6. add-sqr-sqrt55.5%

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

      \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity55.5%

        \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
    10. Simplified55.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+130}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+161} \lor \neg \left(F \leq 1.15 \cdot 10^{+206}\right) \land F \leq 3.2 \cdot 10^{+237}:\\ \;\;\;\;\frac{x + 1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 36.4% accurate, 12.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{B}\\ \mathbf{if}\;F \leq -5.6 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+131}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+161}:\\ \;\;\;\;\frac{x + 1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0 - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) B)))
   (if (<= F -5.6e-52)
     (/ (- -1.0 x) B)
     (if (<= F 9e+131)
       t_0
       (if (<= F 1.5e+161)
         (/ (+ x 1.0) B)
         (- t_0 (* B (* x -0.3333333333333333))))))))
double code(double F, double B, double x) {
	double t_0 = -x / B;
	double tmp;
	if (F <= -5.6e-52) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 9e+131) {
		tmp = t_0;
	} else if (F <= 1.5e+161) {
		tmp = (x + 1.0) / B;
	} else {
		tmp = t_0 - (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) :: t_0
    real(8) :: tmp
    t_0 = -x / b
    if (f <= (-5.6d-52)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 9d+131) then
        tmp = t_0
    else if (f <= 1.5d+161) then
        tmp = (x + 1.0d0) / b
    else
        tmp = t_0 - (b * (x * (-0.3333333333333333d0)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -x / B;
	double tmp;
	if (F <= -5.6e-52) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 9e+131) {
		tmp = t_0;
	} else if (F <= 1.5e+161) {
		tmp = (x + 1.0) / B;
	} else {
		tmp = t_0 - (B * (x * -0.3333333333333333));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -x / B
	tmp = 0
	if F <= -5.6e-52:
		tmp = (-1.0 - x) / B
	elif F <= 9e+131:
		tmp = t_0
	elif F <= 1.5e+161:
		tmp = (x + 1.0) / B
	else:
		tmp = t_0 - (B * (x * -0.3333333333333333))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / B)
	tmp = 0.0
	if (F <= -5.6e-52)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 9e+131)
		tmp = t_0;
	elseif (F <= 1.5e+161)
		tmp = Float64(Float64(x + 1.0) / B);
	else
		tmp = Float64(t_0 - Float64(B * Float64(x * -0.3333333333333333)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -x / B;
	tmp = 0.0;
	if (F <= -5.6e-52)
		tmp = (-1.0 - x) / B;
	elseif (F <= 9e+131)
		tmp = t_0;
	elseif (F <= 1.5e+161)
		tmp = (x + 1.0) / B;
	else
		tmp = t_0 - (B * (x * -0.3333333333333333));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[F, -5.6e-52], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9e+131], t$95$0, If[LessEqual[F, 1.5e+161], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision], N[(t$95$0 - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 9 \cdot 10^{+131}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.5 \cdot 10^{+161}:\\
\;\;\;\;\frac{x + 1}{B}\\

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


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

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac238.6%

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

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

    if -5.59999999999999989e-52 < F < 9.00000000000000039e131

    1. Initial program 97.1%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac213.0%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified13.0%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 29.0%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified29.0%

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

    if 9.00000000000000039e131 < F < 1.50000000000000006e161

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg1.2%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac21.2%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified1.2%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity1.2%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{-B}} \]
      2. add-sqr-sqrt0.8%

        \[\leadsto 1 \cdot \frac{1 + x}{\color{blue}{\sqrt{-B} \cdot \sqrt{-B}}} \]
      3. sqrt-unprod14.5%

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

        \[\leadsto 1 \cdot \frac{1 + x}{\sqrt{\color{blue}{B \cdot B}}} \]
      5. sqrt-unprod44.3%

        \[\leadsto 1 \cdot \frac{1 + x}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      6. add-sqr-sqrt57.7%

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

      \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity57.7%

        \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
    10. Simplified57.7%

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

    if 1.50000000000000006e161 < F

    1. Initial program 30.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac256.9%

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

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    12. 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}} \]
    13. 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) \]
    14. Simplified31.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+131}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{+161}:\\ \;\;\;\;\frac{x + 1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 36.4% accurate, 13.5× speedup?

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

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

\mathbf{elif}\;F \leq 1.8 \cdot 10^{+131}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;F \leq 1.42 \cdot 10^{+161}:\\
\;\;\;\;\frac{x + 1}{B}\\

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


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

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac238.6%

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

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

    if -2.1500000000000002e-52 < F < 1.80000000000000016e131

    1. Initial program 97.1%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac213.0%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified13.0%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 29.0%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified29.0%

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

    if 1.80000000000000016e131 < F < 1.42000000000000009e161

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg1.2%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac21.2%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified1.2%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity1.2%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{-B}} \]
      2. add-sqr-sqrt0.8%

        \[\leadsto 1 \cdot \frac{1 + x}{\color{blue}{\sqrt{-B} \cdot \sqrt{-B}}} \]
      3. sqrt-unprod14.5%

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

        \[\leadsto 1 \cdot \frac{1 + x}{\sqrt{\color{blue}{B \cdot B}}} \]
      5. sqrt-unprod44.3%

        \[\leadsto 1 \cdot \frac{1 + x}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      6. add-sqr-sqrt57.7%

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

      \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity57.7%

        \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
    10. Simplified57.7%

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

    if 1.42000000000000009e161 < F

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    6. Simplified57.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.15 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+131}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{+161}:\\ \;\;\;\;\frac{x + 1}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 31.1% accurate, 23.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-143} \lor \neg \left(x \leq 9.5 \cdot 10^{-167}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -2.6e-143) (not (<= x 9.5e-167))) (/ (- x) B) (/ -1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.6e-143) || !(x <= 9.5e-167)) {
		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 <= (-2.6d-143)) .or. (.not. (x <= 9.5d-167))) 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 <= -2.6e-143) || !(x <= 9.5e-167)) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -2.6e-143) or not (x <= 9.5e-167):
		tmp = -x / B
	else:
		tmp = -1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -2.6e-143) || !(x <= 9.5e-167))
		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 <= -2.6e-143) || ~((x <= 9.5e-167)))
		tmp = -x / B;
	else
		tmp = -1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.6e-143], N[Not[LessEqual[x, 9.5e-167]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-143} \lor \neg \left(x \leq 9.5 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.59999999999999987e-143 or 9.49999999999999955e-167 < x

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg24.4%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac224.4%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified24.4%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 32.1%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified32.1%

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

    if -2.59999999999999987e-143 < x < 9.49999999999999955e-167

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac218.6%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 18.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-143} \lor \neg \left(x \leq 9.5 \cdot 10^{-167}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 10.7% 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 78.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 56.9%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  4. Taylor expanded in B around 0 23.0%

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  5. Step-by-step derivation
    1. mul-1-neg23.0%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    2. distribute-neg-frac223.0%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  6. Simplified23.0%

    \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  7. Taylor expanded in x around 0 8.8%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  8. Final simplification8.8%

    \[\leadsto \frac{-1}{B} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024040 
(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))))))