VandenBroeck and Keller, Equation (23)

Percentage Accurate: 64.0% → 98.7%
Time: 21.5s
Alternatives: 19
Speedup: 2.9×

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 19 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: 64.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.7% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-18}:\\
\;\;\;\;\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 < -2.55e7

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

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

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

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

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

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

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

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

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

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

    if -2.55e7 < F < 1.40000000000000006e-18

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.40000000000000006e-18 < F

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

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

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

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

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

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

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

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

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

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{0.5} \cdot \frac{F}{\sin B}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.1 \cdot 10^{+245}:\\ \;\;\;\;\frac{-1}{B} - t\_1\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-23}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.8 \cdot 10^{-71}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-90}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-47}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+183} \lor \neg \left(F \leq 1.85 \cdot 10^{+292}\right):\\ \;\;\;\;\frac{1}{B} - t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* (sqrt 0.5) (/ F (sin B)))) (t_1 (/ x (tan B))))
   (if (<= F -2.1e+245)
     (- (/ -1.0 B) t_1)
     (if (<= F -3.2e-23)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -5.8e-71)
         t_0
         (if (<= F 7.2e-90)
           (/ (* x (cos B)) (- (sin B)))
           (if (<= F 4.2e-47)
             t_0
             (if (or (<= F 6.2e+183) (not (<= F 1.85e+292)))
               (- (/ 1.0 B) t_1)
               (- (/ F (* F (sin B))) (/ x B))))))))))
double code(double F, double B, double x) {
	double t_0 = sqrt(0.5) * (F / sin(B));
	double t_1 = x / tan(B);
	double tmp;
	if (F <= -2.1e+245) {
		tmp = (-1.0 / B) - t_1;
	} else if (F <= -3.2e-23) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -5.8e-71) {
		tmp = t_0;
	} else if (F <= 7.2e-90) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 4.2e-47) {
		tmp = t_0;
	} else if ((F <= 6.2e+183) || !(F <= 1.85e+292)) {
		tmp = (1.0 / B) - t_1;
	} else {
		tmp = (F / (F * sin(B))) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt(0.5d0) * (f / sin(b))
    t_1 = x / tan(b)
    if (f <= (-2.1d+245)) then
        tmp = ((-1.0d0) / b) - t_1
    else if (f <= (-3.2d-23)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-5.8d-71)) then
        tmp = t_0
    else if (f <= 7.2d-90) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 4.2d-47) then
        tmp = t_0
    else if ((f <= 6.2d+183) .or. (.not. (f <= 1.85d+292))) then
        tmp = (1.0d0 / b) - t_1
    else
        tmp = (f / (f * sin(b))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = Math.sqrt(0.5) * (F / Math.sin(B));
	double t_1 = x / Math.tan(B);
	double tmp;
	if (F <= -2.1e+245) {
		tmp = (-1.0 / B) - t_1;
	} else if (F <= -3.2e-23) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -5.8e-71) {
		tmp = t_0;
	} else if (F <= 7.2e-90) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 4.2e-47) {
		tmp = t_0;
	} else if ((F <= 6.2e+183) || !(F <= 1.85e+292)) {
		tmp = (1.0 / B) - t_1;
	} else {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = math.sqrt(0.5) * (F / math.sin(B))
	t_1 = x / math.tan(B)
	tmp = 0
	if F <= -2.1e+245:
		tmp = (-1.0 / B) - t_1
	elif F <= -3.2e-23:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -5.8e-71:
		tmp = t_0
	elif F <= 7.2e-90:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 4.2e-47:
		tmp = t_0
	elif (F <= 6.2e+183) or not (F <= 1.85e+292):
		tmp = (1.0 / B) - t_1
	else:
		tmp = (F / (F * math.sin(B))) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(sqrt(0.5) * Float64(F / sin(B)))
	t_1 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -2.1e+245)
		tmp = Float64(Float64(-1.0 / B) - t_1);
	elseif (F <= -3.2e-23)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -5.8e-71)
		tmp = t_0;
	elseif (F <= 7.2e-90)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 4.2e-47)
		tmp = t_0;
	elseif ((F <= 6.2e+183) || !(F <= 1.85e+292))
		tmp = Float64(Float64(1.0 / B) - t_1);
	else
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = sqrt(0.5) * (F / sin(B));
	t_1 = x / tan(B);
	tmp = 0.0;
	if (F <= -2.1e+245)
		tmp = (-1.0 / B) - t_1;
	elseif (F <= -3.2e-23)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -5.8e-71)
		tmp = t_0;
	elseif (F <= 7.2e-90)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 4.2e-47)
		tmp = t_0;
	elseif ((F <= 6.2e+183) || ~((F <= 1.85e+292)))
		tmp = (1.0 / B) - t_1;
	else
		tmp = (F / (F * sin(B))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.1e+245], N[(N[(-1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.2e-23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.8e-71], t$95$0, If[LessEqual[F, 7.2e-90], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 4.2e-47], t$95$0, If[Or[LessEqual[F, 6.2e+183], N[Not[LessEqual[F, 1.85e+292]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq -5.8 \cdot 10^{-71}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 6.2 \cdot 10^{+183} \lor \neg \left(F \leq 1.85 \cdot 10^{+292}\right):\\
\;\;\;\;\frac{1}{B} - t\_1\\

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


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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative62.6%

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

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

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

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

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

    if -2.09999999999999996e245 < F < -3.19999999999999976e-23

    1. Initial program 62.8%

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

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

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

    if -3.19999999999999976e-23 < F < -5.7999999999999997e-71 or 7.19999999999999961e-90 < F < 4.2000000000000001e-47

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

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

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

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

    if -5.7999999999999997e-71 < F < 7.19999999999999961e-90

    1. Initial program 75.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Simplified84.3%

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

    if 4.2000000000000001e-47 < F < 6.1999999999999997e183 or 1.85000000000000005e292 < F

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative85.7%

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

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

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

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

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

    if 6.1999999999999997e183 < F < 1.85000000000000005e292

    1. Initial program 20.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/35.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.1 \cdot 10^{+245}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-23}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.8 \cdot 10^{-71}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-90}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-47}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+183} \lor \neg \left(F \leq 1.85 \cdot 10^{+292}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 91.8% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-18}:\\
\;\;\;\;F \cdot \left(\sqrt{0.5} \cdot \frac{1}{B}\right) - t\_0\\

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


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

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

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

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

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

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

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

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

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

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

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

    if -6.39999999999999951e-23 < F < -1.3000000000000001e-77

    1. Initial program 91.8%

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

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

    if -1.3000000000000001e-77 < F < 1.40000000000000006e-18

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.40000000000000006e-18 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{0.5} \cdot \frac{F}{\sin B}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.8 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_1\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-71}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-91}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-44}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* (sqrt 0.5) (/ F (sin B)))) (t_1 (/ x (tan B))))
   (if (<= F -1.8e-25)
     (- (/ -1.0 (sin B)) t_1)
     (if (<= F -6.2e-71)
       t_0
       (if (<= F 1.25e-91)
         (/ (* x (cos B)) (- (sin B)))
         (if (<= F 6.2e-44) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
	double t_0 = sqrt(0.5) * (F / sin(B));
	double t_1 = x / tan(B);
	double tmp;
	if (F <= -1.8e-25) {
		tmp = (-1.0 / sin(B)) - t_1;
	} else if (F <= -6.2e-71) {
		tmp = t_0;
	} else if (F <= 1.25e-91) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 6.2e-44) {
		tmp = t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_1;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt(0.5d0) * (f / sin(b))
    t_1 = x / tan(b)
    if (f <= (-1.8d-25)) then
        tmp = ((-1.0d0) / sin(b)) - t_1
    else if (f <= (-6.2d-71)) then
        tmp = t_0
    else if (f <= 1.25d-91) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 6.2d-44) 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 = Math.sqrt(0.5) * (F / Math.sin(B));
	double t_1 = x / Math.tan(B);
	double tmp;
	if (F <= -1.8e-25) {
		tmp = (-1.0 / Math.sin(B)) - t_1;
	} else if (F <= -6.2e-71) {
		tmp = t_0;
	} else if (F <= 1.25e-91) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 6.2e-44) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = math.sqrt(0.5) * (F / math.sin(B))
	t_1 = x / math.tan(B)
	tmp = 0
	if F <= -1.8e-25:
		tmp = (-1.0 / math.sin(B)) - t_1
	elif F <= -6.2e-71:
		tmp = t_0
	elif F <= 1.25e-91:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 6.2e-44:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(sqrt(0.5) * Float64(F / sin(B)))
	t_1 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.8e-25)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_1);
	elseif (F <= -6.2e-71)
		tmp = t_0;
	elseif (F <= 1.25e-91)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 6.2e-44)
		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 = sqrt(0.5) * (F / sin(B));
	t_1 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.8e-25)
		tmp = (-1.0 / sin(B)) - t_1;
	elseif (F <= -6.2e-71)
		tmp = t_0;
	elseif (F <= 1.25e-91)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 6.2e-44)
		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[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.8e-25], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -6.2e-71], t$95$0, If[LessEqual[F, 1.25e-91], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 6.2e-44], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{0.5} \cdot \frac{F}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.8 \cdot 10^{-25}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

\mathbf{elif}\;F \leq -6.2 \cdot 10^{-71}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 6.2 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.8e-25 < F < -6.20000000000000004e-71 or 1.24999999999999999e-91 < F < 6.19999999999999968e-44

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

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

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

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

    if -6.20000000000000004e-71 < F < 1.24999999999999999e-91

    1. Initial program 75.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Simplified84.3%

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

    if 6.19999999999999968e-44 < F

    1. Initial program 54.2%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-71}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-91}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-44}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 91.1% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-18}:\\
\;\;\;\;F \cdot \left(\sqrt{0.5} \cdot \frac{1}{B}\right) - t\_0\\

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


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

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

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

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

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

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

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

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

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

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

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

    if -2.9499999999999999e-25 < F < -2.14999999999999986e-74

    1. Initial program 91.8%

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

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

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

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

    if -2.14999999999999986e-74 < F < 1.40000000000000006e-18

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.40000000000000006e-18 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.95 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.15 \cdot 10^{-74}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-18}:\\ \;\;\;\;F \cdot \left(\sqrt{0.5} \cdot \frac{1}{B}\right) - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 91.8% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -8.6 \cdot 10^{-78}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-18}:\\
\;\;\;\;F \cdot \left(\sqrt{0.5} \cdot \frac{1}{B}\right) - t\_0\\

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.95e-24 < F < -8.59999999999999987e-78

    1. Initial program 91.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.59999999999999987e-78 < F < 1.40000000000000006e-18

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.40000000000000006e-18 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 79.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{0.5} \cdot \frac{F}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6.8 \cdot 10^{-25}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

\mathbf{elif}\;F \leq -6 \cdot 10^{-71}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 7 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 8 \cdot 10^{+182} \lor \neg \left(F \leq 1.02 \cdot 10^{+293}\right):\\
\;\;\;\;\frac{1}{B} - t\_1\\

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


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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000003e-25 < F < -6.0000000000000003e-71 or 1.34999999999999994e-89 < F < 6.9999999999999995e-44

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

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

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

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

    if -6.0000000000000003e-71 < F < 1.34999999999999994e-89

    1. Initial program 75.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    8. Simplified84.3%

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

    if 6.9999999999999995e-44 < F < 8.0000000000000005e182 or 1.02e293 < F

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative85.7%

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

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

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

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

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

    if 8.0000000000000005e182 < F < 1.02e293

    1. Initial program 20.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/35.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-71}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-89}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-44}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{+182} \lor \neg \left(F \leq 1.02 \cdot 10^{+293}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 66.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;x \leq -1.5 \cdot 10^{-113}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-104}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-58}:\\ \;\;\;\;\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 (<= x -1.5e-113)
     (- (/ -1.0 B) t_0)
     (if (<= x 1.2e-276)
       (* (sqrt 0.5) (/ F (sin B)))
       (if (<= x 2.9e-104)
         (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
         (if (<= x 2.3e-58)
           (- (/ -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 (x <= -1.5e-113) {
		tmp = (-1.0 / B) - t_0;
	} else if (x <= 1.2e-276) {
		tmp = sqrt(0.5) * (F / sin(B));
	} else if (x <= 2.9e-104) {
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if (x <= 2.3e-58) {
		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 (x <= (-1.5d-113)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (x <= 1.2d-276) then
        tmp = sqrt(0.5d0) * (f / sin(b))
    else if (x <= 2.9d-104) then
        tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    else if (x <= 2.3d-58) 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 (x <= -1.5e-113) {
		tmp = (-1.0 / B) - t_0;
	} else if (x <= 1.2e-276) {
		tmp = Math.sqrt(0.5) * (F / Math.sin(B));
	} else if (x <= 2.9e-104) {
		tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if (x <= 2.3e-58) {
		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 x <= -1.5e-113:
		tmp = (-1.0 / B) - t_0
	elif x <= 1.2e-276:
		tmp = math.sqrt(0.5) * (F / math.sin(B))
	elif x <= 2.9e-104:
		tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	elif x <= 2.3e-58:
		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 (x <= -1.5e-113)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (x <= 1.2e-276)
		tmp = Float64(sqrt(0.5) * Float64(F / sin(B)));
	elseif (x <= 2.9e-104)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B);
	elseif (x <= 2.3e-58)
		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 (x <= -1.5e-113)
		tmp = (-1.0 / B) - t_0;
	elseif (x <= 1.2e-276)
		tmp = sqrt(0.5) * (F / sin(B));
	elseif (x <= 2.9e-104)
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	elseif (x <= 2.3e-58)
		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[x, -1.5e-113], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 1.2e-276], N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e-104], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[x, 2.3e-58], 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}\;x \leq -1.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-276}:\\
\;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{-104}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\

\mathbf{elif}\;x \leq 2.3 \cdot 10^{-58}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.5e-113

    1. Initial program 40.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. Simplified47.6%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative91.5%

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

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

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

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

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

    if -1.5e-113 < x < 1.19999999999999991e-276

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

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

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

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

    if 1.19999999999999991e-276 < x < 2.9000000000000001e-104

    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 0 63.7%

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

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]

    if 2.9000000000000001e-104 < x < 2.2999999999999999e-58

    1. Initial program 66.7%

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

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

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

    if 2.2999999999999999e-58 < x

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative91.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{-113}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-104}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-58}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 66.3% accurate, 2.4× speedup?

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

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

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

\mathbf{elif}\;F \leq -2.7 \cdot 10^{-158}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

\mathbf{elif}\;F \leq 5.8 \cdot 10^{+182} \lor \neg \left(F \leq 1.25 \cdot 10^{+294}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\

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


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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative62.6%

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

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

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

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

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

    if -2.05000000000000002e245 < F < -6.39999999999999951e-23

    1. Initial program 62.8%

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

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

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

    if -6.39999999999999951e-23 < F < -2.6999999999999998e-158

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6999999999999998e-158 < F < 5.7999999999999997e182 or 1.25e294 < F

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative87.6%

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

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

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

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

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

    if 5.7999999999999997e182 < F < 1.25e294

    1. Initial program 20.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/35.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{+245}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6.4 \cdot 10^{-23}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.7 \cdot 10^{-158}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+182} \lor \neg \left(F \leq 1.25 \cdot 10^{+294}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 67.6% accurate, 2.4× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{+183} \lor \neg \left(F \leq 1.9 \cdot 10^{+292}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\

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


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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative62.6%

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

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

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

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

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

    if -3.8e245 < F < -3.80000000000000006e72

    1. Initial program 56.2%

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

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

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

    if -3.80000000000000006e72 < F < 2.24999999999999999e-157

    1. Initial program 77.5%

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

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

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

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

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

    if 2.24999999999999999e-157 < F < 2.2999999999999998e183 or 1.8999999999999999e292 < F

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative84.3%

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

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

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

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

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

    if 2.2999999999999998e183 < F < 1.8999999999999999e292

    1. Initial program 20.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/35.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{+245}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.8 \cdot 10^{+72}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.25 \cdot 10^{-157}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{+183} \lor \neg \left(F \leq 1.9 \cdot 10^{+292}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 66.8% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t\_0\\ \mathbf{if}\;F \leq -2.6 \cdot 10^{-24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{-157}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-283}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-292}:\\ \;\;\;\;\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))) (t_1 (- (/ -1.0 B) t_0)))
   (if (<= F -2.6e-24)
     t_1
     (if (<= F -1.35e-157)
       (/ (- (* F (sqrt 0.5)) x) B)
       (if (<= F -4.5e-283)
         t_1
         (if (<= F 6e-292) (/ x (- B)) (- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = (-1.0 / B) - t_0;
	double tmp;
	if (F <= -2.6e-24) {
		tmp = t_1;
	} else if (F <= -1.35e-157) {
		tmp = ((F * sqrt(0.5)) - x) / B;
	} else if (F <= -4.5e-283) {
		tmp = t_1;
	} else if (F <= 6e-292) {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = ((-1.0d0) / b) - t_0
    if (f <= (-2.6d-24)) then
        tmp = t_1
    else if (f <= (-1.35d-157)) then
        tmp = ((f * sqrt(0.5d0)) - x) / b
    else if (f <= (-4.5d-283)) then
        tmp = t_1
    else if (f <= 6d-292) then
        tmp = 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 t_1 = (-1.0 / B) - t_0;
	double tmp;
	if (F <= -2.6e-24) {
		tmp = t_1;
	} else if (F <= -1.35e-157) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else if (F <= -4.5e-283) {
		tmp = t_1;
	} else if (F <= 6e-292) {
		tmp = x / -B;
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = (-1.0 / B) - t_0
	tmp = 0
	if F <= -2.6e-24:
		tmp = t_1
	elif F <= -1.35e-157:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	elif F <= -4.5e-283:
		tmp = t_1
	elif F <= 6e-292:
		tmp = x / -B
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(Float64(-1.0 / B) - t_0)
	tmp = 0.0
	if (F <= -2.6e-24)
		tmp = t_1;
	elseif (F <= -1.35e-157)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	elseif (F <= -4.5e-283)
		tmp = t_1;
	elseif (F <= 6e-292)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	t_1 = (-1.0 / B) - t_0;
	tmp = 0.0;
	if (F <= -2.6e-24)
		tmp = t_1;
	elseif (F <= -1.35e-157)
		tmp = ((F * sqrt(0.5)) - x) / B;
	elseif (F <= -4.5e-283)
		tmp = t_1;
	elseif (F <= 6e-292)
		tmp = 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]}, Block[{t$95$1 = N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -2.6e-24], t$95$1, If[LessEqual[F, -1.35e-157], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.5e-283], t$95$1, If[LessEqual[F, 6e-292], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.35 \cdot 10^{-157}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

\mathbf{elif}\;F \leq -4.5 \cdot 10^{-283}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.6e-24 or -1.35e-157 < F < -4.4999999999999997e-283

    1. Initial program 61.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. Simplified71.6%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative68.6%

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

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

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

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

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

    if -2.6e-24 < F < -1.35e-157

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4999999999999997e-283 < F < 6.00000000000000031e-292

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in38.3%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval38.3%

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

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

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

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

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

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

    if 6.00000000000000031e-292 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{-24}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{-157}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-283}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-292}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 66.4% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -3.6 \cdot 10^{-160}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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


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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative62.6%

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

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

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

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

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

    if -5.8000000000000003e245 < F < -6.39999999999999951e-23

    1. Initial program 62.8%

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

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

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

    if -6.39999999999999951e-23 < F < -3.5999999999999997e-160

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5999999999999997e-160 < F

    1. Initial program 66.3%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative80.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{+245}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6.4 \cdot 10^{-23}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.6 \cdot 10^{-160}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 67.3% accurate, 2.9× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative73.7%

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

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

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

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

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

    if 1.39999999999999998e-150 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 61.0% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
  8. Step-by-step derivation
    1. +-commutative73.4%

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

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

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

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

    \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]
  11. Final simplification59.7%

    \[\leadsto \frac{-1}{B} - \frac{x}{\tan B} \]
  12. Add Preprocessing

Alternative 15: 39.1% accurate, 10.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 + x}{B}\\ t_1 := \frac{1 - x}{B}\\ \mathbf{if}\;F \leq -1.45 \cdot 10^{+205}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -2 \cdot 10^{+65}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq -12600000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-66} \lor \neg \left(F \leq 9.6 \cdot 10^{-117}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (+ -1.0 x) B)) (t_1 (/ (- 1.0 x) B)))
   (if (<= F -1.45e+205)
     t_0
     (if (<= F -2e+65)
       t_1
       (if (<= F -12600000000.0)
         t_0
         (if (or (<= F -6.2e-66) (not (<= F 9.6e-117))) t_1 (/ x (- B))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 + x) / B;
	double t_1 = (1.0 - x) / B;
	double tmp;
	if (F <= -1.45e+205) {
		tmp = t_0;
	} else if (F <= -2e+65) {
		tmp = t_1;
	} else if (F <= -12600000000.0) {
		tmp = t_0;
	} else if ((F <= -6.2e-66) || !(F <= 9.6e-117)) {
		tmp = t_1;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((-1.0d0) + x) / b
    t_1 = (1.0d0 - x) / b
    if (f <= (-1.45d+205)) then
        tmp = t_0
    else if (f <= (-2d+65)) then
        tmp = t_1
    else if (f <= (-12600000000.0d0)) then
        tmp = t_0
    else if ((f <= (-6.2d-66)) .or. (.not. (f <= 9.6d-117))) then
        tmp = t_1
    else
        tmp = x / -b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 + x) / B;
	double t_1 = (1.0 - x) / B;
	double tmp;
	if (F <= -1.45e+205) {
		tmp = t_0;
	} else if (F <= -2e+65) {
		tmp = t_1;
	} else if (F <= -12600000000.0) {
		tmp = t_0;
	} else if ((F <= -6.2e-66) || !(F <= 9.6e-117)) {
		tmp = t_1;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 + x) / B
	t_1 = (1.0 - x) / B
	tmp = 0
	if F <= -1.45e+205:
		tmp = t_0
	elif F <= -2e+65:
		tmp = t_1
	elif F <= -12600000000.0:
		tmp = t_0
	elif (F <= -6.2e-66) or not (F <= 9.6e-117):
		tmp = t_1
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 + x) / B)
	t_1 = Float64(Float64(1.0 - x) / B)
	tmp = 0.0
	if (F <= -1.45e+205)
		tmp = t_0;
	elseif (F <= -2e+65)
		tmp = t_1;
	elseif (F <= -12600000000.0)
		tmp = t_0;
	elseif ((F <= -6.2e-66) || !(F <= 9.6e-117))
		tmp = t_1;
	else
		tmp = Float64(x / Float64(-B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 + x) / B;
	t_1 = (1.0 - x) / B;
	tmp = 0.0;
	if (F <= -1.45e+205)
		tmp = t_0;
	elseif (F <= -2e+65)
		tmp = t_1;
	elseif (F <= -12600000000.0)
		tmp = t_0;
	elseif ((F <= -6.2e-66) || ~((F <= 9.6e-117)))
		tmp = t_1;
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -1.45e+205], t$95$0, If[LessEqual[F, -2e+65], t$95$1, If[LessEqual[F, -12600000000.0], t$95$0, If[Or[LessEqual[F, -6.2e-66], N[Not[LessEqual[F, 9.6e-117]], $MachinePrecision]], t$95$1, N[(x / (-B)), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -2 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq -12600000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq -6.2 \cdot 10^{-66} \lor \neg \left(F \leq 9.6 \cdot 10^{-117}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.4500000000000001e205 or -2e65 < F < -1.26e10

    1. Initial program 40.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}} \]
    4. Taylor expanded in B around 0 55.5%

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

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in55.5%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval55.5%

        \[\leadsto \frac{\color{blue}{-1} + \left(-x\right)}{B} \]
    6. Simplified55.5%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity55.5%

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

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

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

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

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

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

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

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

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

    if -1.4500000000000001e205 < F < -2e65 or -1.26e10 < F < -6.1999999999999995e-66 or 9.60000000000000057e-117 < F

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative68.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 40.6%

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

    if -6.1999999999999995e-66 < F < 9.60000000000000057e-117

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in26.6%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval26.6%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    7. Taylor expanded in x around inf 43.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{+205}:\\ \;\;\;\;\frac{-1 + x}{B}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{+65}:\\ \;\;\;\;\frac{1 - x}{B}\\ \mathbf{elif}\;F \leq -12600000000:\\ \;\;\;\;\frac{-1 + x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-66} \lor \neg \left(F \leq 9.6 \cdot 10^{-117}\right):\\ \;\;\;\;\frac{1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 44.9% accurate, 21.6× speedup?

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

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

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

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


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

    1. Initial program 60.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in48.2%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval48.2%

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

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

    if -3.6e-71 < F < 9.60000000000000057e-117

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in27.3%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval27.3%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    7. Taylor expanded in x around inf 45.1%

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

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

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

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

    if 9.60000000000000057e-117 < F

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative71.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 43.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.6 \cdot 10^{-71}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 33.7% accurate, 23.1× speedup?

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

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

\mathbf{elif}\;F \leq 2.5 \cdot 10^{+136}:\\
\;\;\;\;\frac{x}{-B}\\

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


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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in60.9%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval60.9%

        \[\leadsto \frac{\color{blue}{-1} + \left(-x\right)}{B} \]
    6. Simplified60.9%

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

        \[\leadsto \color{blue}{1 \cdot \frac{-1 + \left(-x\right)}{B}} \]
      2. add-sqr-sqrt24.4%

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

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

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

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

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

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

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

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

    if -2.6499999999999999e213 < F < 2.5000000000000001e136

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 61.4%

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in32.4%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval32.4%

        \[\leadsto \frac{\color{blue}{-1} + \left(-x\right)}{B} \]
    6. Simplified32.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    7. Taylor expanded in x around inf 36.6%

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

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

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

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

    if 2.5000000000000001e136 < F

    1. Initial program 39.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. Simplified53.3%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative50.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in x around 0 31.4%

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

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

Alternative 18: 33.5% accurate, 35.9× speedup?

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in35.6%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval35.6%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    7. Taylor expanded in x around inf 35.1%

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

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

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

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

    if 3.3000000000000002e140 < F

    1. Initial program 39.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. Simplified53.3%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/53.4%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity53.4%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative53.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow253.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine53.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified53.4%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 50.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. +-commutative50.6%

        \[\leadsto F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}\right) - \frac{x}{\tan B} \]
      2. unpow250.6%

        \[\leadsto F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}\right) - \frac{x}{\tan B} \]
      3. fma-undefine50.6%

        \[\leadsto F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}\right) - \frac{x}{\tan B} \]
    9. Simplified50.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\right)} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around inf 74.6%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in x around 0 31.4%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 3.3 \cdot 10^{+140}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 9.0% 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 65.3%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Simplified71.9%

    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
  3. Add Preprocessing
  4. Taylor expanded in x around 0 86.7%

    \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
  5. Step-by-step derivation
    1. associate-*l/86.7%

      \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
    2. *-lft-identity86.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
    3. +-commutative86.7%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
    4. unpow286.7%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
    5. fma-undefine86.7%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
  6. Simplified86.7%

    \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
  7. Taylor expanded in B around 0 73.4%

    \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
  8. Step-by-step derivation
    1. +-commutative73.4%

      \[\leadsto F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}\right) - \frac{x}{\tan B} \]
    2. unpow273.4%

      \[\leadsto F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}\right) - \frac{x}{\tan B} \]
    3. fma-undefine73.4%

      \[\leadsto F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}\right) - \frac{x}{\tan B} \]
  9. Simplified73.4%

    \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\right)} - \frac{x}{\tan B} \]
  10. Taylor expanded in F around inf 58.7%

    \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  11. Taylor expanded in x around 0 8.9%

    \[\leadsto \color{blue}{\frac{1}{B}} \]
  12. Final simplification8.9%

    \[\leadsto \frac{1}{B} \]
  13. Add Preprocessing

Reproduce

?
herbie shell --seed 2024058 
(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))))))