VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.2% → 99.7%
Time: 30.1s
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: 76.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2e142 < F < 1.5e8

    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. Step-by-step derivation
      1. distribute-lft-neg-in98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5e8 < F

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 34.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. Step-by-step derivation
      1. distribute-lft-neg-in34.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999998e155 < F < 0.5

    1. Initial program 98.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. Step-by-step derivation
      1. distribute-lft-neg-in98.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in 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} \]
    6. Step-by-step derivation
      1. associate-*l/99.6%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*r/99.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} \]
    9. 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 0.5 < F

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2000000000000:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -2000000000000.0)
     (- (/ (/ F (- (/ -1.0 F) F)) (sin B)) t_0)
     (if (<= F 200000000.0)
       (+
        (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
        (* x (/ -1.0 (tan B))))
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -2000000000000.0) {
		tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0;
	} else if (F <= 200000000.0) {
		tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(B)));
	} else {
		tmp = (1.0 / sin(B)) - 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 <= (-2000000000000.0d0)) then
        tmp = ((f / (((-1.0d0) / f) - f)) / sin(b)) - t_0
    else if (f <= 200000000.0d0) then
        tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(b)))
    else
        tmp = (1.0d0 / sin(b)) - 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 <= -2000000000000.0) {
		tmp = ((F / ((-1.0 / F) - F)) / Math.sin(B)) - t_0;
	} else if (F <= 200000000.0) {
		tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(B)));
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -2000000000000.0:
		tmp = ((F / ((-1.0 / F) - F)) / math.sin(B)) - t_0
	elif F <= 200000000.0:
		tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(B)))
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -2000000000000.0)
		tmp = Float64(Float64(Float64(F / Float64(Float64(-1.0 / F) - F)) / sin(B)) - t_0);
	elseif (F <= 200000000.0)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(B))));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -2000000000000.0)
		tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0;
	elseif (F <= 200000000.0)
		tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(B)));
	else
		tmp = (1.0 / sin(B)) - 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, -2000000000000.0], N[(N[(N[(F / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 200000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e12 < F < 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

    if 2e8 < F

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e21 < F < 0.5

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

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

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.900000000000000022 < F < 1.3999999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in 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} \]
    6. Step-by-step derivation
      1. associate-*l/99.6%

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.900000000000000022 < F < 1.3999999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in 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} \]
    6. Step-by-step derivation
      1. associate-*l/99.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. *-commutative98.8%

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

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

    if 1.3999999999999999 < F

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 89.2% 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}\\ t_1 := \frac{x}{\tan B}\\ t_2 := \frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t\_1\\ \mathbf{if}\;F \leq -3.3 \cdot 10^{+18}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;F \leq -4.6 \cdot 10^{-57}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 3.25 \cdot 10^{-164}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;F \leq 3400:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_1\\ \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)))
        (t_1 (/ x (tan B)))
        (t_2 (- (/ (/ F (- (/ -1.0 F) F)) (sin B)) t_1)))
   (if (<= F -3.3e+18)
     t_2
     (if (<= F -4.6e-57)
       t_0
       (if (<= F 3.25e-164)
         t_2
         (if (<= F 3400.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
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 t_1 = x / tan(B);
	double t_2 = ((F / ((-1.0 / F) - F)) / sin(B)) - t_1;
	double tmp;
	if (F <= -3.3e+18) {
		tmp = t_2;
	} else if (F <= -4.6e-57) {
		tmp = t_0;
	} else if (F <= 3.25e-164) {
		tmp = t_2;
	} else if (F <= 3400.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_1;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
    t_1 = x / tan(b)
    t_2 = ((f / (((-1.0d0) / f) - f)) / sin(b)) - t_1
    if (f <= (-3.3d+18)) then
        tmp = t_2
    else if (f <= (-4.6d-57)) then
        tmp = t_0
    else if (f <= 3.25d-164) then
        tmp = t_2
    else if (f <= 3400.0d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / sin(b)) - t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
	double t_1 = x / Math.tan(B);
	double t_2 = ((F / ((-1.0 / F) - F)) / Math.sin(B)) - t_1;
	double tmp;
	if (F <= -3.3e+18) {
		tmp = t_2;
	} else if (F <= -4.6e-57) {
		tmp = t_0;
	} else if (F <= 3.25e-164) {
		tmp = t_2;
	} else if (F <= 3400.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_1;
	}
	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)
	t_1 = x / math.tan(B)
	t_2 = ((F / ((-1.0 / F) - F)) / math.sin(B)) - t_1
	tmp = 0
	if F <= -3.3e+18:
		tmp = t_2
	elif F <= -4.6e-57:
		tmp = t_0
	elif F <= 3.25e-164:
		tmp = t_2
	elif F <= 3400.0:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B))
	t_1 = Float64(x / tan(B))
	t_2 = Float64(Float64(Float64(F / Float64(Float64(-1.0 / F) - F)) / sin(B)) - t_1)
	tmp = 0.0
	if (F <= -3.3e+18)
		tmp = t_2;
	elseif (F <= -4.6e-57)
		tmp = t_0;
	elseif (F <= 3.25e-164)
		tmp = t_2;
	elseif (F <= 3400.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_1);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B);
	t_1 = x / tan(B);
	t_2 = ((F / ((-1.0 / F) - F)) / sin(B)) - t_1;
	tmp = 0.0;
	if (F <= -3.3e+18)
		tmp = t_2;
	elseif (F <= -4.6e-57)
		tmp = t_0;
	elseif (F <= 3.25e-164)
		tmp = t_2;
	elseif (F <= 3400.0)
		tmp = t_0;
	else
		tmp = (1.0 / sin(B)) - t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[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]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(F / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[F, -3.3e+18], t$95$2, If[LessEqual[F, -4.6e-57], t$95$0, If[LessEqual[F, 3.25e-164], t$95$2, If[LessEqual[F, 3400.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
t_2 := \frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t\_1\\
\mathbf{if}\;F \leq -3.3 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;F \leq 3.25 \cdot 10^{-164}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3.3e18 or -4.6e-57 < F < 3.25000000000000002e-164

    1. Initial program 76.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3e18 < F < -4.6e-57 or 3.25000000000000002e-164 < F < 3400

    1. Initial program 99.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 B around 0 87.5%

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

    if 3400 < F

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.6 \cdot 10^{-57}:\\ \;\;\;\;\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 3.25 \cdot 10^{-164}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3400:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 77.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -5.7 \cdot 10^{-52}:\\
\;\;\;\;\frac{\frac{F}{t\_0}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 7.8 \cdot 10^{-21}:\\
\;\;\;\;\frac{F}{t\_0 \cdot B} - t\_1\\

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


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

    1. Initial program 36.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1, \frac{-1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr81.6%

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

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

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

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

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

    if -1.10000000000000003e164 < F < -5.6999999999999997e-52

    1. Initial program 88.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. Step-by-step derivation
      1. distribute-lft-neg-in88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.6999999999999997e-52 < F < 7.8000000000000001e-21

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in 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} \]
    6. Step-by-step derivation
      1. associate-*l/99.6%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*r/99.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.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{F}{B \cdot \left(F + \frac{1}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. mul-1-neg72.7%

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

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

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

    if 7.8000000000000001e-21 < F

    1. Initial program 66.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. Step-by-step derivation
      1. distribute-lft-neg-in66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.1 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5.7 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{-21}:\\ \;\;\;\;\frac{F}{\left(\frac{-1}{F} - F\right) \cdot B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.9 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \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 -1.9e+164)
     (- (/ -1.0 B) t_0)
     (if (<= F -7.2e-47)
       (- (/ (/ F (- (/ -1.0 F) F)) (sin B)) (/ x B))
       (if (<= F 7e-9)
         (* (cos B) (/ x (- (sin B))))
         (if (<= F 1.7e+79)
           (- (/ 1.0 (sin B)) (+ (/ x B) (* -0.3333333333333333 (* B x))))
           (- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.9e+164) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -7.2e-47) {
		tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - (x / B);
	} else if (F <= 7e-9) {
		tmp = cos(B) * (x / -sin(B));
	} else if (F <= 1.7e+79) {
		tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	} 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 <= (-1.9d+164)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-7.2d-47)) then
        tmp = ((f / (((-1.0d0) / f) - f)) / sin(b)) - (x / b)
    else if (f <= 7d-9) then
        tmp = cos(b) * (x / -sin(b))
    else if (f <= 1.7d+79) then
        tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
    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 <= -1.9e+164) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -7.2e-47) {
		tmp = ((F / ((-1.0 / F) - F)) / Math.sin(B)) - (x / B);
	} else if (F <= 7e-9) {
		tmp = Math.cos(B) * (x / -Math.sin(B));
	} else if (F <= 1.7e+79) {
		tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.9e+164:
		tmp = (-1.0 / B) - t_0
	elif F <= -7.2e-47:
		tmp = ((F / ((-1.0 / F) - F)) / math.sin(B)) - (x / B)
	elif F <= 7e-9:
		tmp = math.cos(B) * (x / -math.sin(B))
	elif F <= 1.7e+79:
		tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)))
	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 <= -1.9e+164)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -7.2e-47)
		tmp = Float64(Float64(Float64(F / Float64(Float64(-1.0 / F) - F)) / sin(B)) - Float64(x / B));
	elseif (F <= 7e-9)
		tmp = Float64(cos(B) * Float64(x / Float64(-sin(B))));
	elseif (F <= 1.7e+79)
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x))));
	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 <= -1.9e+164)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -7.2e-47)
		tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - (x / B);
	elseif (F <= 7e-9)
		tmp = cos(B) * (x / -sin(B));
	elseif (F <= 1.7e+79)
		tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	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, -1.9e+164], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -7.2e-47], N[(N[(N[(F / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-9], N[(N[Cos[B], $MachinePrecision] * N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e+79], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $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 -1.9 \cdot 10^{+164}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

\mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\
\;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{B}\\

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

\mathbf{elif}\;F \leq 1.7 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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


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

    1. Initial program 36.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1, \frac{-1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr81.6%

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

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

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

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

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

    if -1.90000000000000011e164 < F < -7.19999999999999982e-47

    1. Initial program 88.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. Step-by-step derivation
      1. distribute-lft-neg-in88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999982e-47 < F < 6.9999999999999998e-9

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

      \[\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}} \]
    5. Step-by-step derivation
      1. mul-1-neg71.8%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. *-commutative71.8%

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

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
      4. distribute-rgt-neg-in71.8%

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

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

    if 6.9999999999999998e-9 < F < 1.70000000000000016e79

    1. Initial program 95.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 B around 0 75.7%

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

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

    if 1.70000000000000016e79 < F

    1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 84.9% accurate, 1.5× speedup?

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

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

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


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

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

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

    if -1.99999999999999987e-49 < F

    1. Initial program 84.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. Step-by-step derivation
      1. distribute-lft-neg-in84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 85.2% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999997e-113 < F

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 84.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 2.7 \cdot 10^{-20}:\\
\;\;\;\;\frac{F}{\left(\frac{-1}{F} - F\right) \cdot B} - t\_0\\

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


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

    1. Initial program 57.2%

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

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

    if -3.3e18 < F < 2.7e-20

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in 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} \]
    6. Step-by-step derivation
      1. associate-*l/99.6%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*r/99.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.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{F}{B \cdot \left(F + \frac{1}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. mul-1-neg70.8%

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

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

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

    if 2.7e-20 < F

    1. Initial program 66.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. Step-by-step derivation
      1. distribute-lft-neg-in66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 60.7% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.92 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9} \lor \neg \left(F \leq 4.2 \cdot 10^{+78}\right):\\ \;\;\;\;\frac{1}{B} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.92e+164)
     (- (/ -1.0 B) t_0)
     (if (<= F -7.2e-47)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (or (<= F 7e-9) (not (<= F 4.2e+78)))
         (- (/ 1.0 B) t_0)
         (- (/ 1.0 (sin B)) (+ (/ x B) (* -0.3333333333333333 (* B x)))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.92e+164) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -7.2e-47) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= 7e-9) || !(F <= 4.2e+78)) {
		tmp = (1.0 / B) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-1.92d+164)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-7.2d-47)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= 7d-9) .or. (.not. (f <= 4.2d+78))) then
        tmp = (1.0d0 / b) - t_0
    else
        tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
    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.92e+164) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -7.2e-47) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= 7e-9) || !(F <= 4.2e+78)) {
		tmp = (1.0 / B) - t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.92e+164:
		tmp = (-1.0 / B) - t_0
	elif F <= -7.2e-47:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= 7e-9) or not (F <= 4.2e+78):
		tmp = (1.0 / B) - t_0
	else:
		tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)))
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.92e+164)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -7.2e-47)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= 7e-9) || !(F <= 4.2e+78))
		tmp = Float64(Float64(1.0 / B) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.92e+164)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -7.2e-47)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= 7e-9) || ~((F <= 4.2e+78)))
		tmp = (1.0 / B) - t_0;
	else
		tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.92e+164], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -7.2e-47], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 7e-9], N[Not[LessEqual[F, 4.2e+78]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 7 \cdot 10^{-9} \lor \neg \left(F \leq 4.2 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\

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


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

    1. Initial program 36.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1, \frac{-1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr81.6%

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

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

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

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

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

    if -1.9199999999999999e164 < F < -7.19999999999999982e-47

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

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

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

    if -7.19999999999999982e-47 < F < 6.9999999999999998e-9 or 4.2000000000000002e78 < F

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*51.9%

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

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

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

    if 6.9999999999999998e-9 < F < 4.2000000000000002e78

    1. Initial program 95.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 B around 0 75.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.92 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9} \lor \neg \left(F \leq 4.2 \cdot 10^{+78}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 70.7% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.9 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -3.65 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F}{\left(\frac{-1}{F} - F\right) \cdot B} - t\_0\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{+78}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \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 -1.9e+164)
     (- (/ -1.0 B) t_0)
     (if (<= F -3.65e+18)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 7e-9)
         (- (/ F (* (- (/ -1.0 F) F) B)) t_0)
         (if (<= F 1.9e+78)
           (- (/ 1.0 (sin B)) (+ (/ x B) (* -0.3333333333333333 (* B x))))
           (- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.9e+164) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -3.65e+18) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 7e-9) {
		tmp = (F / (((-1.0 / F) - F) * B)) - t_0;
	} else if (F <= 1.9e+78) {
		tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	} 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 <= (-1.9d+164)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-3.65d+18)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 7d-9) then
        tmp = (f / ((((-1.0d0) / f) - f) * b)) - t_0
    else if (f <= 1.9d+78) then
        tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
    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 <= -1.9e+164) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -3.65e+18) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 7e-9) {
		tmp = (F / (((-1.0 / F) - F) * B)) - t_0;
	} else if (F <= 1.9e+78) {
		tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.9e+164:
		tmp = (-1.0 / B) - t_0
	elif F <= -3.65e+18:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 7e-9:
		tmp = (F / (((-1.0 / F) - F) * B)) - t_0
	elif F <= 1.9e+78:
		tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)))
	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 <= -1.9e+164)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -3.65e+18)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 7e-9)
		tmp = Float64(Float64(F / Float64(Float64(Float64(-1.0 / F) - F) * B)) - t_0);
	elseif (F <= 1.9e+78)
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x))));
	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 <= -1.9e+164)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -3.65e+18)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 7e-9)
		tmp = (F / (((-1.0 / F) - F) * B)) - t_0;
	elseif (F <= 1.9e+78)
		tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
	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, -1.9e+164], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3.65e+18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-9], N[(N[(F / N[(N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.9e+78], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $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 -1.9 \cdot 10^{+164}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

\mathbf{elif}\;F \leq -3.65 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\
\;\;\;\;\frac{F}{\left(\frac{-1}{F} - F\right) \cdot B} - t\_0\\

\mathbf{elif}\;F \leq 1.9 \cdot 10^{+78}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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


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

    1. Initial program 36.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1, \frac{-1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr81.6%

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

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

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

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

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

    if -1.90000000000000011e164 < F < -3.65e18

    1. Initial program 84.6%

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

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

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

    if -3.65e18 < F < 6.9999999999999998e-9

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in 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} \]
    6. Step-by-step derivation
      1. associate-*l/99.6%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*r/99.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.5%

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999998e-9 < F < 1.9e78

    1. Initial program 95.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 B around 0 75.7%

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

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

    if 1.9e78 < F

    1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.65 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F}{\left(\frac{-1}{F} - F\right) \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{+78}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 70.5% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\
\;\;\;\;\frac{\frac{F}{t\_0}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\
\;\;\;\;\frac{F}{t\_0 \cdot B} - t\_1\\

\mathbf{elif}\;F \leq 2.1 \cdot 10^{+80}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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


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

    1. Initial program 36.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1, \frac{-1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr81.6%

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

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

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

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

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

    if -1.85e164 < F < -7.19999999999999982e-47

    1. Initial program 88.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. Step-by-step derivation
      1. distribute-lft-neg-in88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999982e-47 < F < 6.9999999999999998e-9

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*99.4%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity99.4%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg99.4%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in 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} \]
    6. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*r/99.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.5%

        \[\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.5%

        \[\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} \]
    9. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around -inf 71.8%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. mul-1-neg71.8%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    12. Simplified71.8%

      \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right) - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 71.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{F}{B \cdot \left(F + \frac{1}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. mul-1-neg71.8%

        \[\leadsto \color{blue}{\left(-\frac{F}{B \cdot \left(F + \frac{1}{F}\right)}\right)} - \frac{x}{\tan B} \]
      2. distribute-neg-frac71.8%

        \[\leadsto \color{blue}{\frac{-F}{B \cdot \left(F + \frac{1}{F}\right)}} - \frac{x}{\tan B} \]
    15. Simplified71.8%

      \[\leadsto \color{blue}{\frac{-F}{B \cdot \left(F + \frac{1}{F}\right)}} - \frac{x}{\tan B} \]

    if 6.9999999999999998e-9 < F < 2.10000000000000001e80

    1. Initial program 95.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 B around 0 75.7%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in F around inf 71.6%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]

    if 2.10000000000000001e80 < F

    1. Initial program 52.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in52.8%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative52.8%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/71.1%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*71.1%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define71.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity71.1%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg71.1%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg71.1%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified71.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 99.6%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*99.7%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 76.7%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification76.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.85 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F}{\left(\frac{-1}{F} - F\right) \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{+80}:\\ \;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 60.8% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.55 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\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 -1.55e+164)
     (- (/ -1.0 B) t_0)
     (if (<= F -7.2e-47) (- (/ -1.0 (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 <= -1.55e+164) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -7.2e-47) {
		tmp = (-1.0 / 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 <= (-1.55d+164)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-7.2d-47)) then
        tmp = ((-1.0d0) / 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 <= -1.55e+164) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -7.2e-47) {
		tmp = (-1.0 / 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 <= -1.55e+164:
		tmp = (-1.0 / B) - t_0
	elif F <= -7.2e-47:
		tmp = (-1.0 / 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 <= -1.55e+164)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -7.2e-47)
		tmp = Float64(Float64(-1.0 / 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 <= -1.55e+164)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -7.2e-47)
		tmp = (-1.0 / 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, -1.55e+164], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -7.2e-47], N[(N[(-1.0 / N[Sin[B], $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 -1.55 \cdot 10^{+164}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

\mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.5500000000000001e164

    1. Initial program 36.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 99.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 81.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    5. Step-by-step derivation
      1. +-commutative81.5%

        \[\leadsto \color{blue}{\frac{-1}{B} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. *-un-lft-identity81.5%

        \[\leadsto \color{blue}{1 \cdot \frac{-1}{B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      3. fma-define81.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{-1}{B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. un-div-inv81.6%

        \[\leadsto \mathsf{fma}\left(1, \frac{-1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr81.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{-1}{B}, -\frac{x}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. fma-undefine81.6%

        \[\leadsto \color{blue}{1 \cdot \frac{-1}{B} + \left(-\frac{x}{\tan B}\right)} \]
      2. *-lft-identity81.6%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{\tan B}\right) \]
      3. unsub-neg81.6%

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{\tan B}} \]
    8. Simplified81.6%

      \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{\tan B}} \]

    if -1.5500000000000001e164 < F < -7.19999999999999982e-47

    1. Initial program 88.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 88.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 81.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -7.19999999999999982e-47 < F

    1. Initial program 84.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. Step-by-step derivation
      1. distribute-lft-neg-in84.2%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative84.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/90.6%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*90.5%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define90.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity90.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg90.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg90.5%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified90.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 55.9%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*55.9%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified55.9%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 58.9%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 41.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 2.6 \cdot 10^{-225}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 2.6e-225) (/ x (- B)) (- (/ -1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 2.6e-225) {
		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 (b <= 2.6d-225) 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 (B <= 2.6e-225) {
		tmp = x / -B;
	} else {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 2.6e-225:
		tmp = x / -B
	else:
		tmp = (-1.0 / B) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 2.6e-225)
		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 (B <= 2.6e-225)
		tmp = x / -B;
	else
		tmp = (-1.0 / B) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 2.6e-225], 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}\;B \leq 2.6 \cdot 10^{-225}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 2.60000000000000013e-225

    1. Initial program 74.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in74.9%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative74.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/84.6%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*84.6%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define84.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity84.6%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg84.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg84.6%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. 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}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 49.5%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*49.5%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified49.5%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 29.0%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Taylor expanded in x around inf 34.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/34.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-134.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified34.5%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.60000000000000013e-225 < B

    1. Initial program 80.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 59.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 60.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    5. Step-by-step derivation
      1. +-commutative60.7%

        \[\leadsto \color{blue}{\frac{-1}{B} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. *-un-lft-identity60.7%

        \[\leadsto \color{blue}{1 \cdot \frac{-1}{B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      3. fma-define60.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{-1}{B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. un-div-inv60.8%

        \[\leadsto \mathsf{fma}\left(1, \frac{-1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr60.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{-1}{B}, -\frac{x}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. fma-undefine60.8%

        \[\leadsto \color{blue}{1 \cdot \frac{-1}{B} + \left(-\frac{x}{\tan B}\right)} \]
      2. *-lft-identity60.8%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{\tan B}\right) \]
      3. unsub-neg60.8%

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{\tan B}} \]
    8. Simplified60.8%

      \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{\tan B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.6 \cdot 10^{-225}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 60.8% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq 2.5 \cdot 10^{-160}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \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 2.5e-160) (- (/ -1.0 B) t_0) (- (/ 1.0 B) t_0))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= 2.5e-160) {
		tmp = (-1.0 / B) - t_0;
	} 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 <= 2.5d-160) then
        tmp = ((-1.0d0) / b) - t_0
    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 <= 2.5e-160) {
		tmp = (-1.0 / B) - t_0;
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= 2.5e-160:
		tmp = (-1.0 / B) - t_0
	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 <= 2.5e-160)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	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 <= 2.5e-160)
		tmp = (-1.0 / B) - t_0;
	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, 2.5e-160], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $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 2.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.49999999999999997e-160

    1. Initial program 78.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 69.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 64.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    5. Step-by-step derivation
      1. +-commutative64.2%

        \[\leadsto \color{blue}{\frac{-1}{B} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. *-un-lft-identity64.2%

        \[\leadsto \color{blue}{1 \cdot \frac{-1}{B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      3. fma-define64.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{-1}{B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. un-div-inv64.2%

        \[\leadsto \mathsf{fma}\left(1, \frac{-1}{B}, -\color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr64.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \frac{-1}{B}, -\frac{x}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. fma-undefine64.2%

        \[\leadsto \color{blue}{1 \cdot \frac{-1}{B} + \left(-\frac{x}{\tan B}\right)} \]
      2. *-lft-identity64.2%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{\tan B}\right) \]
      3. unsub-neg64.2%

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{\tan B}} \]
    8. Simplified64.2%

      \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{\tan B}} \]

    if 2.49999999999999997e-160 < F

    1. Initial program 75.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in75.2%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative75.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/85.2%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*85.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define85.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity85.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg85.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg85.2%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified85.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}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 75.5%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*75.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified75.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 59.7%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 2.5 \cdot 10^{-160}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 44.4% accurate, 15.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{-47}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.05e-47)
   (+ (* B (* x 0.3333333333333333)) (/ (- -1.0 x) B))
   (if (<= F 1.7e-20)
     (/ x (- B))
     (- (/ (- 1.0 x) B) (* B (* x -0.3333333333333333))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.05e-47) {
		tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
	} else if (F <= 1.7e-20) {
		tmp = x / -B;
	} else {
		tmp = ((1.0 - x) / B) - (B * (x * -0.3333333333333333));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.05d-47)) then
        tmp = (b * (x * 0.3333333333333333d0)) + (((-1.0d0) - x) / b)
    else if (f <= 1.7d-20) then
        tmp = x / -b
    else
        tmp = ((1.0d0 - x) / b) - (b * (x * (-0.3333333333333333d0)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.05e-47) {
		tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
	} else if (F <= 1.7e-20) {
		tmp = x / -B;
	} else {
		tmp = ((1.0 - x) / B) - (B * (x * -0.3333333333333333));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.05e-47:
		tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B)
	elif F <= 1.7e-20:
		tmp = x / -B
	else:
		tmp = ((1.0 - x) / B) - (B * (x * -0.3333333333333333))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.05e-47)
		tmp = Float64(Float64(B * Float64(x * 0.3333333333333333)) + Float64(Float64(-1.0 - x) / B));
	elseif (F <= 1.7e-20)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(Float64(1.0 - x) / B) - Float64(B * Float64(x * -0.3333333333333333)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.05e-47)
		tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
	elseif (F <= 1.7e-20)
		tmp = x / -B;
	else
		tmp = ((1.0 - x) / B) - (B * (x * -0.3333333333333333));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.05e-47], N[(N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-20], N[(x / (-B)), $MachinePrecision], N[(N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision] - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.05 \cdot 10^{-47}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.7 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.05000000000000001e-47

    1. Initial program 62.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 94.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 68.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    5. Taylor expanded in B around 0 50.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]
    6. Step-by-step derivation
      1. +-commutative50.4%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + -1 \cdot \frac{1 + x}{B}} \]
      2. mul-1-neg50.4%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg50.4%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
      4. associate-*r*50.4%

        \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot B\right) \cdot x} - \frac{1 + x}{B} \]
      5. *-commutative50.4%

        \[\leadsto \color{blue}{\left(B \cdot 0.3333333333333333\right)} \cdot x - \frac{1 + x}{B} \]
      6. associate-*l*50.4%

        \[\leadsto \color{blue}{B \cdot \left(0.3333333333333333 \cdot x\right)} - \frac{1 + x}{B} \]
    7. Simplified50.4%

      \[\leadsto \color{blue}{B \cdot \left(0.3333333333333333 \cdot x\right) - \frac{1 + x}{B}} \]

    if -2.05000000000000001e-47 < F < 1.6999999999999999e-20

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.3%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.3%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*99.5%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity99.4%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 24.3%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*24.3%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified24.3%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 21.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Taylor expanded in x around inf 39.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/39.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-139.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified39.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.6999999999999999e-20 < F

    1. Initial program 66.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 B around 0 34.0%

      \[\leadsto \left(-\color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in B around 0 25.7%

      \[\leadsto \left(-\left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Taylor expanded in F around inf 42.5%

      \[\leadsto \color{blue}{\frac{1}{B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)} \]
    6. Step-by-step derivation
      1. +-commutative42.5%

        \[\leadsto \frac{1}{B} - \color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)} \]
      2. associate--r+42.5%

        \[\leadsto \color{blue}{\left(\frac{1}{B} - \frac{x}{B}\right) - -0.3333333333333333 \cdot \left(B \cdot x\right)} \]
      3. div-sub42.5%

        \[\leadsto \color{blue}{\frac{1 - x}{B}} - -0.3333333333333333 \cdot \left(B \cdot x\right) \]
      4. *-commutative42.5%

        \[\leadsto \frac{1 - x}{B} - \color{blue}{\left(B \cdot x\right) \cdot -0.3333333333333333} \]
      5. associate-*l*42.5%

        \[\leadsto \frac{1 - x}{B} - \color{blue}{B \cdot \left(x \cdot -0.3333333333333333\right)} \]
    7. Simplified42.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{-47}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 36.6% accurate, 16.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1 - x}{B}\\ \mathbf{if}\;F \leq -9 \cdot 10^{+224}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{+179}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- 1.0 x) B)))
   (if (<= F -9e+224)
     t_0
     (if (<= F -6.5e+179) (/ -1.0 B) (if (<= F 8.5e-21) (/ x (- B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = (1.0 - x) / B;
	double tmp;
	if (F <= -9e+224) {
		tmp = t_0;
	} else if (F <= -6.5e+179) {
		tmp = -1.0 / B;
	} else if (F <= 8.5e-21) {
		tmp = x / -B;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (1.0d0 - x) / b
    if (f <= (-9d+224)) then
        tmp = t_0
    else if (f <= (-6.5d+179)) then
        tmp = (-1.0d0) / b
    else if (f <= 8.5d-21) then
        tmp = x / -b
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (1.0 - x) / B;
	double tmp;
	if (F <= -9e+224) {
		tmp = t_0;
	} else if (F <= -6.5e+179) {
		tmp = -1.0 / B;
	} else if (F <= 8.5e-21) {
		tmp = x / -B;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (1.0 - x) / B
	tmp = 0
	if F <= -9e+224:
		tmp = t_0
	elif F <= -6.5e+179:
		tmp = -1.0 / B
	elif F <= 8.5e-21:
		tmp = x / -B
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(1.0 - x) / B)
	tmp = 0.0
	if (F <= -9e+224)
		tmp = t_0;
	elseif (F <= -6.5e+179)
		tmp = Float64(-1.0 / B);
	elseif (F <= 8.5e-21)
		tmp = Float64(x / Float64(-B));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (1.0 - x) / B;
	tmp = 0.0;
	if (F <= -9e+224)
		tmp = t_0;
	elseif (F <= -6.5e+179)
		tmp = -1.0 / B;
	elseif (F <= 8.5e-21)
		tmp = x / -B;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -9e+224], t$95$0, If[LessEqual[F, -6.5e+179], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 8.5e-21], N[(x / (-B)), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1 - x}{B}\\
\mathbf{if}\;F \leq -9 \cdot 10^{+224}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq -6.5 \cdot 10^{+179}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{elif}\;F \leq 8.5 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -8.9999999999999995e224 or 8.4999999999999993e-21 < F

    1. Initial program 59.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in59.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative59.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/77.0%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*76.9%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define76.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity76.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg76.9%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg76.9%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified77.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 87.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*87.7%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified87.7%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 40.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]

    if -8.9999999999999995e224 < F < -6.50000000000000052e179

    1. Initial program 25.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 99.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 83.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    5. Taylor expanded in x around 0 59.5%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if -6.50000000000000052e179 < F < 8.4999999999999993e-21

    1. Initial program 94.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. Step-by-step derivation
      1. distribute-lft-neg-in94.0%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative94.0%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/96.8%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*96.8%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define96.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity96.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg96.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg96.8%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified96.9%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 29.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*29.7%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified29.7%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 24.1%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Taylor expanded in x around inf 36.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/36.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-136.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified36.4%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification39.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{+224}:\\ \;\;\;\;\frac{1 - x}{B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{+179}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 44.3% accurate, 20.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.55 \cdot 10^{-47}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.86 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.55e-47)
   (+ (* B (* x 0.3333333333333333)) (/ (- -1.0 x) B))
   (if (<= F 1.86e-20) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.55e-47) {
		tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
	} else if (F <= 1.86e-20) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.55d-47)) then
        tmp = (b * (x * 0.3333333333333333d0)) + (((-1.0d0) - x) / b)
    else if (f <= 1.86d-20) then
        tmp = x / -b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.55e-47) {
		tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
	} else if (F <= 1.86e-20) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.55e-47:
		tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B)
	elif F <= 1.86e-20:
		tmp = x / -B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.55e-47)
		tmp = Float64(Float64(B * Float64(x * 0.3333333333333333)) + Float64(Float64(-1.0 - x) / B));
	elseif (F <= 1.86e-20)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.55e-47)
		tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
	elseif (F <= 1.86e-20)
		tmp = x / -B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.55e-47], N[(N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.86e-20], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.55 \cdot 10^{-47}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.86 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.55e-47

    1. Initial program 62.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 94.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 68.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    5. Taylor expanded in B around 0 50.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]
    6. Step-by-step derivation
      1. +-commutative50.4%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + -1 \cdot \frac{1 + x}{B}} \]
      2. mul-1-neg50.4%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg50.4%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
      4. associate-*r*50.4%

        \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot B\right) \cdot x} - \frac{1 + x}{B} \]
      5. *-commutative50.4%

        \[\leadsto \color{blue}{\left(B \cdot 0.3333333333333333\right)} \cdot x - \frac{1 + x}{B} \]
      6. associate-*l*50.4%

        \[\leadsto \color{blue}{B \cdot \left(0.3333333333333333 \cdot x\right)} - \frac{1 + x}{B} \]
    7. Simplified50.4%

      \[\leadsto \color{blue}{B \cdot \left(0.3333333333333333 \cdot x\right) - \frac{1 + x}{B}} \]

    if -2.55e-47 < F < 1.86000000000000006e-20

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.3%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.3%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*99.5%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity99.4%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 24.3%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*24.3%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified24.3%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 21.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Taylor expanded in x around inf 39.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/39.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-139.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified39.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.86000000000000006e-20 < F

    1. Initial program 66.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. Step-by-step derivation
      1. distribute-lft-neg-in66.0%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative66.0%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/79.8%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*79.8%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define79.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity79.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg79.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg79.8%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 94.0%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*94.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified94.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 42.2%

      \[\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 -2.55 \cdot 10^{-47}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.86 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 44.2% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.5e-80)
   (/ (- -1.0 x) B)
   (if (<= F 7.2e-21) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e-80) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 7.2e-21) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-5.5d-80)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 7.2d-21) then
        tmp = x / -b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e-80) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 7.2e-21) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.5e-80:
		tmp = (-1.0 - x) / B
	elif F <= 7.2e-21:
		tmp = x / -B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.5e-80)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 7.2e-21)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.5e-80)
		tmp = (-1.0 - x) / B;
	elseif (F <= 7.2e-21)
		tmp = x / -B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.5e-80], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.2e-21], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 7.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.4999999999999997e-80

    1. Initial program 64.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 92.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 50.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg50.0%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac250.0%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified50.0%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]

    if -5.4999999999999997e-80 < F < 7.19999999999999979e-21

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.3%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.3%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*99.4%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity99.4%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg99.4%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 21.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*21.7%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified21.7%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 20.4%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Taylor expanded in x around inf 39.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/39.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-139.8%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified39.8%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 7.19999999999999979e-21 < F

    1. Initial program 66.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. Step-by-step derivation
      1. distribute-lft-neg-in66.0%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative66.0%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/79.8%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*79.8%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define79.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity79.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg79.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg79.8%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 94.0%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*94.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified94.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 42.2%

      \[\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.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 31.1% accurate, 23.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-100} \lor \neg \left(x \leq 1.25 \cdot 10^{-164}\right):\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -4e-100) (not (<= x 1.25e-164))) (/ x (- B)) (/ -1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -4e-100) || !(x <= 1.25e-164)) {
		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 <= (-4d-100)) .or. (.not. (x <= 1.25d-164))) 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 <= -4e-100) || !(x <= 1.25e-164)) {
		tmp = x / -B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -4e-100) or not (x <= 1.25e-164):
		tmp = x / -B
	else:
		tmp = -1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -4e-100) || !(x <= 1.25e-164))
		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 <= -4e-100) || ~((x <= 1.25e-164)))
		tmp = x / -B;
	else
		tmp = -1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -4e-100], N[Not[LessEqual[x, 1.25e-164]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-100} \lor \neg \left(x \leq 1.25 \cdot 10^{-164}\right):\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.0000000000000001e-100 or 1.2499999999999999e-164 < x

    1. Initial program 82.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in82.6%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative82.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/92.2%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*92.2%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define92.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity92.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg92.2%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg92.2%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified92.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}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 64.9%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*64.9%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified64.9%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 36.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Taylor expanded in x around inf 43.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/43.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-143.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified43.5%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if -4.0000000000000001e-100 < x < 1.2499999999999999e-164

    1. Initial program 66.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 31.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 25.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    5. Taylor expanded in x around 0 18.4%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-100} \lor \neg \left(x \leq 1.25 \cdot 10^{-164}\right):\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 17.8% accurate, 40.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.65 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x) :precision binary64 (if (<= F 1.65e-28) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 1.65e-28) {
		tmp = -1.0 / 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 (f <= 1.65d-28) then
        tmp = (-1.0d0) / 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 (F <= 1.65e-28) {
		tmp = -1.0 / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 1.65e-28:
		tmp = -1.0 / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 1.65e-28)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 1.65e-28)
		tmp = -1.0 / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 1.65e-28], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.65 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.6500000000000001e-28

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 63.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 60.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    5. Taylor expanded in x around 0 13.9%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if 1.6500000000000001e-28 < F

    1. Initial program 67.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. Step-by-step derivation
      1. distribute-lft-neg-in67.2%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative67.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/80.6%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*80.5%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define80.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity80.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg80.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg80.5%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified80.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf 90.9%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*90.9%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified90.9%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 40.9%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Taylor expanded in x around 0 22.6%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification16.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.65 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 10.6% 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 77.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 57.9%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  4. Taylor expanded in B around 0 55.7%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
  5. Taylor expanded in x around 0 10.2%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  6. Final simplification10.2%

    \[\leadsto \frac{-1}{B} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024039 
(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))))))