VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.0% → 99.7%
Time: 19.4s
Alternatives: 25
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 25 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: 77.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.8× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

    if -1.89999999999999999e53 < F < 5e7

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

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

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

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

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

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

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

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

    if 5e7 < F

    1. Initial program 56.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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

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

Alternative 2: 99.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 57.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. Simplified70.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 70.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/70.2%

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

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

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

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

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

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

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

    if -1.4e10 < F < 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. Simplified99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{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 5e7 < F

    1. Initial program 56.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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

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

Alternative 3: 99.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 17.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. Simplified32.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 32.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/32.2%

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

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

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

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

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

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

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

    if -2e156 < F < 9.2e9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.2e9 < F

    1. Initial program 56.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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

    if -2.49999999999999994e37 < F < 1.5e8

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

    1. Initial program 56.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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.6%

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

Alternative 5: 99.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 920000000:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\


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

    1. Initial program 51.8%

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

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

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

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

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

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

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

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

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

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

    if -2.8000000000000001e44 < F < 9.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv46.2%

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

        \[\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 9.2e8 < F

    1. Initial program 56.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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{+44}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 920000000:\\ \;\;\;\;\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}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 98.9% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 2.3499999999999999e-8

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

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

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

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

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

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

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

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

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

    if 2.3499999999999999e-8 < F

    1. Initial program 58.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. Simplified72.3%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{F}}}{\sin B} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. inv-pow98.3%

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

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

        \[\leadsto F \cdot \frac{\frac{1 - \color{blue}{{F}^{-1} \cdot {F}^{-1}}}{F}}{\sin B} - \frac{x}{\tan B} \]
      4. inv-pow98.3%

        \[\leadsto F \cdot \frac{\frac{1 - \color{blue}{\frac{1}{F}} \cdot {F}^{-1}}{F}}{\sin B} - \frac{x}{\tan B} \]
      5. inv-pow98.3%

        \[\leadsto F \cdot \frac{\frac{1 - \frac{1}{F} \cdot \color{blue}{\frac{1}{F}}}{F}}{\sin B} - \frac{x}{\tan B} \]
    9. Applied egg-rr98.3%

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

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

Alternative 7: 89.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.48:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -1.25 \cdot 10^{-126}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 9 \cdot 10^{-169}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 210000:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

    if -0.47999999999999998 < F < -1.25000000000000001e-126 or 8.9999999999999997e-169 < F < 2.1e5

    1. Initial program 99.4%

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

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

    if -1.25000000000000001e-126 < F < 8.9999999999999997e-169

    1. Initial program 99.5%

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

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

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

    if 2.1e5 < F

    1. Initial program 56.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}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification93.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.48:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.25 \cdot 10^{-126}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{-169}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 210000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 85.1% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 1.48 \cdot 10^{-27}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

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


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

    1. Initial program 62.1%

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

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

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

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

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

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

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

    if -4.80000000000000044e-41 < F < 1.48000000000000008e-27

    1. Initial program 99.5%

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

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

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

    if 1.48000000000000008e-27 < F

    1. Initial program 59.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.48 \cdot 10^{-27}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 1.25 \cdot 10^{-27}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

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


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

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

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

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

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

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

    if -8.8000000000000001e-69 < F < 1.25e-27

    1. Initial program 99.5%

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

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

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

    if 1.25e-27 < F

    1. Initial program 59.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.8 \cdot 10^{-69}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-27}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 85.1% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 1.45 \cdot 10^{-27}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

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


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

    1. Initial program 62.1%

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

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

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

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

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

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

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

    if -4.5e-41 < F < 1.45000000000000002e-27

    1. Initial program 99.5%

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

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

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

    if 1.45000000000000002e-27 < F

    1. Initial program 59.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{-41}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-27}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 71.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.00017:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 8 \cdot 10^{+245} \lor \neg \left(F \leq 1.28 \cdot 10^{+278}\right):\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\

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


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

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

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

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

    if -9.6e6 < F < 1.7e-4

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(-\frac{\cos B}{\sin B}\right)} \]
      4. distribute-frac-neg67.9%

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

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

    if 1.7e-4 < F < 8.00000000000000035e245 or 1.2800000000000001e278 < F

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

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

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

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

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

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

    if 8.00000000000000035e245 < F < 1.2800000000000001e278

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. unpow-199.5%

        \[\leadsto \frac{1 - \color{blue}{{\left({F}^{2}\right)}^{-1}}}{B} - \frac{x}{\tan B} \]
      2. exp-to-pow99.5%

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

        \[\leadsto \frac{1 - {\left(e^{\color{blue}{2 \cdot \log F}}\right)}^{-1}}{B} - \frac{x}{\tan B} \]
      4. exp-prod99.5%

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

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

        \[\leadsto \frac{1 - e^{\color{blue}{\log F \cdot \left(2 \cdot -1\right)}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval99.5%

        \[\leadsto \frac{1 - e^{\log F \cdot \color{blue}{-2}}}{B} - \frac{x}{\tan B} \]
      8. exp-to-pow99.5%

        \[\leadsto \frac{1 - \color{blue}{{F}^{-2}}}{B} - \frac{x}{\tan B} \]
    10. Simplified99.5%

      \[\leadsto \color{blue}{\frac{1 - {F}^{-2}}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around inf 99.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9600000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.00017:\\ \;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{+245} \lor \neg \left(F \leq 1.28 \cdot 10^{+278}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 71.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9600000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.48:\\ \;\;\;\;\frac{\cos B}{\frac{\sin B}{-x}}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{+246} \lor \neg \left(F \leq 1.35 \cdot 10^{+284}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9600000.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 0.48)
     (/ (cos B) (/ (sin B) (- x)))
     (if (or (<= F 1.65e+246) (not (<= F 1.35e+284)))
       (- (/ F (* F (sin B))) (/ x B))
       (- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9600000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 0.48) {
		tmp = cos(B) / (sin(B) / -x);
	} else if ((F <= 1.65e+246) || !(F <= 1.35e+284)) {
		tmp = (F / (F * sin(B))) - (x / B);
	} else {
		tmp = (1.0 / B) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-9600000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 0.48d0) then
        tmp = cos(b) / (sin(b) / -x)
    else if ((f <= 1.65d+246) .or. (.not. (f <= 1.35d+284))) then
        tmp = (f / (f * sin(b))) - (x / b)
    else
        tmp = (1.0d0 / b) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -9600000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 0.48) {
		tmp = Math.cos(B) / (Math.sin(B) / -x);
	} else if ((F <= 1.65e+246) || !(F <= 1.35e+284)) {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	} else {
		tmp = (1.0 / B) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -9600000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 0.48:
		tmp = math.cos(B) / (math.sin(B) / -x)
	elif (F <= 1.65e+246) or not (F <= 1.35e+284):
		tmp = (F / (F * math.sin(B))) - (x / B)
	else:
		tmp = (1.0 / B) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -9600000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 0.48)
		tmp = Float64(cos(B) / Float64(sin(B) / Float64(-x)));
	elseif ((F <= 1.65e+246) || !(F <= 1.35e+284))
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -9600000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 0.48)
		tmp = cos(B) / (sin(B) / -x);
	elseif ((F <= 1.65e+246) || ~((F <= 1.35e+284)))
		tmp = (F / (F * sin(B))) - (x / B);
	else
		tmp = (1.0 / B) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -9600000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.48], N[(N[Cos[B], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / (-x)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.65e+246], N[Not[LessEqual[F, 1.35e+284]], $MachinePrecision]], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 0.48:\\
\;\;\;\;\frac{\cos B}{\frac{\sin B}{-x}}\\

\mathbf{elif}\;F \leq 1.65 \cdot 10^{+246} \lor \neg \left(F \leq 1.35 \cdot 10^{+284}\right):\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\

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


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

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

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

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

    if -9.6e6 < F < 0.47999999999999998

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\sin B}{x \cdot \cos B}}} \]
      2. inv-pow67.9%

        \[\leadsto -1 \cdot \color{blue}{{\left(\frac{\sin B}{x \cdot \cos B}\right)}^{-1}} \]
      3. associate-/r*67.9%

        \[\leadsto -1 \cdot {\color{blue}{\left(\frac{\frac{\sin B}{x}}{\cos B}\right)}}^{-1} \]
    6. Applied egg-rr67.9%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\frac{\sin B}{x}}{\cos B}}} \]
      2. clear-num67.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
    8. Applied egg-rr67.9%

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

    if 0.47999999999999998 < F < 1.65e246 or 1.35000000000000003e284 < F

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

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

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

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

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

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

    if 1.65e246 < F < 1.35000000000000003e284

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. unpow-199.5%

        \[\leadsto \frac{1 - \color{blue}{{\left({F}^{2}\right)}^{-1}}}{B} - \frac{x}{\tan B} \]
      2. exp-to-pow99.5%

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

        \[\leadsto \frac{1 - {\left(e^{\color{blue}{2 \cdot \log F}}\right)}^{-1}}{B} - \frac{x}{\tan B} \]
      4. exp-prod99.5%

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

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

        \[\leadsto \frac{1 - e^{\color{blue}{\log F \cdot \left(2 \cdot -1\right)}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval99.5%

        \[\leadsto \frac{1 - e^{\log F \cdot \color{blue}{-2}}}{B} - \frac{x}{\tan B} \]
      8. exp-to-pow99.5%

        \[\leadsto \frac{1 - \color{blue}{{F}^{-2}}}{B} - \frac{x}{\tan B} \]
    10. Simplified99.5%

      \[\leadsto \color{blue}{\frac{1 - {F}^{-2}}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around inf 99.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9600000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.48:\\ \;\;\;\;\frac{\cos B}{\frac{\sin B}{-x}}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{+246} \lor \neg \left(F \leq 1.35 \cdot 10^{+284}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 71.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.03:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 2.05 \cdot 10^{+246} \lor \neg \left(F \leq 1.5 \cdot 10^{+279}\right):\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\

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


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

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

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

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

    if -9.6e6 < F < 0.029999999999999999

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

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

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

    if 0.029999999999999999 < F < 2.04999999999999988e246 or 1.4999999999999999e279 < F

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

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

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

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

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

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

    if 2.04999999999999988e246 < F < 1.4999999999999999e279

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. unpow-199.5%

        \[\leadsto \frac{1 - \color{blue}{{\left({F}^{2}\right)}^{-1}}}{B} - \frac{x}{\tan B} \]
      2. exp-to-pow99.5%

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

        \[\leadsto \frac{1 - {\left(e^{\color{blue}{2 \cdot \log F}}\right)}^{-1}}{B} - \frac{x}{\tan B} \]
      4. exp-prod99.5%

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

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

        \[\leadsto \frac{1 - e^{\color{blue}{\log F \cdot \left(2 \cdot -1\right)}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval99.5%

        \[\leadsto \frac{1 - e^{\log F \cdot \color{blue}{-2}}}{B} - \frac{x}{\tan B} \]
      8. exp-to-pow99.5%

        \[\leadsto \frac{1 - \color{blue}{{F}^{-2}}}{B} - \frac{x}{\tan B} \]
    10. Simplified99.5%

      \[\leadsto \color{blue}{\frac{1 - {F}^{-2}}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around inf 99.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9600000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.03:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{+246} \lor \neg \left(F \leq 1.5 \cdot 10^{+279}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 78.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.92:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 2.1 \cdot 10^{+246} \lor \neg \left(F \leq 5.3 \cdot 10^{+283}\right):\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\

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


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

    1. Initial program 62.1%

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

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

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

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

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

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

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

    if -7.49999999999999972e-42 < F < 0.92000000000000004

    1. Initial program 99.5%

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

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

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

    if 0.92000000000000004 < F < 2.1e246 or 5.3e283 < F

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

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

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

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

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

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

    if 2.1e246 < F < 5.3e283

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. unpow-199.5%

        \[\leadsto \frac{1 - \color{blue}{{\left({F}^{2}\right)}^{-1}}}{B} - \frac{x}{\tan B} \]
      2. exp-to-pow99.5%

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

        \[\leadsto \frac{1 - {\left(e^{\color{blue}{2 \cdot \log F}}\right)}^{-1}}{B} - \frac{x}{\tan B} \]
      4. exp-prod99.5%

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

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

        \[\leadsto \frac{1 - e^{\color{blue}{\log F \cdot \left(2 \cdot -1\right)}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval99.5%

        \[\leadsto \frac{1 - e^{\log F \cdot \color{blue}{-2}}}{B} - \frac{x}{\tan B} \]
      8. exp-to-pow99.5%

        \[\leadsto \frac{1 - \color{blue}{{F}^{-2}}}{B} - \frac{x}{\tan B} \]
    10. Simplified99.5%

      \[\leadsto \color{blue}{\frac{1 - {F}^{-2}}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around inf 99.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-42}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.92:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{+246} \lor \neg \left(F \leq 5.3 \cdot 10^{+283}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 62.9% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;F \leq -4.2 \cdot 10^{-166}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

\mathbf{elif}\;F \leq -3.1 \cdot 10^{-235}:\\
\;\;\;\;\frac{{B}^{2} \cdot \left(x \cdot \left(--0.3333333333333333\right)\right) - x}{B}\\

\mathbf{elif}\;F \leq 1.65:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\


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

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

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

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

    if -1.0499999999999999e48 < F < -4.1999999999999999e-166

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

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

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

    if -4.1999999999999999e-166 < F < -3.1e-235

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{B}} \]
    6. Step-by-step derivation
      1. distribute-rgt-out--92.2%

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

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

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

    if -3.1e-235 < F < 1.6499999999999999

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

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

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

    if 1.6499999999999999 < F

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.05 \cdot 10^{+48}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-166}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -3.1 \cdot 10^{-235}:\\ \;\;\;\;\frac{{B}^{2} \cdot \left(x \cdot \left(--0.3333333333333333\right)\right) - x}{B}\\ \mathbf{elif}\;F \leq 1.65:\\ \;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 61.7% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -6.2 \cdot 10^{-166}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\


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

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

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

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

    if -8.4999999999999996e46 < F < -6.19999999999999968e-166

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

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

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

    if -6.19999999999999968e-166 < F < -7.9999999999999994e-245

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 86.2%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-186.2%

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

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

    if -7.9999999999999994e-245 < F < 5.2999999999999997e51

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. unpow-133.1%

        \[\leadsto \frac{1 - \color{blue}{{\left({F}^{2}\right)}^{-1}}}{B} - \frac{x}{\tan B} \]
      2. exp-to-pow30.3%

        \[\leadsto \frac{1 - {\color{blue}{\left(e^{\log F \cdot 2}\right)}}^{-1}}{B} - \frac{x}{\tan B} \]
      3. *-commutative30.3%

        \[\leadsto \frac{1 - {\left(e^{\color{blue}{2 \cdot \log F}}\right)}^{-1}}{B} - \frac{x}{\tan B} \]
      4. exp-prod30.3%

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

        \[\leadsto \frac{1 - e^{\color{blue}{\left(\log F \cdot 2\right)} \cdot -1}}{B} - \frac{x}{\tan B} \]
      6. associate-*l*30.3%

        \[\leadsto \frac{1 - e^{\color{blue}{\log F \cdot \left(2 \cdot -1\right)}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval30.3%

        \[\leadsto \frac{1 - e^{\log F \cdot \color{blue}{-2}}}{B} - \frac{x}{\tan B} \]
      8. exp-to-pow33.1%

        \[\leadsto \frac{1 - \color{blue}{{F}^{-2}}}{B} - \frac{x}{\tan B} \]
    10. Simplified33.1%

      \[\leadsto \color{blue}{\frac{1 - {F}^{-2}}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around inf 54.2%

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

    if 5.2999999999999997e51 < F

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{+46}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-166}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -8 \cdot 10^{-245}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{+51}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 54.1% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -5.1 \cdot 10^{-166} \lor \neg \left(F \leq -1.25 \cdot 10^{-245}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

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


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

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

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

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

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

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

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

    if -7.9999999999999999e46 < F < -5.1000000000000002e-166 or -1.2499999999999999e-245 < F

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. unpow-145.0%

        \[\leadsto \frac{1 - \color{blue}{{\left({F}^{2}\right)}^{-1}}}{B} - \frac{x}{\tan B} \]
      2. exp-to-pow32.7%

        \[\leadsto \frac{1 - {\color{blue}{\left(e^{\log F \cdot 2}\right)}}^{-1}}{B} - \frac{x}{\tan B} \]
      3. *-commutative32.7%

        \[\leadsto \frac{1 - {\left(e^{\color{blue}{2 \cdot \log F}}\right)}^{-1}}{B} - \frac{x}{\tan B} \]
      4. exp-prod32.7%

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

        \[\leadsto \frac{1 - e^{\color{blue}{\left(\log F \cdot 2\right)} \cdot -1}}{B} - \frac{x}{\tan B} \]
      6. associate-*l*32.7%

        \[\leadsto \frac{1 - e^{\color{blue}{\log F \cdot \left(2 \cdot -1\right)}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval32.7%

        \[\leadsto \frac{1 - e^{\log F \cdot \color{blue}{-2}}}{B} - \frac{x}{\tan B} \]
      8. exp-to-pow45.0%

        \[\leadsto \frac{1 - \color{blue}{{F}^{-2}}}{B} - \frac{x}{\tan B} \]
    10. Simplified45.0%

      \[\leadsto \color{blue}{\frac{1 - {F}^{-2}}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around inf 56.0%

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

    if -5.1000000000000002e-166 < F < -1.2499999999999999e-245

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 86.2%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-186.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8 \cdot 10^{+46}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -5.1 \cdot 10^{-166} \lor \neg \left(F \leq -1.25 \cdot 10^{-245}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 61.4% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9600000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.9 \cdot 10^{-166} \lor \neg \left(F \leq -1.12 \cdot 10^{-243}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9600000.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F -4.9e-166) (not (<= F -1.12e-243)))
     (- (/ 1.0 B) (/ x (tan B)))
     (/ x (- B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9600000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= -4.9e-166) || !(F <= -1.12e-243)) {
		tmp = (1.0 / B) - (x / tan(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 <= (-9600000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= (-4.9d-166)) .or. (.not. (f <= (-1.12d-243)))) then
        tmp = (1.0d0 / b) - (x / tan(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 <= -9600000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= -4.9e-166) || !(F <= -1.12e-243)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -9600000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= -4.9e-166) or not (F <= -1.12e-243):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -9600000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= -4.9e-166) || !(F <= -1.12e-243))
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(x / Float64(-B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -9600000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= -4.9e-166) || ~((F <= -1.12e-243)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -9600000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -4.9e-166], N[Not[LessEqual[F, -1.12e-243]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -4.9 \cdot 10^{-166} \lor \neg \left(F \leq -1.12 \cdot 10^{-243}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

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


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

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

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

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

    if -9.6e6 < F < -4.8999999999999999e-166 or -1.12000000000000005e-243 < F

    1. Initial program 81.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. Simplified87.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. unpow-144.6%

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

        \[\leadsto \frac{1 - {\color{blue}{\left(e^{\log F \cdot 2}\right)}}^{-1}}{B} - \frac{x}{\tan B} \]
      3. *-commutative34.6%

        \[\leadsto \frac{1 - {\left(e^{\color{blue}{2 \cdot \log F}}\right)}^{-1}}{B} - \frac{x}{\tan B} \]
      4. exp-prod34.6%

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

        \[\leadsto \frac{1 - e^{\color{blue}{\left(\log F \cdot 2\right)} \cdot -1}}{B} - \frac{x}{\tan B} \]
      6. associate-*l*34.6%

        \[\leadsto \frac{1 - e^{\color{blue}{\log F \cdot \left(2 \cdot -1\right)}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval34.6%

        \[\leadsto \frac{1 - e^{\log F \cdot \color{blue}{-2}}}{B} - \frac{x}{\tan B} \]
      8. exp-to-pow44.6%

        \[\leadsto \frac{1 - \color{blue}{{F}^{-2}}}{B} - \frac{x}{\tan B} \]
    10. Simplified44.6%

      \[\leadsto \color{blue}{\frac{1 - {F}^{-2}}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around inf 56.2%

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

    if -4.8999999999999999e-166 < F < -1.12000000000000005e-243

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 86.2%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-186.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9600000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.9 \cdot 10^{-166} \lor \neg \left(F \leq -1.12 \cdot 10^{-243}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 61.4% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -5.2 \cdot 10^{-166}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

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

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


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

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

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

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

    if -5.39999999999999991e47 < F < -5.19999999999999979e-166

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

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

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

    if -5.19999999999999979e-166 < F < -6.3999999999999996e-244

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 86.2%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-186.2%

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

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

    if -6.3999999999999996e-244 < F

    1. Initial program 76.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. Simplified84.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 84.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/84.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 - \frac{1}{{F}^{2}}}{B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. unpow-145.7%

        \[\leadsto \frac{1 - \color{blue}{{\left({F}^{2}\right)}^{-1}}}{B} - \frac{x}{\tan B} \]
      2. exp-to-pow44.1%

        \[\leadsto \frac{1 - {\color{blue}{\left(e^{\log F \cdot 2}\right)}}^{-1}}{B} - \frac{x}{\tan B} \]
      3. *-commutative44.1%

        \[\leadsto \frac{1 - {\left(e^{\color{blue}{2 \cdot \log F}}\right)}^{-1}}{B} - \frac{x}{\tan B} \]
      4. exp-prod44.1%

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

        \[\leadsto \frac{1 - e^{\color{blue}{\left(\log F \cdot 2\right)} \cdot -1}}{B} - \frac{x}{\tan B} \]
      6. associate-*l*44.1%

        \[\leadsto \frac{1 - e^{\color{blue}{\log F \cdot \left(2 \cdot -1\right)}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval44.1%

        \[\leadsto \frac{1 - e^{\log F \cdot \color{blue}{-2}}}{B} - \frac{x}{\tan B} \]
      8. exp-to-pow45.7%

        \[\leadsto \frac{1 - \color{blue}{{F}^{-2}}}{B} - \frac{x}{\tan B} \]
    10. Simplified45.7%

      \[\leadsto \color{blue}{\frac{1 - {F}^{-2}}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around inf 57.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.4 \cdot 10^{+47}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.2 \cdot 10^{-166}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -6.4 \cdot 10^{-244}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 38.3% accurate, 2.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{B}{x + 1}}\\


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

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

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

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

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

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

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

    if -7.19999999999999958e-50 < F < 66000

    1. Initial program 99.5%

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

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

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

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

    if 66000 < F

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

      \[\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. Step-by-step derivation
      1. clear-num17.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{-B}{1 + x}}} \]
      2. inv-pow17.9%

        \[\leadsto \color{blue}{{\left(\frac{-B}{1 + x}\right)}^{-1}} \]
      3. add-sqr-sqrt10.1%

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{-B} \cdot \sqrt{-B}}}{1 + x}\right)}^{-1} \]
      4. sqrt-unprod14.8%

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}}{1 + x}\right)}^{-1} \]
      5. sqr-neg14.8%

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

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

        \[\leadsto {\left(\frac{\color{blue}{B}}{1 + x}\right)}^{-1} \]
    8. Applied egg-rr33.7%

      \[\leadsto \color{blue}{{\left(\frac{B}{1 + x}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-133.7%

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

      \[\leadsto \color{blue}{\frac{1}{\frac{B}{1 + x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.7%

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

Alternative 21: 37.1% accurate, 19.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{B}{x + 1}}\\


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

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

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

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

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

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

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

    if -1.69999999999999994e-54 < F < 2.3499999999999999e-8

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 41.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-141.6%

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

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

    if 2.3499999999999999e-8 < F

    1. Initial program 58.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. clear-num17.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{-B}{1 + x}}} \]
      2. inv-pow17.2%

        \[\leadsto \color{blue}{{\left(\frac{-B}{1 + x}\right)}^{-1}} \]
      3. add-sqr-sqrt9.7%

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

        \[\leadsto {\left(\frac{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}}{1 + x}\right)}^{-1} \]
      5. sqr-neg14.3%

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{B}{1 + x}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-132.5%

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

      \[\leadsto \color{blue}{\frac{1}{\frac{B}{1 + x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{-54}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{B}{x + 1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 30.8% accurate, 21.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x + 1}{B}\\


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

    1. Initial program 60.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 40.2%

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

    if -1.01999999999999997e-10 < F < 2.3499999999999999e-8

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 40.9%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-140.9%

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

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

    if 2.3499999999999999e-8 < F

    1. Initial program 58.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt9.7%

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

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

        \[\leadsto \frac{1 + x}{\sqrt{\color{blue}{B \cdot B}}} \]
      4. sqrt-unprod14.6%

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

        \[\leadsto \frac{1 + x}{\color{blue}{B}} \]
      6. *-un-lft-identity32.5%

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification38.3%

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

Alternative 23: 37.1% accurate, 21.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x + 1}{B}\\


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

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

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

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

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

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

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

    if -5.00000000000000015e-54 < F < 2.3499999999999999e-8

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 41.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-141.6%

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

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

    if 2.3499999999999999e-8 < F

    1. Initial program 58.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt9.7%

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

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

        \[\leadsto \frac{1 + x}{\sqrt{\color{blue}{B \cdot B}}} \]
      4. sqrt-unprod14.6%

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

        \[\leadsto \frac{1 + x}{\color{blue}{B}} \]
      6. *-un-lft-identity32.5%

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.0%

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

Alternative 24: 30.8% accurate, 23.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-92} \lor \neg \left(x \leq 8.3 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{x}{-B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3e-92 or 8.3e-88 < x

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 46.5%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-146.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified46.5%

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

    if -1.3e-92 < x < 8.3e-88

    1. Initial program 69.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 23.7%

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

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

Alternative 25: 10.2% 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 76.1%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  7. Taylor expanded in x around 0 14.1%

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

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

Reproduce

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