VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.9% → 99.6%
Time: 16.2s
Alternatives: 20
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 20 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.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -20000000000000:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{+24}:\\ \;\;\;\;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 -20000000000000.0)
     (+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
     (if (<= F 1.4e+24)
       (- (* 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 <= -20000000000000.0) {
		tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
	} else if (F <= 1.4e+24) {
		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 <= -20000000000000.0)
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B)));
	elseif (F <= 1.4e+24)
		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, -20000000000000.0], 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.4e+24], 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 -20000000000000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 1.4 \cdot 10^{+24}:\\
\;\;\;\;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 < -2e13

    1. Initial program 68.7%

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

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

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

    if -2e13 < F < 1.4000000000000001e24

    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 1.4000000000000001e24 < F

    1. Initial program 58.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. Simplified66.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 66.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/66.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -20000000000000:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{+24}:\\ \;\;\;\;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.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{+61}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 120000000:\\ \;\;\;\;\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 -5e+61)
     (+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
     (if (<= F 120000000.0)
       (- (/ 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 <= -5e+61) {
		tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
	} else if (F <= 120000000.0) {
		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 <= -5e+61)
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B)));
	elseif (F <= 120000000.0)
		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, -5e+61], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 120000000.0], 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 \cdot 10^{+61}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;\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.00000000000000018e61

    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. Step-by-step derivation
      1. div-inv99.9%

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

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

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

    if -5.00000000000000018e61 < F < 1.2e8

    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 1.2e8 < F

    1. Initial program 59.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified67.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 67.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/67.7%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around inf 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 \cdot 10^{+61}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 120000000:\\ \;\;\;\;\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.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 120000000:\\ \;\;\;\;\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 -4e+56)
     (+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
     (if (<= F 120000000.0)
       (- (/ 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 <= -4e+56) {
		tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
	} else if (F <= 120000000.0) {
		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 <= -4e+56)
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B)));
	elseif (F <= 120000000.0)
		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, -4e+56], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 120000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(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 -4 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;\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 < -4.00000000000000037e56

    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. Step-by-step derivation
      1. div-inv99.9%

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

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

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

    if -4.00000000000000037e56 < F < 1.2e8

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

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

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

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

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

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

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

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

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

    if 1.2e8 < F

    1. Initial program 59.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified67.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 67.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/67.7%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around inf 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 -4 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 120000000:\\ \;\;\;\;\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.6% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 85000000:\\
\;\;\;\;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 < -1.05e8

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

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

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

    if -1.05e8 < F < 8.5e7

    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-inv34.7%

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

        \[\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 8.5e7 < F

    1. Initial program 59.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified67.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 67.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/67.7%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around inf 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 -105000000:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 85000000:\\ \;\;\;\;\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.2% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 38000000:\\
\;\;\;\;\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 < -2.1e-7

    1. Initial program 70.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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 -2.1e-7 < F < 3.8e7

    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.8e7 < F

    1. Initial program 59.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified67.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 67.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/67.7%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around inf 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 -2.1 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 38000000:\\ \;\;\;\;\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: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.35:\\ \;\;\;\;\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 -1.35)
     (+ (/ -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 <= -1.35) {
		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 <= (-1.35d0)) 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 <= -1.35) {
		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 <= -1.35:
		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 <= -1.35)
		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 <= -1.35)
		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, -1.35], 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 -1.35:\\
\;\;\;\;\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 < -1.3500000000000001

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

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

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

    if -1.3500000000000001 < 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 -1.35:\\ \;\;\;\;\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 7: 90.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.05 \cdot 10^{-21}:\\ \;\;\;\;\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 -1.05e-21)
     (+ (/ -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 <= -1.05e-21) {
		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 <= (-1.05d-21)) 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 <= -1.05e-21) {
		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 <= -1.05e-21:
		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 <= -1.05e-21)
		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 <= -1.05e-21)
		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, -1.05e-21], 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 -1.05 \cdot 10^{-21}:\\
\;\;\;\;\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 < -1.05000000000000006e-21

    1. Initial program 71.8%

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

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

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

    if -1.05000000000000006e-21 < 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 88.7%

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

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

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

      \[\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 -1.05 \cdot 10^{-21}:\\ \;\;\;\;\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 8: 90.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.05 \cdot 10^{-21}:\\ \;\;\;\;\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 -1.05e-21)
     (- (/ -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 <= -1.05e-21) {
		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 <= (-1.05d-21)) 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 <= -1.05e-21) {
		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 <= -1.05e-21:
		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 <= -1.05e-21)
		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 <= -1.05e-21)
		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, -1.05e-21], 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 -1.05 \cdot 10^{-21}:\\
\;\;\;\;\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 < -1.05000000000000006e-21

    1. Initial program 71.8%

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

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

    if -1.05000000000000006e-21 < 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 88.7%

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

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

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

      \[\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 -1.05 \cdot 10^{-21}:\\ \;\;\;\;\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 9: 83.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.5:\\ \;\;\;\;\frac{-1}{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 -1.5)
     (- (/ -1.0 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 <= -1.5) {
		tmp = (-1.0 / 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 <= (-1.5d0)) then
        tmp = ((-1.0d0) / 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 <= -1.5) {
		tmp = (-1.0 / 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 <= -1.5:
		tmp = (-1.0 / 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 <= -1.5)
		tmp = Float64(Float64(-1.0 / 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 <= -1.5)
		tmp = (-1.0 / 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, -1.5], N[(N[(-1.0 / B), $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 -1.5:\\
\;\;\;\;\frac{-1}{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 < -1.5

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

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

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

    if -1.5 < 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.6%

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

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

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

      \[\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 -1.5:\\ \;\;\;\;\frac{-1}{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: 76.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.9 \cdot 10^{-77}:\\ \;\;\;\;\frac{F}{F \cdot \left(-B\right)} - t\_0\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-50}:\\ \;\;\;\;\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 -1.9e-77)
     (- (/ F (* F (- B))) t_0)
     (if (<= F 8e-50) (/ (- 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 <= -1.9e-77) {
		tmp = (F / (F * -B)) - t_0;
	} else if (F <= 8e-50) {
		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 <= (-1.9d-77)) then
        tmp = (f / (f * -b)) - t_0
    else if (f <= 8d-50) 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 <= -1.9e-77) {
		tmp = (F / (F * -B)) - t_0;
	} else if (F <= 8e-50) {
		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 <= -1.9e-77:
		tmp = (F / (F * -B)) - t_0
	elif F <= 8e-50:
		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 <= -1.9e-77)
		tmp = Float64(Float64(F / Float64(F * Float64(-B))) - t_0);
	elseif (F <= 8e-50)
		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 <= -1.9e-77)
		tmp = (F / (F * -B)) - t_0;
	elseif (F <= 8e-50)
		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, -1.9e-77], N[(N[(F / N[(F * (-B)), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 8e-50], 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 -1.9 \cdot 10^{-77}:\\
\;\;\;\;\frac{F}{F \cdot \left(-B\right)} - t\_0\\

\mathbf{elif}\;F \leq 8 \cdot 10^{-50}:\\
\;\;\;\;\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 < -1.8999999999999999e-77

    1. Initial program 75.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. Simplified82.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 82.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/82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8999999999999999e-77 < F < 8.00000000000000006e-50

    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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.00000000000000006e-50 < 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 -1.9 \cdot 10^{-77}:\\ \;\;\;\;\frac{F}{F \cdot \left(-B\right)} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-50}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 62.0% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -3.9 \cdot 10^{+119}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -1350:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{+219} \lor \neg \left(F \leq 5.8 \cdot 10^{+287}\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 -3.9e+119)
     t_0
     (if (<= F -1350.0)
       (/ (- -1.0 x) B)
       (if (<= F 1.33e-46)
         t_0
         (if (or (<= F 5.5e+219) (not (<= F 5.8e+287)))
           (- (/ 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 <= -3.9e+119) {
		tmp = t_0;
	} else if (F <= -1350.0) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.33e-46) {
		tmp = t_0;
	} else if ((F <= 5.5e+219) || !(F <= 5.8e+287)) {
		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 <= (-3.9d+119)) then
        tmp = t_0
    else if (f <= (-1350.0d0)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.33d-46) then
        tmp = t_0
    else if ((f <= 5.5d+219) .or. (.not. (f <= 5.8d+287))) 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 <= -3.9e+119) {
		tmp = t_0;
	} else if (F <= -1350.0) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.33e-46) {
		tmp = t_0;
	} else if ((F <= 5.5e+219) || !(F <= 5.8e+287)) {
		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 <= -3.9e+119:
		tmp = t_0
	elif F <= -1350.0:
		tmp = (-1.0 - x) / B
	elif F <= 1.33e-46:
		tmp = t_0
	elif (F <= 5.5e+219) or not (F <= 5.8e+287):
		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 <= -3.9e+119)
		tmp = t_0;
	elseif (F <= -1350.0)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.33e-46)
		tmp = t_0;
	elseif ((F <= 5.5e+219) || !(F <= 5.8e+287))
		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 <= -3.9e+119)
		tmp = t_0;
	elseif (F <= -1350.0)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.33e-46)
		tmp = t_0;
	elseif ((F <= 5.5e+219) || ~((F <= 5.8e+287)))
		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, -3.9e+119], t$95$0, If[LessEqual[F, -1350.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.33e-46], t$95$0, If[Or[LessEqual[F, 5.5e+219], N[Not[LessEqual[F, 5.8e+287]], $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 -3.9 \cdot 10^{+119}:\\
\;\;\;\;t\_0\\

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

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

\mathbf{elif}\;F \leq 5.5 \cdot 10^{+219} \lor \neg \left(F \leq 5.8 \cdot 10^{+287}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.8999999999999998e119 or -1350 < F < 1.33000000000000008e-46

    1. Initial program 85.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 54.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8999999999999998e119 < F < -1350

    1. Initial program 96.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 99.9%

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

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

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

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

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

    if 1.33000000000000008e-46 < F < 5.49999999999999973e219 or 5.80000000000000023e287 < F

    1. Initial program 75.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. Simplified82.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 82.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/82.1%

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

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

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

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

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

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

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

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

      \[\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 62.9%

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

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

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

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

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

    if 5.49999999999999973e219 < F < 5.80000000000000023e287

    1. Initial program 13.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 23.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.9 \cdot 10^{+119}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -1350:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{+219} \lor \neg \left(F \leq 5.8 \cdot 10^{+287}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 68.0% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.25 \cdot 10^{-77}:\\ \;\;\;\;\frac{F}{F \cdot \left(-B\right)} - t\_0\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-48}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{+219} \lor \neg \left(F \leq 2.65 \cdot 10^{+289}\right):\\ \;\;\;\;\frac{1}{B} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.25e-77)
     (- (/ F (* F (- B))) t_0)
     (if (<= F 3.5e-48)
       (/ (- x) (tan B))
       (if (or (<= F 7.8e+219) (not (<= F 2.65e+289)))
         (- (/ 1.0 B) t_0)
         (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.25e-77) {
		tmp = (F / (F * -B)) - t_0;
	} else if (F <= 3.5e-48) {
		tmp = -x / tan(B);
	} else if ((F <= 7.8e+219) || !(F <= 2.65e+289)) {
		tmp = (1.0 / B) - t_0;
	} 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 <= (-1.25d-77)) then
        tmp = (f / (f * -b)) - t_0
    else if (f <= 3.5d-48) then
        tmp = -x / tan(b)
    else if ((f <= 7.8d+219) .or. (.not. (f <= 2.65d+289))) then
        tmp = (1.0d0 / b) - t_0
    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 <= -1.25e-77) {
		tmp = (F / (F * -B)) - t_0;
	} else if (F <= 3.5e-48) {
		tmp = -x / Math.tan(B);
	} else if ((F <= 7.8e+219) || !(F <= 2.65e+289)) {
		tmp = (1.0 / B) - t_0;
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.25e-77:
		tmp = (F / (F * -B)) - t_0
	elif F <= 3.5e-48:
		tmp = -x / math.tan(B)
	elif (F <= 7.8e+219) or not (F <= 2.65e+289):
		tmp = (1.0 / B) - t_0
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.25e-77)
		tmp = Float64(Float64(F / Float64(F * Float64(-B))) - t_0);
	elseif (F <= 3.5e-48)
		tmp = Float64(Float64(-x) / tan(B));
	elseif ((F <= 7.8e+219) || !(F <= 2.65e+289))
		tmp = Float64(Float64(1.0 / B) - t_0);
	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 <= -1.25e-77)
		tmp = (F / (F * -B)) - t_0;
	elseif (F <= 3.5e-48)
		tmp = -x / tan(B);
	elseif ((F <= 7.8e+219) || ~((F <= 2.65e+289)))
		tmp = (1.0 / B) - t_0;
	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, -1.25e-77], N[(N[(F / N[(F * (-B)), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.5e-48], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 7.8e+219], N[Not[LessEqual[F, 2.65e+289]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $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 -1.25 \cdot 10^{-77}:\\
\;\;\;\;\frac{F}{F \cdot \left(-B\right)} - t\_0\\

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

\mathbf{elif}\;F \leq 7.8 \cdot 10^{+219} \lor \neg \left(F \leq 2.65 \cdot 10^{+289}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\

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


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

    1. Initial program 75.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. Simplified82.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 82.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/82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.24999999999999991e-77 < F < 3.49999999999999991e-48

    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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.49999999999999991e-48 < F < 7.7999999999999998e219 or 2.65e289 < F

    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. Simplified82.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 82.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/82.4%

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

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

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

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

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

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

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

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

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

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

    if 7.7999999999999998e219 < F < 2.65e289

    1. Initial program 13.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 23.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-77}:\\ \;\;\;\;\frac{F}{F \cdot \left(-B\right)} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-48}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{+219} \lor \neg \left(F \leq 2.65 \cdot 10^{+289}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 68.3% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{+219} \lor \neg \left(F \leq 2.8 \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
 (if (<= F -8e-52)
   (- (/ -1.0 B) (* x (/ 1.0 (tan B))))
   (if (<= F 1.33e-46)
     (/ (- x) (tan B))
     (if (or (<= F 3e+219) (not (<= F 2.8e+282)))
       (- (/ 1.0 B) (/ x (tan B)))
       (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -8e-52) {
		tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
	} else if (F <= 1.33e-46) {
		tmp = -x / tan(B);
	} else if ((F <= 3e+219) || !(F <= 2.8e+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) :: tmp
    if (f <= (-8d-52)) then
        tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
    else if (f <= 1.33d-46) then
        tmp = -x / tan(b)
    else if ((f <= 3d+219) .or. (.not. (f <= 2.8d+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 tmp;
	if (F <= -8e-52) {
		tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
	} else if (F <= 1.33e-46) {
		tmp = -x / Math.tan(B);
	} else if ((F <= 3e+219) || !(F <= 2.8e+282)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -8e-52:
		tmp = (-1.0 / B) - (x * (1.0 / math.tan(B)))
	elif F <= 1.33e-46:
		tmp = -x / math.tan(B)
	elif (F <= 3e+219) or not (F <= 2.8e+282):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -8e-52)
		tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	elseif (F <= 1.33e-46)
		tmp = Float64(Float64(-x) / tan(B));
	elseif ((F <= 3e+219) || !(F <= 2.8e+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)
	tmp = 0.0;
	if (F <= -8e-52)
		tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
	elseif (F <= 1.33e-46)
		tmp = -x / tan(B);
	elseif ((F <= 3e+219) || ~((F <= 2.8e+282)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -8e-52], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.33e-46], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 3e+219], N[Not[LessEqual[F, 2.8e+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}
\mathbf{if}\;F \leq -8 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

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

\mathbf{elif}\;F \leq 3 \cdot 10^{+219} \lor \neg \left(F \leq 2.8 \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 4 regimes
  2. if F < -8.0000000000000001e-52

    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 -8.0000000000000001e-52 < 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. add-sqr-sqrt19.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.33000000000000008e-46 < F < 2.9999999999999997e219 or 2.7999999999999998e282 < F

    1. Initial program 75.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. Simplified82.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 82.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/82.1%

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

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

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

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

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

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

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

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

      \[\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 62.9%

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

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

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

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

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

    if 2.9999999999999997e219 < F < 2.7999999999999998e282

    1. Initial program 13.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 23.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{+219} \lor \neg \left(F \leq 2.8 \cdot 10^{+282}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 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 -5.8 \cdot 10^{+209}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{+149}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-5}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-52}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \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 -5.8e+209)
     t_1
     (if (<= F -5.5e+149)
       t_0
       (if (<= F -3.5e-5)
         t_1
         (if (<= F 4.6e-52) t_0 (- (/ 1.0 B) (/ x (tan B)))))))))
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 <= -5.8e+209) {
		tmp = t_1;
	} else if (F <= -5.5e+149) {
		tmp = t_0;
	} else if (F <= -3.5e-5) {
		tmp = t_1;
	} else if (F <= 4.6e-52) {
		tmp = t_0;
	} else {
		tmp = (1.0 / B) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = -x / tan(b)
    t_1 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-5.8d+209)) then
        tmp = t_1
    else if (f <= (-5.5d+149)) then
        tmp = t_0
    else if (f <= (-3.5d-5)) then
        tmp = t_1
    else if (f <= 4.6d-52) then
        tmp = t_0
    else
        tmp = (1.0d0 / b) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -x / Math.tan(B);
	double t_1 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -5.8e+209) {
		tmp = t_1;
	} else if (F <= -5.5e+149) {
		tmp = t_0;
	} else if (F <= -3.5e-5) {
		tmp = t_1;
	} else if (F <= 4.6e-52) {
		tmp = t_0;
	} else {
		tmp = (1.0 / B) - (x / Math.tan(B));
	}
	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 <= -5.8e+209:
		tmp = t_1
	elif F <= -5.5e+149:
		tmp = t_0
	elif F <= -3.5e-5:
		tmp = t_1
	elif F <= 4.6e-52:
		tmp = t_0
	else:
		tmp = (1.0 / B) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -5.8e+209)
		tmp = t_1;
	elseif (F <= -5.5e+149)
		tmp = t_0;
	elseif (F <= -3.5e-5)
		tmp = t_1;
	elseif (F <= 4.6e-52)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	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 <= -5.8e+209)
		tmp = t_1;
	elseif (F <= -5.5e+149)
		tmp = t_0;
	elseif (F <= -3.5e-5)
		tmp = t_1;
	elseif (F <= 4.6e-52)
		tmp = t_0;
	else
		tmp = (1.0 / B) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.8e+209], t$95$1, If[LessEqual[F, -5.5e+149], t$95$0, If[LessEqual[F, -3.5e-5], t$95$1, If[LessEqual[F, 4.6e-52], t$95$0, N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $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 -5.8 \cdot 10^{+209}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;F \leq -3.5 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 4.6 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.79999999999999999e209 or -5.49999999999999999e149 < F < -3.4999999999999997e-5

    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. 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.2%

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

    if -5.79999999999999999e209 < F < -5.49999999999999999e149 or -3.4999999999999997e-5 < F < 4.59999999999999989e-52

    1. Initial program 98.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 41.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999989e-52 < 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. Step-by-step derivation
      1. clear-num69.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-inv69.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-pow69.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-pow169.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-eval69.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-rr69.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 53.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{+209}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{+149}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-52}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 57.5% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-64} \lor \neg \left(x \leq 1.08 \cdot 10^{-212} \lor \neg \left(x \leq 1.35 \cdot 10^{-147}\right) \land x \leq 1.3 \cdot 10^{-42}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -7.2e-64)
         (not
          (or (<= x 1.08e-212) (and (not (<= x 1.35e-147)) (<= x 1.3e-42)))))
   (/ (- x) (tan B))
   (/ 1.0 (sin B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -7.2e-64) || !((x <= 1.08e-212) || (!(x <= 1.35e-147) && (x <= 1.3e-42)))) {
		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 <= (-7.2d-64)) .or. (.not. (x <= 1.08d-212) .or. (.not. (x <= 1.35d-147)) .and. (x <= 1.3d-42))) 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 <= -7.2e-64) || !((x <= 1.08e-212) || (!(x <= 1.35e-147) && (x <= 1.3e-42)))) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -7.2e-64) or not ((x <= 1.08e-212) or (not (x <= 1.35e-147) and (x <= 1.3e-42))):
		tmp = -x / math.tan(B)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -7.2e-64) || !((x <= 1.08e-212) || (!(x <= 1.35e-147) && (x <= 1.3e-42))))
		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 <= -7.2e-64) || ~(((x <= 1.08e-212) || (~((x <= 1.35e-147)) && (x <= 1.3e-42)))))
		tmp = -x / tan(B);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -7.2e-64], N[Not[Or[LessEqual[x, 1.08e-212], And[N[Not[LessEqual[x, 1.35e-147]], $MachinePrecision], LessEqual[x, 1.3e-42]]]], $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 -7.2 \cdot 10^{-64} \lor \neg \left(x \leq 1.08 \cdot 10^{-212} \lor \neg \left(x \leq 1.35 \cdot 10^{-147}\right) \land x \leq 1.3 \cdot 10^{-42}\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 < -7.1999999999999996e-64 or 1.08e-212 < x < 1.35e-147 or 1.3e-42 < 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 -7.1999999999999996e-64 < x < 1.08e-212 or 1.35e-147 < x < 1.3e-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}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-64} \lor \neg \left(x \leq 1.08 \cdot 10^{-212} \lor \neg \left(x \leq 1.35 \cdot 10^{-147}\right) \land x \leq 1.3 \cdot 10^{-42}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 42.3% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 - x}{B}\\ \mathbf{if}\;F \leq -1.35 \cdot 10^{-53}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{+129} \lor \neg \left(F \leq 5.6 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{1}{\sin 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.35e-53)
     t_0
     (if (<= F 6.8e-79)
       (/ x (- B))
       (if (or (<= F 6.8e+129) (not (<= F 5.6e+155))) (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 - x) / B;
	double tmp;
	if (F <= -1.35e-53) {
		tmp = t_0;
	} else if (F <= 6.8e-79) {
		tmp = x / -B;
	} else if ((F <= 6.8e+129) || !(F <= 5.6e+155)) {
		tmp = 1.0 / sin(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.35d-53)) then
        tmp = t_0
    else if (f <= 6.8d-79) then
        tmp = x / -b
    else if ((f <= 6.8d+129) .or. (.not. (f <= 5.6d+155))) then
        tmp = 1.0d0 / sin(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.35e-53) {
		tmp = t_0;
	} else if (F <= 6.8e-79) {
		tmp = x / -B;
	} else if ((F <= 6.8e+129) || !(F <= 5.6e+155)) {
		tmp = 1.0 / Math.sin(B);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 - x) / B
	tmp = 0
	if F <= -1.35e-53:
		tmp = t_0
	elif F <= 6.8e-79:
		tmp = x / -B
	elif (F <= 6.8e+129) or not (F <= 5.6e+155):
		tmp = 1.0 / math.sin(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.35e-53)
		tmp = t_0;
	elseif (F <= 6.8e-79)
		tmp = Float64(x / Float64(-B));
	elseif ((F <= 6.8e+129) || !(F <= 5.6e+155))
		tmp = Float64(1.0 / sin(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.35e-53)
		tmp = t_0;
	elseif (F <= 6.8e-79)
		tmp = x / -B;
	elseif ((F <= 6.8e+129) || ~((F <= 5.6e+155)))
		tmp = 1.0 / sin(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.35e-53], t$95$0, If[LessEqual[F, 6.8e-79], N[(x / (-B)), $MachinePrecision], If[Or[LessEqual[F, 6.8e+129], N[Not[LessEqual[F, 5.6e+155]], $MachinePrecision]], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 6.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;F \leq 6.8 \cdot 10^{+129} \lor \neg \left(F \leq 5.6 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{1}{\sin B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.35e-53 or 6.80000000000000036e129 < 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 -1.35e-53 < F < 6.79999999999999951e-79

    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 6.79999999999999951e-79 < F < 6.80000000000000036e129 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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{-53}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{+129} \lor \neg \left(F \leq 5.6 \cdot 10^{+155}\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 36.2% accurate, 12.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 - x}{B}\\ \mathbf{if}\;F \leq -7.6 \cdot 10^{-57}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 1.08 \cdot 10^{+129} \lor \neg \left(F \leq 1.12 \cdot 10^{+158}\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 -7.6e-57)
     t_0
     (if (<= F 1.33e-46)
       (/ x (- B))
       (if (or (<= F 1.08e+129) (not (<= F 1.12e+158)))
         (/ (+ 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 <= -7.6e-57) {
		tmp = t_0;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 1.08e+129) || !(F <= 1.12e+158)) {
		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 <= (-7.6d-57)) then
        tmp = t_0
    else if (f <= 1.33d-46) then
        tmp = x / -b
    else if ((f <= 1.08d+129) .or. (.not. (f <= 1.12d+158))) 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 <= -7.6e-57) {
		tmp = t_0;
	} else if (F <= 1.33e-46) {
		tmp = x / -B;
	} else if ((F <= 1.08e+129) || !(F <= 1.12e+158)) {
		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 <= -7.6e-57:
		tmp = t_0
	elif F <= 1.33e-46:
		tmp = x / -B
	elif (F <= 1.08e+129) or not (F <= 1.12e+158):
		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 <= -7.6e-57)
		tmp = t_0;
	elseif (F <= 1.33e-46)
		tmp = Float64(x / Float64(-B));
	elseif ((F <= 1.08e+129) || !(F <= 1.12e+158))
		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 <= -7.6e-57)
		tmp = t_0;
	elseif (F <= 1.33e-46)
		tmp = x / -B;
	elseif ((F <= 1.08e+129) || ~((F <= 1.12e+158)))
		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, -7.6e-57], t$95$0, If[LessEqual[F, 1.33e-46], N[(x / (-B)), $MachinePrecision], If[Or[LessEqual[F, 1.08e+129], N[Not[LessEqual[F, 1.12e+158]], $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 -7.6 \cdot 10^{-57}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 1.08 \cdot 10^{+129} \lor \neg \left(F \leq 1.12 \cdot 10^{+158}\right):\\
\;\;\;\;\frac{1 + x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -7.5999999999999995e-57 or 1.08e129 < F < 1.1200000000000001e158

    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 -7.5999999999999995e-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 < 1.08e129 or 1.1200000000000001e158 < 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 -7.6 \cdot 10^{-57}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.33 \cdot 10^{-46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 1.08 \cdot 10^{+129} \lor \neg \left(F \leq 1.12 \cdot 10^{+158}\right):\\ \;\;\;\;\frac{1 + x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 29.3% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.1 \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 -3.1e+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 <= -3.1e+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 <= (-3.1d+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 <= -3.1e+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 <= -3.1e+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 <= -3.1e+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 <= -3.1e+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, -3.1e+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.1 \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.10000000000000005e56

    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.10000000000000005e56 < 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.1 \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 19: 29.0% accurate, 35.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x) :precision binary64 (if (<= F -3e+56) (/ -1.0 B) (/ x (- B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e+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 <= (-3d+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 <= -3e+56) {
		tmp = -1.0 / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e+56:
		tmp = -1.0 / B
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e+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 <= -3e+56)
		tmp = -1.0 / B;
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e+56], N[(-1.0 / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \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 < -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. 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 -3 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 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))))))