VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.9% → 99.1%
Time: 17.6s
Alternatives: 29
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 29 alternatives:

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

Initial Program: 76.9% 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.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.9 \cdot 10^{+60}:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\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 -5.2e-9)
     (+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
     (if (<= F 2.9e+60)
       (- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (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 <= -5.2e-9) {
		tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
	} else if (F <= 2.9e+60) {
		tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -5.2e-9)
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B)));
	elseif (F <= 2.9e+60)
		tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0);
	else
		tmp = Float64(Float64(1.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, -5.2e-9], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.9e+60], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(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 -5.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 2.9 \cdot 10^{+60}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\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 < -5.2000000000000002e-9

    1. Initial program 70.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 99.7%

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

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

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

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

    if -5.2000000000000002e-9 < F < 2.9e60

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

    if 2.9e60 < F

    1. Initial program 52.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. Simplified62.1%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+35}:\\ \;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}} - 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 -5.2e-9)
     (+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
     (if (<= F 5e+35)
       (- (/ F (/ (sin B) (pow (fma F F 2.0) -0.5))) 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 <= -5.2e-9) {
		tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
	} else if (F <= 5e+35) {
		tmp = (F / (sin(B) / pow(fma(F, F, 2.0), -0.5))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -5.2e-9)
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B)));
	elseif (F <= 5e+35)
		tmp = Float64(Float64(F / Float64(sin(B) / (fma(F, F, 2.0) ^ -0.5))) - t_0);
	else
		tmp = Float64(Float64(1.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, -5.2e-9], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e+35], N[(N[(F / N[(N[Sin[B], $MachinePrecision] / N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(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 -5.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 70.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 99.7%

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

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

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

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

    if -5.2000000000000002e-9 < F < 5.00000000000000021e35

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000021e35 < F

    1. Initial program 57.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. Simplified65.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\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 -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+35}:\\ \;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 10^{+31}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - 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 -5.2e-9)
     (+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
     (if (<= F 1e+31)
       (- (/ F (* (sin B) (sqrt (fma F F 2.0)))) 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 <= -5.2e-9) {
		tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
	} else if (F <= 1e+31) {
		tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -5.2e-9)
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B)));
	elseif (F <= 1e+31)
		tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - t_0);
	else
		tmp = Float64(Float64(1.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, -5.2e-9], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+31], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(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 -5.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 70.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 99.7%

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

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

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

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

    if -5.2000000000000002e-9 < F < 9.9999999999999996e30

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999996e30 < 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. Simplified66.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 66.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\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 -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 10^{+31}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 70.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 99.7%

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

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

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

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

    if -5.2000000000000002e-9 < F < 5.0000000000000002e46

    1. Initial program 99.4%

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

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B} \]
      2. clear-num33.0%

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

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

    if 5.0000000000000002e46 < F

    1. Initial program 56.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. Simplified64.8%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\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 -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+46}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 70.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 99.7%

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

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

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

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

    if -5.2000000000000002e-9 < F < 3.1999999999999998e46

    1. Initial program 99.4%

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

    if 3.1999999999999998e46 < F

    1. Initial program 56.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. Simplified64.8%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\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 -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+46}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 98.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 70.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 99.7%

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

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

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

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

    if -5.2000000000000002e-9 < F < 1.4199999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4199999999999999 < F

    1. Initial program 60.0%

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

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

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

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

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

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

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

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

      \[\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 -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.42:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 98.8% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;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 < -5.2000000000000002e-9

    1. Initial program 70.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 99.7%

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

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

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

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

    if -5.2000000000000002e-9 < F < 1.4199999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

    if 1.4199999999999999 < F

    1. Initial program 60.0%

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

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

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

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

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

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

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

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

      \[\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 -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.42:\\ \;\;\;\;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 8: 90.4% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 72.5%

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

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

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

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

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

    if -8.0000000000000003e-26 < F < 1.3000000000000001e-46

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in 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} \]
    5. Taylor expanded in B around 0 88.5%

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

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

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{B}} - \frac{x}{\tan B} \]
    8. Simplified88.5%

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

    if 1.3000000000000001e-46 < F

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 90.4% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 72.5%

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

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

    if -8.0000000000000003e-26 < F < 1.3000000000000001e-46

    1. Initial program 99.5%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in 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} \]
    5. Taylor expanded in B around 0 88.5%

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

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

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{B}} - \frac{x}{\tan B} \]
    8. Simplified88.5%

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

    if 1.3000000000000001e-46 < F

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 83.5% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 69.6%

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

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

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

    if -2.1500000000000001e-7 < F < 1.3000000000000001e-46

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in 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} \]
    5. Taylor expanded in B around 0 87.5%

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

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

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{B}} - \frac{x}{\tan B} \]
    8. Simplified87.5%

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

    if 1.3000000000000001e-46 < F

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 76.9% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{-87}:\\
\;\;\;\;\frac{F}{F \cdot \left(-B\right)} - t\_0\\

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

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


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

    1. Initial program 75.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. Simplified82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative73.0%

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

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

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

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

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

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

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

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

    if -2.00000000000000004e-87 < F < 3.4000000000000002e-47

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified71.0%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num70.9%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      2. tan-quot71.0%

        \[\leadsto \left(-x\right) \cdot \frac{1}{\color{blue}{\tan B}} \]
      3. *-un-lft-identity71.0%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr71.0%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity71.0%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified71.0%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out71.0%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      2. neg-sub071.0%

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

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

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

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

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

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

    if 3.4000000000000002e-47 < F

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 62.1% accurate, 2.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 4.7 \cdot 10^{+220} \lor \neg \left(F \leq 3.9 \cdot 10^{+282}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

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


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

    1. Initial program 53.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 99.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified59.0%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt38.4%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      2. sqrt-unprod26.8%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      3. sqr-neg26.8%

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

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      5. add-sqr-sqrt1.8%

        \[\leadsto \color{blue}{x} \cdot \frac{\cos B}{\sin B} \]
      6. clear-num1.8%

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

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

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      9. frac-2neg1.8%

        \[\leadsto \color{blue}{\frac{-x}{-\tan B}} \]
      10. neg-sub01.8%

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

        \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{-\tan B}} \]
      12. add-sqr-sqrt0.5%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      13. sqrt-unprod27.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      14. sqr-neg27.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      15. sqrt-unprod38.4%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      16. add-sqr-sqrt59.3%

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

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

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

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

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

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

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

    if -5.25000000000000029e123 < F < -2.1500000000000001e-7

    1. Initial program 96.2%

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

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

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

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

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

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

    if -2.1500000000000001e-7 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified69.7%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num69.7%

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr69.8%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity69.8%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified69.8%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out69.8%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      2. neg-sub069.8%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    12. Applied egg-rr69.9%

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

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

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    14. Simplified69.9%

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

    if 1.33000000000000008e-46 < F < 4.70000000000000026e220 or 3.8999999999999998e282 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative61.9%

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

        \[\leadsto \frac{F}{B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
      3. fma-undefine61.9%

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

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

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

    if 4.70000000000000026e220 < F < 3.8999999999999998e282

    1. Initial program 14.3%

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

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

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right)}^{3}} \]
    5. Applied egg-rr75.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in x around 0 76.7%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}}\right)}}^{3} \]
    7. Taylor expanded in B around inf 77.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -2.15 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 4.7 \cdot 10^{+220} \lor \neg \left(F \leq 3.9 \cdot 10^{+282}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 68.1% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.8 \cdot 10^{-87}:\\ \;\;\;\;\frac{F}{F \cdot \left(-B\right)} - t\_0\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.46 \cdot 10^{+221}:\\ \;\;\;\;\frac{1}{B} - t\_0\\ \mathbf{elif}\;F \leq 1.16 \cdot 10^{+285}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -5.8e-87)
     (- (/ F (* F (- B))) t_0)
     (if (<= F 1.33e-46)
       (/ (- x) (tan B))
       (if (<= F 1.46e+221)
         (- (/ 1.0 B) t_0)
         (if (<= F 1.16e+285) (/ 1.0 (sin B)) (- (/ F (* F B)) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -5.8e-87) {
		tmp = (F / (F * -B)) - t_0;
	} else if (F <= 1.33e-46) {
		tmp = -x / tan(B);
	} else if (F <= 1.46e+221) {
		tmp = (1.0 / B) - t_0;
	} else if (F <= 1.16e+285) {
		tmp = 1.0 / sin(B);
	} else {
		tmp = (F / (F * 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 <= (-5.8d-87)) then
        tmp = (f / (f * -b)) - t_0
    else if (f <= 1.33d-46) then
        tmp = -x / tan(b)
    else if (f <= 1.46d+221) then
        tmp = (1.0d0 / b) - t_0
    else if (f <= 1.16d+285) then
        tmp = 1.0d0 / sin(b)
    else
        tmp = (f / (f * 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 <= -5.8e-87) {
		tmp = (F / (F * -B)) - t_0;
	} else if (F <= 1.33e-46) {
		tmp = -x / Math.tan(B);
	} else if (F <= 1.46e+221) {
		tmp = (1.0 / B) - t_0;
	} else if (F <= 1.16e+285) {
		tmp = 1.0 / Math.sin(B);
	} else {
		tmp = (F / (F * B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -5.8e-87:
		tmp = (F / (F * -B)) - t_0
	elif F <= 1.33e-46:
		tmp = -x / math.tan(B)
	elif F <= 1.46e+221:
		tmp = (1.0 / B) - t_0
	elif F <= 1.16e+285:
		tmp = 1.0 / math.sin(B)
	else:
		tmp = (F / (F * B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -5.8e-87)
		tmp = Float64(Float64(F / Float64(F * Float64(-B))) - t_0);
	elseif (F <= 1.33e-46)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 1.46e+221)
		tmp = Float64(Float64(1.0 / B) - t_0);
	elseif (F <= 1.16e+285)
		tmp = Float64(1.0 / sin(B));
	else
		tmp = Float64(Float64(F / Float64(F * B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -5.8e-87)
		tmp = (F / (F * -B)) - t_0;
	elseif (F <= 1.33e-46)
		tmp = -x / tan(B);
	elseif (F <= 1.46e+221)
		tmp = (1.0 / B) - t_0;
	elseif (F <= 1.16e+285)
		tmp = 1.0 / sin(B);
	else
		tmp = (F / (F * 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, -5.8e-87], N[(N[(F / N[(F * (-B)), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.33e-46], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.46e+221], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.16e+285], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(F * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.8 \cdot 10^{-87}:\\
\;\;\;\;\frac{F}{F \cdot \left(-B\right)} - t\_0\\

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

\mathbf{elif}\;F \leq 1.46 \cdot 10^{+221}:\\
\;\;\;\;\frac{1}{B} - t\_0\\

\mathbf{elif}\;F \leq 1.16 \cdot 10^{+285}:\\
\;\;\;\;\frac{1}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot B} - t\_0\\


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

    1. Initial program 75.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. Simplified82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative73.0%

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

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

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

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

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

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

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

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

    if -5.7999999999999998e-87 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified70.2%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num70.2%

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr70.3%

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

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

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out70.3%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      2. neg-sub070.3%

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

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

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

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

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

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

    if 1.33000000000000008e-46 < F < 1.4599999999999999e221

    1. Initial program 79.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. Simplified83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative61.5%

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

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

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

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

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

    if 1.4599999999999999e221 < F < 1.15999999999999994e285

    1. Initial program 14.3%

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

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

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right)}^{3}} \]
    5. Applied egg-rr75.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in x around 0 76.7%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}}\right)}}^{3} \]
    7. Taylor expanded in B around inf 77.6%

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

    if 1.15999999999999994e285 < F

    1. Initial program 37.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. Simplified64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative64.1%

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot F}} - \frac{x}{\tan B} \]
    13. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{F}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    14. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-87}:\\ \;\;\;\;\frac{F}{F \cdot \left(-B\right)} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.46 \cdot 10^{+221}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.16 \cdot 10^{+285}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 68.3% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -7.5 \cdot 10^{-51}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{+221}:\\ \;\;\;\;\frac{1}{B} - t\_0\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+282}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -7.5e-51)
     (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
     (if (<= F 1.33e-46)
       (/ (- x) (tan B))
       (if (<= F 1e+221)
         (- (/ 1.0 B) t_0)
         (if (<= F 5.8e+282) (/ 1.0 (sin B)) (- (/ F (* F B)) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -7.5e-51) {
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	} else if (F <= 1.33e-46) {
		tmp = -x / tan(B);
	} else if (F <= 1e+221) {
		tmp = (1.0 / B) - t_0;
	} else if (F <= 5.8e+282) {
		tmp = 1.0 / sin(B);
	} else {
		tmp = (F / (F * 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 <= (-7.5d-51)) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
    else if (f <= 1.33d-46) then
        tmp = -x / tan(b)
    else if (f <= 1d+221) then
        tmp = (1.0d0 / b) - t_0
    else if (f <= 5.8d+282) then
        tmp = 1.0d0 / sin(b)
    else
        tmp = (f / (f * 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 <= -7.5e-51) {
		tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
	} else if (F <= 1.33e-46) {
		tmp = -x / Math.tan(B);
	} else if (F <= 1e+221) {
		tmp = (1.0 / B) - t_0;
	} else if (F <= 5.8e+282) {
		tmp = 1.0 / Math.sin(B);
	} else {
		tmp = (F / (F * B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -7.5e-51:
		tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	elif F <= 1.33e-46:
		tmp = -x / math.tan(B)
	elif F <= 1e+221:
		tmp = (1.0 / B) - t_0
	elif F <= 5.8e+282:
		tmp = 1.0 / math.sin(B)
	else:
		tmp = (F / (F * B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -7.5e-51)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B));
	elseif (F <= 1.33e-46)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 1e+221)
		tmp = Float64(Float64(1.0 / B) - t_0);
	elseif (F <= 5.8e+282)
		tmp = Float64(1.0 / sin(B));
	else
		tmp = Float64(Float64(F / Float64(F * B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -7.5e-51)
		tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
	elseif (F <= 1.33e-46)
		tmp = -x / tan(B);
	elseif (F <= 1e+221)
		tmp = (1.0 / B) - t_0;
	elseif (F <= 5.8e+282)
		tmp = 1.0 / sin(B);
	else
		tmp = (F / (F * 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, -7.5e-51], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.33e-46], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+221], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.8e+282], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(F * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq 10^{+221}:\\
\;\;\;\;\frac{1}{B} - t\_0\\

\mathbf{elif}\;F \leq 5.8 \cdot 10^{+282}:\\
\;\;\;\;\frac{1}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot B} - t\_0\\


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

    1. Initial program 73.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 95.2%

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

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

    if -7.49999999999999976e-51 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified70.7%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num70.6%

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr70.7%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity70.7%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified70.7%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out70.7%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      2. neg-sub070.7%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    12. Applied egg-rr70.8%

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

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

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

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

    if 1.33000000000000008e-46 < F < 1e221

    1. Initial program 79.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. Simplified83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative61.5%

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

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

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

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

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

    if 1e221 < F < 5.80000000000000032e282

    1. Initial program 14.3%

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

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

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right)}^{3}} \]
    5. Applied egg-rr75.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in x around 0 76.7%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}}\right)}}^{3} \]
    7. Taylor expanded in B around inf 77.6%

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

    if 5.80000000000000032e282 < F

    1. Initial program 37.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. Simplified64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative64.1%

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot F}} - \frac{x}{\tan B} \]
    13. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{F}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    14. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-51}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{+221}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+282}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 69.3% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -5.5 \cdot 10^{+149}:\\
\;\;\;\;\frac{F}{F \cdot B} - t\_0\\

\mathbf{elif}\;F \leq -2.15 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -7.4999999999999998e204 or -5.49999999999999999e149 < F < -2.1500000000000001e-7

    1. Initial program 64.8%

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

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

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

    if -7.4999999999999998e204 < F < -5.49999999999999999e149

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \frac{F}{B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
      3. fma-undefine99.8%

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot F}} - \frac{x}{\tan B} \]
    13. Step-by-step derivation
      1. *-commutative99.8%

        \[\leadsto \frac{F}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    14. Simplified99.8%

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

    if -2.1500000000000001e-7 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified69.7%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num69.7%

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr69.8%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity69.8%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified69.8%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out69.8%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      2. neg-sub069.8%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    12. Applied egg-rr69.9%

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

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

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    14. Simplified69.9%

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

    if 1.33000000000000008e-46 < F

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{B \cdot \sqrt{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. +-commutative54.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{+204}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{+149}:\\ \;\;\;\;\frac{F}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.15 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 69.3% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -5.5 \cdot 10^{+149}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq -2.15 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.5e205 or -5.49999999999999999e149 < F < -2.1500000000000001e-7

    1. Initial program 64.8%

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

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

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

    if -1.5e205 < F < -5.49999999999999999e149 or 1.33000000000000008e-46 < F

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1500000000000001e-7 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified69.7%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num69.7%

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr69.8%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity69.8%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified69.8%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out69.8%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      2. neg-sub069.8%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    12. Applied egg-rr69.9%

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

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

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    14. Simplified69.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{+205}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{+149}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.15 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 57.5% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.38 \cdot 10^{-64} \lor \neg \left(x \leq 1.6 \cdot 10^{-211} \lor \neg \left(x \leq 1.85 \cdot 10^{-147}\right) \land x \leq 8.5 \cdot 10^{-43}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -1.38e-64)
         (not
          (or (<= x 1.6e-211) (and (not (<= x 1.85e-147)) (<= x 8.5e-43)))))
   (/ (- x) (tan B))
   (/ 1.0 (sin B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.38e-64) || !((x <= 1.6e-211) || (!(x <= 1.85e-147) && (x <= 8.5e-43)))) {
		tmp = -x / tan(B);
	} else {
		tmp = 1.0 / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-1.38d-64)) .or. (.not. (x <= 1.6d-211) .or. (.not. (x <= 1.85d-147)) .and. (x <= 8.5d-43))) then
        tmp = -x / tan(b)
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.38e-64) || !((x <= 1.6e-211) || (!(x <= 1.85e-147) && (x <= 8.5e-43)))) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -1.38e-64) or not ((x <= 1.6e-211) or (not (x <= 1.85e-147) and (x <= 8.5e-43))):
		tmp = -x / math.tan(B)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -1.38e-64) || !((x <= 1.6e-211) || (!(x <= 1.85e-147) && (x <= 8.5e-43))))
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -1.38e-64) || ~(((x <= 1.6e-211) || (~((x <= 1.85e-147)) && (x <= 8.5e-43)))))
		tmp = -x / tan(B);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.38e-64], N[Not[Or[LessEqual[x, 1.6e-211], And[N[Not[LessEqual[x, 1.85e-147]], $MachinePrecision], LessEqual[x, 8.5e-43]]]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.38 \cdot 10^{-64} \lor \neg \left(x \leq 1.6 \cdot 10^{-211} \lor \neg \left(x \leq 1.85 \cdot 10^{-147}\right) \land x \leq 8.5 \cdot 10^{-43}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.37999999999999998e-64

    1. Initial program 84.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 71.3%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified88.6%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt88.4%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      2. sqrt-unprod68.4%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      3. sqr-neg68.4%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      4. sqrt-unprod0.0%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      5. add-sqr-sqrt1.1%

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      7. tan-quot1.1%

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

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      9. frac-2neg1.1%

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

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

        \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{-\tan B}} \]
      12. add-sqr-sqrt0.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      13. sqrt-unprod68.6%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      14. sqr-neg68.6%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      15. sqrt-unprod88.5%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      16. add-sqr-sqrt88.9%

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

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr88.9%

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

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

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

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

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

    if -1.37999999999999998e-64 < x < 1.59999999999999993e-211 or 1.8500000000000001e-147 < x < 8.50000000000000056e-43

    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 26.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt25.8%

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in x around 0 39.6%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}}\right)}}^{3} \]
    7. Taylor expanded in B around inf 40.2%

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

    if 1.59999999999999993e-211 < x < 1.8500000000000001e-147 or 8.50000000000000056e-43 < x

    1. Initial program 93.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 76.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified82.2%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num82.1%

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

        \[\leadsto \left(-x\right) \cdot \frac{1}{\color{blue}{\tan B}} \]
      3. *-un-lft-identity82.2%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr82.2%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity82.2%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified82.2%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out82.2%

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

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    12. Applied egg-rr82.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.38 \cdot 10^{-64} \lor \neg \left(x \leq 1.6 \cdot 10^{-211} \lor \neg \left(x \leq 1.85 \cdot 10^{-147}\right) \land x \leq 8.5 \cdot 10^{-43}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 57.5% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-64} \lor \neg \left(x \leq 1.5 \cdot 10^{-211}\right) \land \left(x \leq 1.2 \cdot 10^{-147} \lor \neg \left(x \leq 8.2 \cdot 10^{-43}\right)\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -5.5e-64)
         (and (not (<= x 1.5e-211)) (or (<= x 1.2e-147) (not (<= x 8.2e-43)))))
   (/ (- x) (tan B))
   (/ 1.0 (sin B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -5.5e-64) || (!(x <= 1.5e-211) && ((x <= 1.2e-147) || !(x <= 8.2e-43)))) {
		tmp = -x / tan(B);
	} else {
		tmp = 1.0 / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-5.5d-64)) .or. (.not. (x <= 1.5d-211)) .and. (x <= 1.2d-147) .or. (.not. (x <= 8.2d-43))) then
        tmp = -x / tan(b)
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -5.5e-64) || (!(x <= 1.5e-211) && ((x <= 1.2e-147) || !(x <= 8.2e-43)))) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -5.5e-64) or (not (x <= 1.5e-211) and ((x <= 1.2e-147) or not (x <= 8.2e-43))):
		tmp = -x / math.tan(B)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -5.5e-64) || (!(x <= 1.5e-211) && ((x <= 1.2e-147) || !(x <= 8.2e-43))))
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -5.5e-64) || (~((x <= 1.5e-211)) && ((x <= 1.2e-147) || ~((x <= 8.2e-43)))))
		tmp = -x / tan(B);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -5.5e-64], And[N[Not[LessEqual[x, 1.5e-211]], $MachinePrecision], Or[LessEqual[x, 1.2e-147], N[Not[LessEqual[x, 8.2e-43]], $MachinePrecision]]]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-64} \lor \neg \left(x \leq 1.5 \cdot 10^{-211}\right) \land \left(x \leq 1.2 \cdot 10^{-147} \lor \neg \left(x \leq 8.2 \cdot 10^{-43}\right)\right):\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4999999999999999e-64 or 1.50000000000000002e-211 < x < 1.19999999999999999e-147 or 8.1999999999999996e-43 < x

    1. Initial program 91.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 74.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified84.2%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt27.1%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      2. sqrt-unprod21.7%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      3. sqr-neg21.7%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      4. sqrt-unprod0.9%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      5. add-sqr-sqrt1.2%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. div-inv1.2%

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

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

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

        \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{-\tan B}} \]
      12. add-sqr-sqrt0.9%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      13. sqrt-unprod21.8%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      14. sqr-neg21.8%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      15. sqrt-unprod27.1%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      16. add-sqr-sqrt84.4%

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

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr84.4%

      \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. div084.4%

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

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      3. distribute-frac-neg284.4%

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

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

    if -5.4999999999999999e-64 < x < 1.50000000000000002e-211 or 1.19999999999999999e-147 < x < 8.1999999999999996e-43

    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 26.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt25.8%

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in x around 0 39.6%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}}\right)}}^{3} \]
    7. Taylor expanded in B around inf 40.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-64} \lor \neg \left(x \leq 1.5 \cdot 10^{-211}\right) \land \left(x \leq 1.2 \cdot 10^{-147} \lor \neg \left(x \leq 8.2 \cdot 10^{-43}\right)\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 57.5% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;x \leq 1.8 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.5 \cdot 10^{-147}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B}\\

\mathbf{elif}\;x \leq 1.35 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.12e-64

    1. Initial program 84.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 71.3%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified88.6%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt88.4%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      2. sqrt-unprod68.4%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      3. sqr-neg68.4%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      4. sqrt-unprod0.0%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      5. add-sqr-sqrt1.1%

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      7. tan-quot1.1%

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

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      9. frac-2neg1.1%

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

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

        \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{-\tan B}} \]
      12. add-sqr-sqrt0.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      13. sqrt-unprod68.6%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      14. sqr-neg68.6%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      15. sqrt-unprod88.5%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      16. add-sqr-sqrt88.9%

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

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr88.9%

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

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

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

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

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

    if -1.12e-64 < x < 1.7999999999999999e-211 or 2.50000000000000007e-147 < x < 1.35e-42

    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 26.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt25.8%

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in x around 0 39.6%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}}\right)}}^{3} \]
    7. Taylor expanded in B around inf 40.2%

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

    if 1.7999999999999999e-211 < x < 2.50000000000000007e-147

    1. Initial program 91.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 24.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num25.1%

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr25.1%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity25.1%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified25.1%

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

    if 1.35e-42 < x

    1. Initial program 94.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified98.5%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num98.4%

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified98.5%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out98.5%

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

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    12. Applied egg-rr98.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.12 \cdot 10^{-64}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-211}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-42}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 57.4% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;x \leq 2.05 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 2.3 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.60000000000000008e-63

    1. Initial program 84.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 71.3%

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified88.6%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt88.4%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      2. sqrt-unprod68.4%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      3. sqr-neg68.4%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      4. sqrt-unprod0.0%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      5. add-sqr-sqrt1.1%

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      7. tan-quot1.1%

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

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      9. frac-2neg1.1%

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

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

        \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{-\tan B}} \]
      12. add-sqr-sqrt0.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      13. sqrt-unprod68.6%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      14. sqr-neg68.6%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      15. sqrt-unprod88.5%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      16. add-sqr-sqrt88.9%

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

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr88.9%

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

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

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

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

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

    if -3.60000000000000008e-63 < x < 2.05000000000000007e-212 or 2.39999999999999998e-147 < x < 2.30000000000000004e-42

    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 26.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt25.8%

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in x around 0 39.6%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}}\right)}}^{3} \]
    7. Taylor expanded in B around inf 40.2%

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

    if 2.05000000000000007e-212 < x < 2.39999999999999998e-147

    1. Initial program 91.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 24.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num25.1%

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    8. Applied egg-rr25.1%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\left(1 \cdot \frac{1}{\tan B}\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity25.1%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified25.1%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. tan-quot25.1%

        \[\leadsto \left(-x\right) \cdot \frac{1}{\color{blue}{\frac{\sin B}{\cos B}}} \]
      2. clear-num25.1%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{\cos B}{\sin B}} \]
      3. associate-/l*25.1%

        \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot \cos B}{\sin B}} \]
      4. clear-num25.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{\left(-x\right) \cdot \cos B}}} \]
      5. frac-2neg25.1%

        \[\leadsto \color{blue}{\frac{-1}{-\frac{\sin B}{\left(-x\right) \cdot \cos B}}} \]
      6. metadata-eval25.1%

        \[\leadsto \frac{\color{blue}{-1}}{-\frac{\sin B}{\left(-x\right) \cdot \cos B}} \]
      7. add-sqr-sqrt0.0%

        \[\leadsto \frac{-1}{-\frac{\sin B}{\color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \cos B}} \]
      8. sqrt-unprod3.2%

        \[\leadsto \frac{-1}{-\frac{\sin B}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \cos B}} \]
      9. sqr-neg3.2%

        \[\leadsto \frac{-1}{-\frac{\sin B}{\sqrt{\color{blue}{x \cdot x}} \cdot \cos B}} \]
      10. sqrt-unprod3.8%

        \[\leadsto \frac{-1}{-\frac{\sin B}{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \cos B}} \]
      11. add-sqr-sqrt3.8%

        \[\leadsto \frac{-1}{-\frac{\sin B}{\color{blue}{x} \cdot \cos B}} \]
      12. remove-double-neg3.8%

        \[\leadsto \frac{-1}{-\frac{\sin B}{\color{blue}{-\left(-x \cdot \cos B\right)}}} \]
      13. distribute-lft-neg-out3.8%

        \[\leadsto \frac{-1}{-\frac{\sin B}{-\color{blue}{\left(-x\right) \cdot \cos B}}} \]
      14. distribute-frac-neg23.8%

        \[\leadsto \frac{-1}{\color{blue}{\frac{\sin B}{-\left(-\left(-x\right) \cdot \cos B\right)}}} \]
      15. distribute-lft-neg-out3.8%

        \[\leadsto \frac{-1}{\frac{\sin B}{-\left(-\color{blue}{\left(-x \cdot \cos B\right)}\right)}} \]
      16. remove-double-neg3.8%

        \[\leadsto \frac{-1}{\frac{\sin B}{-\color{blue}{x \cdot \cos B}}} \]
      17. *-commutative3.8%

        \[\leadsto \frac{-1}{\frac{\sin B}{-\color{blue}{\cos B \cdot x}}} \]
      18. distribute-rgt-neg-out3.8%

        \[\leadsto \frac{-1}{\frac{\sin B}{\color{blue}{\cos B \cdot \left(-x\right)}}} \]
    12. Applied egg-rr25.1%

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

    if 2.30000000000000004e-42 < x

    1. Initial program 94.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified98.5%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Step-by-step derivation
      1. clear-num98.4%

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    10. Simplified98.5%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
    11. Step-by-step derivation
      1. distribute-lft-neg-out98.5%

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

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    12. Applied egg-rr98.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{-63}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{-212}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-147}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-42}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 42.3% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \leq 1.05 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;F \leq 6 \cdot 10^{+129} \lor \neg \left(F \leq 5.6 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{1}{\sin B}\\

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


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

    1. Initial program 73.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 95.2%

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

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

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

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

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

    if -1.50000000000000005e-54 < F < 1.05e-78

    1. Initial program 99.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 37.1%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg37.1%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified37.1%

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

    if 1.05e-78 < F < 6.0000000000000006e129 or 5.60000000000000033e155 < F

    1. Initial program 60.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 31.9%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in x around 0 58.6%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}}\right)}}^{3} \]
    7. Taylor expanded in B around inf 59.5%

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

    if 6.0000000000000006e129 < F < 5.60000000000000033e155

    1. Initial program 99.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 94.1%

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 63.4%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(\frac{1}{B} + \frac{1}{B \cdot x}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*63.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-78}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+129} \lor \neg \left(F \leq 5.6 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} - \frac{1}{B \cdot x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 36.2% accurate, 10.4× speedup?

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

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

\mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;F \leq 3 \cdot 10^{+126} \lor \neg \left(F \leq 1.45 \cdot 10^{+157}\right):\\
\;\;\;\;\frac{1}{\frac{B}{1 + x}}\\

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


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

    1. Initial program 73.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 95.2%

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

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

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

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

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

    if -1.29999999999999998e-53 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 34.9%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg34.9%

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

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

    if 1.33000000000000008e-46 < F < 3.0000000000000002e126 or 1.44999999999999994e157 < F

    1. Initial program 56.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. clear-num12.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{-B}{1 + x}}} \]
      2. inv-pow12.2%

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

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{-B} \cdot \sqrt{-B}}}{1 + x}\right)}^{-1} \]
      4. sqrt-unprod22.0%

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}}{1 + x}\right)}^{-1} \]
      5. sqr-neg22.0%

        \[\leadsto {\left(\frac{\sqrt{\color{blue}{B \cdot B}}}{1 + x}\right)}^{-1} \]
      6. sqrt-unprod21.5%

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

        \[\leadsto {\left(\frac{\color{blue}{B}}{1 + x}\right)}^{-1} \]
    8. Applied egg-rr33.0%

      \[\leadsto \color{blue}{{\left(\frac{B}{1 + x}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-133.0%

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

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

    if 3.0000000000000002e126 < F < 1.44999999999999994e157

    1. Initial program 99.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 94.1%

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 63.4%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(\frac{1}{B} + \frac{1}{B \cdot x}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*63.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-53}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{+126} \lor \neg \left(F \leq 1.45 \cdot 10^{+157}\right):\\ \;\;\;\;\frac{1}{\frac{B}{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} - \frac{1}{B \cdot x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 36.2% accurate, 12.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 - x}{B}\\ \mathbf{if}\;F \leq -6.8 \cdot 10^{-53}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+124} \lor \neg \left(F \leq 5.6 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{1}{\frac{B}{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- -1.0 x) B)))
   (if (<= F -6.8e-53)
     t_0
     (if (<= F 1.33e-46)
       (/ x (- B))
       (if (or (<= F 8.5e+124) (not (<= F 5.6e+155)))
         (/ 1.0 (/ B (+ 1.0 x)))
         t_0)))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 - x) / B;
	double tmp;
	if (F <= -6.8e-53) {
		tmp = t_0;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 8.5e+124) || !(F <= 5.6e+155)) {
		tmp = 1.0 / (B / (1.0 + x));
	} 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 <= (-6.8d-53)) then
        tmp = t_0
    else if (f <= 1.33d-46) then
        tmp = x / -b
    else if ((f <= 8.5d+124) .or. (.not. (f <= 5.6d+155))) then
        tmp = 1.0d0 / (b / (1.0d0 + x))
    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 <= -6.8e-53) {
		tmp = t_0;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 8.5e+124) || !(F <= 5.6e+155)) {
		tmp = 1.0 / (B / (1.0 + x));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 - x) / B
	tmp = 0
	if F <= -6.8e-53:
		tmp = t_0
	elif F <= 1.33e-46:
		tmp = x / -B
	elif (F <= 8.5e+124) or not (F <= 5.6e+155):
		tmp = 1.0 / (B / (1.0 + x))
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 - x) / B)
	tmp = 0.0
	if (F <= -6.8e-53)
		tmp = t_0;
	elseif (F <= 1.33e-46)
		tmp = Float64(x / Float64(-B));
	elseif ((F <= 8.5e+124) || !(F <= 5.6e+155))
		tmp = Float64(1.0 / Float64(B / Float64(1.0 + x)));
	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 <= -6.8e-53)
		tmp = t_0;
	elseif (F <= 1.33e-46)
		tmp = x / -B;
	elseif ((F <= 8.5e+124) || ~((F <= 5.6e+155)))
		tmp = 1.0 / (B / (1.0 + x));
	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, -6.8e-53], t$95$0, If[LessEqual[F, 1.33e-46], N[(x / (-B)), $MachinePrecision], If[Or[LessEqual[F, 8.5e+124], N[Not[LessEqual[F, 5.6e+155]], $MachinePrecision]], N[(1.0 / N[(B / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;F \leq 8.5 \cdot 10^{+124} \lor \neg \left(F \leq 5.6 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{1}{\frac{B}{1 + x}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -6.8e-53 or 8.4999999999999997e124 < F < 5.60000000000000033e155

    1. Initial program 75.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 95.2%

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

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

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

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

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

    if -6.8e-53 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 34.9%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg34.9%

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

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

    if 1.33000000000000008e-46 < F < 8.4999999999999997e124 or 5.60000000000000033e155 < F

    1. Initial program 56.5%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac212.2%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified12.2%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. clear-num12.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{-B}{1 + x}}} \]
      2. inv-pow12.2%

        \[\leadsto \color{blue}{{\left(\frac{-B}{1 + x}\right)}^{-1}} \]
      3. add-sqr-sqrt5.6%

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{-B} \cdot \sqrt{-B}}}{1 + x}\right)}^{-1} \]
      4. sqrt-unprod22.0%

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}}{1 + x}\right)}^{-1} \]
      5. sqr-neg22.0%

        \[\leadsto {\left(\frac{\sqrt{\color{blue}{B \cdot B}}}{1 + x}\right)}^{-1} \]
      6. sqrt-unprod21.5%

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{B} \cdot \sqrt{B}}}{1 + x}\right)}^{-1} \]
      7. add-sqr-sqrt33.0%

        \[\leadsto {\left(\frac{\color{blue}{B}}{1 + x}\right)}^{-1} \]
    8. Applied egg-rr33.0%

      \[\leadsto \color{blue}{{\left(\frac{B}{1 + x}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-133.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{B}{1 + x}}} \]
    10. Simplified33.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{B}{1 + x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-53}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+124} \lor \neg \left(F \leq 5.6 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{1}{\frac{B}{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 36.2% accurate, 12.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 - x}{B}\\ \mathbf{if}\;F \leq -1.05 \cdot 10^{-57}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 4.1 \cdot 10^{+129} \lor \neg \left(F \leq 7.8 \cdot 10^{+158}\right):\\ \;\;\;\;\frac{1}{B} \cdot \left(1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- -1.0 x) B)))
   (if (<= F -1.05e-57)
     t_0
     (if (<= F 1.33e-46)
       (/ x (- B))
       (if (or (<= F 4.1e+129) (not (<= F 7.8e+158)))
         (* (/ 1.0 B) (+ 1.0 x))
         t_0)))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 - x) / B;
	double tmp;
	if (F <= -1.05e-57) {
		tmp = t_0;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 4.1e+129) || !(F <= 7.8e+158)) {
		tmp = (1.0 / B) * (1.0 + x);
	} 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 <= (-1.05d-57)) then
        tmp = t_0
    else if (f <= 1.33d-46) then
        tmp = x / -b
    else if ((f <= 4.1d+129) .or. (.not. (f <= 7.8d+158))) then
        tmp = (1.0d0 / b) * (1.0d0 + x)
    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 <= -1.05e-57) {
		tmp = t_0;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 4.1e+129) || !(F <= 7.8e+158)) {
		tmp = (1.0 / B) * (1.0 + x);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 - x) / B
	tmp = 0
	if F <= -1.05e-57:
		tmp = t_0
	elif F <= 1.33e-46:
		tmp = x / -B
	elif (F <= 4.1e+129) or not (F <= 7.8e+158):
		tmp = (1.0 / B) * (1.0 + x)
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 - x) / B)
	tmp = 0.0
	if (F <= -1.05e-57)
		tmp = t_0;
	elseif (F <= 1.33e-46)
		tmp = Float64(x / Float64(-B));
	elseif ((F <= 4.1e+129) || !(F <= 7.8e+158))
		tmp = Float64(Float64(1.0 / B) * Float64(1.0 + x));
	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 <= -1.05e-57)
		tmp = t_0;
	elseif (F <= 1.33e-46)
		tmp = x / -B;
	elseif ((F <= 4.1e+129) || ~((F <= 7.8e+158)))
		tmp = (1.0 / B) * (1.0 + x);
	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, -1.05e-57], t$95$0, If[LessEqual[F, 1.33e-46], N[(x / (-B)), $MachinePrecision], If[Or[LessEqual[F, 4.1e+129], N[Not[LessEqual[F, 7.8e+158]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-1 - x}{B}\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-57}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;F \leq 4.1 \cdot 10^{+129} \lor \neg \left(F \leq 7.8 \cdot 10^{+158}\right):\\
\;\;\;\;\frac{1}{B} \cdot \left(1 + x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.05e-57 or 4.1000000000000003e129 < F < 7.8e158

    1. Initial program 75.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 95.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 52.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg52.9%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac252.9%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified52.9%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]

    if -1.05e-57 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 32.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 17.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg17.9%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac217.9%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified17.9%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 34.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/34.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg34.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified34.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.33000000000000008e-46 < F < 4.1000000000000003e129 or 7.8e158 < F

    1. Initial program 56.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 33.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 12.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg12.2%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac212.2%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified12.2%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. div-inv12.2%

        \[\leadsto \color{blue}{\left(1 + x\right) \cdot \frac{1}{-B}} \]
      2. add-sqr-sqrt5.6%

        \[\leadsto \left(1 + x\right) \cdot \frac{1}{\color{blue}{\sqrt{-B} \cdot \sqrt{-B}}} \]
      3. sqrt-unprod22.0%

        \[\leadsto \left(1 + x\right) \cdot \frac{1}{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}} \]
      4. sqr-neg22.0%

        \[\leadsto \left(1 + x\right) \cdot \frac{1}{\sqrt{\color{blue}{B \cdot B}}} \]
      5. sqrt-unprod21.5%

        \[\leadsto \left(1 + x\right) \cdot \frac{1}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      6. add-sqr-sqrt33.0%

        \[\leadsto \left(1 + x\right) \cdot \frac{1}{\color{blue}{B}} \]
    8. Applied egg-rr33.0%

      \[\leadsto \color{blue}{\left(1 + x\right) \cdot \frac{1}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.05 \cdot 10^{-57}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 4.1 \cdot 10^{+129} \lor \neg \left(F \leq 7.8 \cdot 10^{+158}\right):\\ \;\;\;\;\frac{1}{B} \cdot \left(1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 36.1% accurate, 12.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 - x}{B}\\ \mathbf{if}\;F \leq -1.3 \cdot 10^{-59}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+128} \lor \neg \left(F \leq 6.5 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{1 + x}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- -1.0 x) B)))
   (if (<= F -1.3e-59)
     t_0
     (if (<= F 1.33e-46)
       (/ x (- B))
       (if (or (<= F 1.05e+128) (not (<= F 6.5e+155))) (/ (+ 1.0 x) B) t_0)))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 - x) / B;
	double tmp;
	if (F <= -1.3e-59) {
		tmp = t_0;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 1.05e+128) || !(F <= 6.5e+155)) {
		tmp = (1.0 + x) / 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 <= (-1.3d-59)) then
        tmp = t_0
    else if (f <= 1.33d-46) then
        tmp = x / -b
    else if ((f <= 1.05d+128) .or. (.not. (f <= 6.5d+155))) then
        tmp = (1.0d0 + x) / 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 <= -1.3e-59) {
		tmp = t_0;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 1.05e+128) || !(F <= 6.5e+155)) {
		tmp = (1.0 + x) / B;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 - x) / B
	tmp = 0
	if F <= -1.3e-59:
		tmp = t_0
	elif F <= 1.33e-46:
		tmp = x / -B
	elif (F <= 1.05e+128) or not (F <= 6.5e+155):
		tmp = (1.0 + x) / 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 <= -1.3e-59)
		tmp = t_0;
	elseif (F <= 1.33e-46)
		tmp = Float64(x / Float64(-B));
	elseif ((F <= 1.05e+128) || !(F <= 6.5e+155))
		tmp = Float64(Float64(1.0 + x) / 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 <= -1.3e-59)
		tmp = t_0;
	elseif (F <= 1.33e-46)
		tmp = x / -B;
	elseif ((F <= 1.05e+128) || ~((F <= 6.5e+155)))
		tmp = (1.0 + x) / 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, -1.3e-59], t$95$0, If[LessEqual[F, 1.33e-46], N[(x / (-B)), $MachinePrecision], If[Or[LessEqual[F, 1.05e+128], N[Not[LessEqual[F, 6.5e+155]], $MachinePrecision]], N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-1 - x}{B}\\
\mathbf{if}\;F \leq -1.3 \cdot 10^{-59}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;F \leq 1.05 \cdot 10^{+128} \lor \neg \left(F \leq 6.5 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{1 + x}{B}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.29999999999999999e-59 or 1.05e128 < F < 6.50000000000000046e155

    1. Initial program 75.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 95.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 52.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg52.9%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac252.9%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified52.9%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]

    if -1.29999999999999999e-59 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 32.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 17.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg17.9%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac217.9%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified17.9%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 34.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/34.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg34.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified34.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.33000000000000008e-46 < F < 1.05e128 or 6.50000000000000046e155 < F

    1. Initial program 56.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 33.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt33.1%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}} \cdot \sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right) \cdot \sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}} \]
      2. pow333.1%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right)}^{3}} \]
    5. Applied egg-rr62.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in B around 0 33.0%

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-59}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+128} \lor \neg \left(F \leq 6.5 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{1 + x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 29.0% accurate, 12.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{+59}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+125} \lor \neg \left(F \leq 1.65 \cdot 10^{+159}\right):\\ \;\;\;\;\frac{1 + x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.7e+59)
   (/ -1.0 B)
   (if (<= F 1.33e-46)
     (/ x (- B))
     (if (or (<= F 6.2e+125) (not (<= F 1.65e+159)))
       (/ (+ 1.0 x) B)
       (* x (/ -1.0 B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.7e+59) {
		tmp = -1.0 / B;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 6.2e+125) || !(F <= 1.65e+159)) {
		tmp = (1.0 + x) / B;
	} else {
		tmp = x * (-1.0 / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.7d+59)) then
        tmp = (-1.0d0) / b
    else if (f <= 1.33d-46) then
        tmp = x / -b
    else if ((f <= 6.2d+125) .or. (.not. (f <= 1.65d+159))) then
        tmp = (1.0d0 + x) / b
    else
        tmp = x * ((-1.0d0) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.7e+59) {
		tmp = -1.0 / B;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 6.2e+125) || !(F <= 1.65e+159)) {
		tmp = (1.0 + x) / B;
	} else {
		tmp = x * (-1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.7e+59:
		tmp = -1.0 / B
	elif F <= 1.33e-46:
		tmp = x / -B
	elif (F <= 6.2e+125) or not (F <= 1.65e+159):
		tmp = (1.0 + x) / B
	else:
		tmp = x * (-1.0 / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.7e+59)
		tmp = Float64(-1.0 / B);
	elseif (F <= 1.33e-46)
		tmp = Float64(x / Float64(-B));
	elseif ((F <= 6.2e+125) || !(F <= 1.65e+159))
		tmp = Float64(Float64(1.0 + x) / B);
	else
		tmp = Float64(x * Float64(-1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.7e+59)
		tmp = -1.0 / B;
	elseif (F <= 1.33e-46)
		tmp = x / -B;
	elseif ((F <= 6.2e+125) || ~((F <= 1.65e+159)))
		tmp = (1.0 + x) / B;
	else
		tmp = x * (-1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.7e+59], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 1.33e-46], N[(x / (-B)), $MachinePrecision], If[Or[LessEqual[F, 6.2e+125], N[Not[LessEqual[F, 1.65e+159]], $MachinePrecision]], N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision], N[(x * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.7 \cdot 10^{+59}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;F \leq 6.2 \cdot 10^{+125} \lor \neg \left(F \leq 1.65 \cdot 10^{+159}\right):\\
\;\;\;\;\frac{1 + x}{B}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.70000000000000003e59

    1. Initial program 64.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 50.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg50.2%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac250.2%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified50.2%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 32.5%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if -1.70000000000000003e59 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 40.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 24.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg24.7%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac224.7%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 36.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/36.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg36.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified36.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.33000000000000008e-46 < F < 6.2e125 or 1.6499999999999999e159 < F

    1. Initial program 56.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 33.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt33.1%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}} \cdot \sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right) \cdot \sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}} \]
      2. pow333.1%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right)}^{3}} \]
    5. Applied egg-rr62.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in B around 0 33.0%

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]

    if 6.2e125 < F < 1.6499999999999999e159

    1. Initial program 99.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 94.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in x around inf 94.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg94.3%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-/l*94.3%

        \[\leadsto -\color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
      3. distribute-lft-neg-in94.3%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    6. Simplified94.3%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
    7. Taylor expanded in B around 0 63.4%

      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{1}{B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification35.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{+59}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+125} \lor \neg \left(F \leq 1.65 \cdot 10^{+159}\right):\\ \;\;\;\;\frac{1 + x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 29.3% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e+56)
   (/ -1.0 B)
   (if (<= F 1.33e-46) (/ x (- B)) (/ (+ 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e+56) {
		tmp = -1.0 / B;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else {
		tmp = (1.0 + x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-3d+56)) then
        tmp = (-1.0d0) / b
    else if (f <= 1.33d-46) then
        tmp = x / -b
    else
        tmp = (1.0d0 + x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e+56) {
		tmp = -1.0 / B;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else {
		tmp = (1.0 + x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e+56:
		tmp = -1.0 / B
	elif F <= 1.33e-46:
		tmp = x / -B
	else:
		tmp = (1.0 + x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e+56)
		tmp = Float64(-1.0 / B);
	elseif (F <= 1.33e-46)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(1.0 + x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3e+56)
		tmp = -1.0 / B;
	elseif (F <= 1.33e-46)
		tmp = x / -B;
	else
		tmp = (1.0 + x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e+56], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 1.33e-46], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 + x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3.00000000000000006e56

    1. Initial program 64.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 50.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg50.2%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac250.2%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified50.2%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 32.5%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if -3.00000000000000006e56 < F < 1.33000000000000008e-46

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 40.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 24.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg24.7%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac224.7%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 36.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/36.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg36.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified36.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.33000000000000008e-46 < F

    1. Initial program 61.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 39.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt39.2%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}} \cdot \sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right) \cdot \sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}} \]
      2. pow339.2%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}}\right)}^{3}} \]
    5. Applied egg-rr56.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{1}{\sin B} + \frac{x}{\tan B}}\right)}^{3}} \]
    6. Taylor expanded in B around 0 29.8%

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification33.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 28: 28.9% accurate, 35.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6.8e+56) (/ -1.0 B) (/ x (- B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.8e+56) {
		tmp = -1.0 / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-6.8d+56)) then
        tmp = (-1.0d0) / b
    else
        tmp = x / -b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.8e+56) {
		tmp = -1.0 / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6.8e+56:
		tmp = -1.0 / B
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6.8e+56)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(x / Float64(-B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -6.8e+56)
		tmp = -1.0 / B;
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6.8e+56], N[(-1.0 / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.8 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -6.80000000000000002e56

    1. Initial program 64.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 50.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg50.2%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac250.2%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified50.2%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 32.5%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if -6.80000000000000002e56 < F

    1. Initial program 84.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 40.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 21.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg21.8%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac221.8%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified21.8%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 29.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/29.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg29.3%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified29.3%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 29: 10.5% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 79.3%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in F around -inf 54.6%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  4. Taylor expanded in B around 0 28.7%

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  5. Step-by-step derivation
    1. mul-1-neg28.7%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    2. distribute-neg-frac228.7%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  6. Simplified28.7%

    \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  7. Taylor expanded in x around 0 11.2%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024103 
(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))))))